Comments (15)
Could you please provide more information about what is causing the crash? Does it happen whenever you open any .cpp file? Could you provide a copy of your c_cpp_properties.json file? This should be in the .vscode folder
from vscode-cpptools.
Hi thanks for replying. It was occurring whenever I opened VS code.
I have some folders in the workspace that was being opened when i opened vs code - raspberry pi/pico sdk etc but none with my own C++. (For context I'm just getting started with this dev environment on the mac and with the pi/pico.)
There's no file by that name in .vscode in my home folder:
$ rglob **/*cpp*.json
extensions/ms-vscode.cmake-tools-1.17.17/dist/src/cpptools.nls.metadata.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/cppdbg.ad7Engine.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/debugAdapters/bin/cppdbg.ad7Engine.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/cs/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/de/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/es/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/fr/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/it/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/ja/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/ko/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/pl/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/pt-br/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/ru/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/tr/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/zh-cn/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/schema/zh-tw/c_cpp_properties.schema.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/LanguageServer/cppBuildTaskProvider.nls.metadata.json
extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/cppTools.nls.metadata.json
extensions/ms-vscode.cpptools-themes-2.0.0/themes/cpptools_dark_vs.json
extensions/ms-vscode.cpptools-themes-2.0.0/themes/cpptools_dark_vs_new.json
extensions/ms-vscode.cpptools-themes-2.0.0/themes/cpptools_light_vs.json
extensions/ms-vscode.cpptools-themes-2.0.0/themes/cpptools_light_vs_new.json
from vscode-cpptools.
maybe this file?
c_cpp_properties.schema.json
c_cpp_properties.schema.json
from vscode-cpptools.
@m76589 The c_cpp_properties.json file would exist in your workspace folder's .vscode folder, but it won't exist unless you generated it via a command like C/C++: Edit Configuration. Without it, it uses defaults.
With 1.20.1, we've added crash call stack logging if you check the Help->Toggle Developer Tools->Console.
Otherwise, can you set C_Cpp.loggingLevel to "Debug" and check the "C/C++" pane logging to see what output occurs before the crash? Typically a crash restart will generate another "initialize" message.
from vscode-cpptools.
I've split my initial workspace into two smaller ones and the issue seems not to occur (only tested briefly).
From the debug info in the console there's some information that shows before the crash about something being used before initialized. The crashes occur when i open the workspace.
[ms-vscode.cpptools]Attempting to use languageClient before initialized
$onExtensionRuntimeError @ mainThreadExtensionService.ts:81
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1156
fire @ event.ts:1187
fire @ ipc.net.ts:650
q.onmessage @ localProcessExtensionHost.ts:376
mainThreadExtensionService.ts:82 Error: Attempting to use languageClient before initialized
at get languageClient [as languageClient] (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:49535:19)
at DefaultClient.onDidChangeVisibleTextEditors (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:50263:20)
at ClientCollection.recreateClients (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:52278:34)
at Object.closed (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:50139:50)
at LanguageClient.handleConnectionClosed (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:70439:72)
at LanguageClient.handleConnectionClosed (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:79219:22)
at closeHandler (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:70417:18)
at CallbackList.invoke (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:67219:39)
at Emitter.fire (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:67281:36)
at closeHandler (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:66234:26)
at CallbackList.invoke (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:67219:39)
at Emitter.fire (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:67281:36)
at StreamMessageWriter.fireClose (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:68151:27)
at Socket.<anonymous> (/Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/dist/src/main.js:68183:42)
at Socket.emit (node:events:517:28)
at Pipe.<anonymous> (node:net:350:12)
from vscode-cpptools.
@m76589 Can you try with 1.20.2 (pre-release)? It may be fixed in there or the crash call stack may be shown in the Console tab after using the 'Toggle Developer Tools' command.
from vscode-cpptools.
Ah. I see. Will do.
from vscode-cpptools.
@m76589 Also, I think Attempting to use languageClient before initialized
is just a symptom of the cpptools crash. Were you able to get any C/C++ logging to show up?
Also, if you don't get any logging, can check if you have /Users/mm/.vscode/extensions/ms-vscode.cpptools-1.19.9-darwin-x64/bin/cpptools (or whatever the version is) and the file is runnable?
from vscode-cpptools.
Hi Sean
Thank you for your help. I think these are the things you have asked for:
Crash call stack:
5workbench.desktop.main.js:sourcemap:152 [Extension Host] Crash call stack:
cpptools.txt
SIGSEGV
_sigtramp + 29
…
_ZNSt3__16__sortIRZN16cpptools_context10initializeEO23CppInitializationParamsE4 + 608
cpptools_context::initialize(CppInitializationParams&&) + 3496
_ZNSt3__110__function6__funcIZN11lsp_manager16register_requestI23CppInitializationParamsvZN16cpptools_contextC1EvE4 + 526
_ZN16thread_manager_t10queue_itemIZN11lsp_manager11deploy_taskERKN11thread_safeINS1_5stateENSt3__115recursive_mutexEE11safe_objectIS3_EEibE4 + 184
thread_manager_t::do_work(unsigned long) + 592
msvc::thread_helper_t::thread_entry(void*) + 20
C/C++ Logging:
loggingLevel: Debug
LSP: (received) cpptools/preinitialize (id: 1)
LSP: (invoked) cpptools/preinitialize (id: 1)
LSP: Sending response (id: 1)
LSP: (received) cpptools/initialize (id: 2)
LSP: (invoked) cpptools/initialize (id: 2)
cpptools version (TypeScript): 1.20.2
cpptools version (native): 1.20.2.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
LSP: (received) cpptools/preinitialize (id: 1)
LSP: (invoked) cpptools/preinitialize (id: 1)
LSP: Sending response (id: 1)
LSP: (received) cpptools/initialize (id: 2)
LSP: (received) cpptools/preinitialize (id: 1)
LSP: (invoked) cpptools/preinitialize (id: 1)
LSP: Sending response (id: 1)
LSP: (received) cpptools/initialize (id: 2)
LSP: (received) cpptools/preinitialize (id: 1)
LSP: (invoked) cpptools/preinitialize (id: 1)
LSP: Sending response (id: 1)
LSP: (received) cpptools/initialize (id: 2)
LSP: (received) cpptools/preinitialize (id: 1)
LSP: (invoked) cpptools/preinitialize (id: 1)
LSP: Sending response (id: 1)
LSP: (received) cpptools/initialize (id: 2)
from vscode-cpptools.
above updated due to copy-paste error.
from vscode-cpptools.
Hi @m76589 . Did your repro involve multiple workspace folders in a multi-root workspace that may have resolved to the same folder, due to a symbolic link in the file system, or some other reason why multiple paths wind up referring to the same folder? We believe we've identified a problem, but it would seem specific to multiple workspace folders in a workspace resolving to the same path. If that is not your scenario, there may be more for us to investigate.
from vscode-cpptools.
Yes - I have/had two folders that were "added to workspace" that were sub folders of another top level workspace folder.
However I didn't check whether there were any sym links in the folders. They were raspberry pi pico examples from github - so it's possible.
In general I add subfolders to the workspace a lot, due to the way folders open on the left when also opening files.
from vscode-cpptools.
Hi @m76589 . To clarify, the issue we've identified is specific to exactly the same 'workspace folder' being present multiple times in a multi-root workspace, at the root level. You would see exactly the same contents in both (or all such) workspace folders. Normally, it's not possible to add the same folder to a multi-root workspace twice, though VS Code does not appear to resolve symbolic links and can allow this to happen if the paths differ due to containing a symbolic link. If you can confirm whether or not this scenario is indeed what occurred in your repro, that would help us determine if we've addressed the issue or not.
from vscode-cpptools.
hi. Thanks for looking into this. Unfortunately I'm not with my laptop for two weeks now. If you want to try to reproduce... The folders i had open in the workspace were github repos for getting started with raspberry pi pico development. These were, from memory: pico-sdk, pico-extras, pico-examples, and pimoroni-pico. I had two of the sub folders open too: blink, helloword. That might suffice.
from vscode-cpptools.
@m76589 We think this is fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.20.3 , although we weren't able to repro your exact scenario so it's possible there could be another failure after the fix we made.
from vscode-cpptools.
Related Issues (20)
- [Bug] No intellisense from doxygen comments placed above template function declaration with separate implementation
- Crash in code_analysis::process_async::cleanup() HOT 4
- #include completion doesn't work for absolute paths
- identifier "size_t" is undefined, with clang 18 HOT 1
- Implement prepareRename so rename isn't invoked on comments/strings/etc. HOT 3
- Parentheses parsing and outline display errors HOT 1
- Increase retention time/policy for the dogfood vsix HOT 1
- IntelliSense does not use the correct header files for code inspection HOT 2
- gdb executes expression from hovering over a define (expression) without brackets HOT 2
- Enable clang-tidy/format to use terminal.integrated.automationProfile HOT 3
- Custom config updates result in unnecessary TU updates against the base config
- Enable C/C++: Log Diagnostics to be used without an active C/C++ file
- Deleting a folder with headers still suggests the deleted headers in include completion results with recursive includes
- [GDB pipe DOCKER] Breakpoint hit in runtime loaded lib may not respond in UI HOT 2
- ${defaultBuildTask} is not determined when using glob pattern for default task HOT 1
- VS Code Debugging C/C++ creates a file called "2" in working directory HOT 5
- Support for /FU flag broken C++/CLI project HOT 6
- No completion results are given when a scope operator is used after a comment block HOT 1
- 1.22.2 has some recursive includes related crashes HOT 7
- Build automation/tooling to support performance testing and monitoring of the extension HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cpptools.