microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

Compiler querying on Linux/Mac sometimes get stuck reading from stdout #7412

Closed lgritz closed 2 years ago

lgritz commented 3 years ago

Bug type: Language Service

Describe the bug

I can't seem to get Intellisense working for C++.

Steps to reproduce

  1. Make a new C++ file with this trivial code:

    include

    float foo () { std::vector bar; }

  2. Hover mouse over "bar". I expect it to tell me information about this variable, but it just says "Loading..."

  3. Add a line:

    bar.

Now at that point, I might expect it to pop up a list of methods I can use for bar. But nothing happens.

In contrast, if I make a new file that is Python, all the usual Intellisense features (for Python) work exactly as expected. It's only C++ where I'm having a problem.

I'm not sure what to try next or how to figure out why this isn't working.

When I try to run "C++ edit configurations", that also does nothing!

michelleangela commented 3 years ago

@lgritz

When I try to run "C++ edit configurations", that also does nothing!

This could mean that the C++ extension was not properly installed. Could you try un-installing and re-installing the C++ extension?

Note: the IntelliSense features for Python is separate from the C++ extension. That is the Python features are from the Python extension https://github.com/Microsoft/vscode-python.

lgritz commented 3 years ago

@michelleangela Hi, thanks, and sorry for the delay in replying.

Un-installing and re-installing the C++ extension does not help (nor does uninstalling and re-installing the entire VSCode).

Yeah, I understood that the Intellisense features for Python are from a different extension; I just thought that knowing that other plugin worked might help you narrow down the set of things that could be going wrong.

I find the fact that "C++ edit configurations" doesn't seem to do anything at all is very interesting. It's probably a wide part of the C++ extension that for some reason is not working properly, not just intellisense.

michelleangela commented 3 years ago

I find the fact that "C++ edit configurations" doesn't seem to do anything at all is very interesting. It's probably a wide part of the C++ extension that for some reason is not working properly, not just intellisense.

If all of the C++ extension commands are not working then it's likely the whole extension is having an issue and not the just IntelliSense feature. The IntelliSense features are provided by the cpptools and cpptools-srv processes, and the TypeScript portion of the extension talks to the cpptools process. Some commands, like the "C++ edit configurations" mostly involve work on the Typescript code and can run independently from the cpptools and cpptools-srv processes. Are both "C++ edit configurations (UI)" and "C++ edit configurations (JSON)" not working?

Could you double check the installation path of the vscode extensions: ~/.vscode/extensions and verify that all folders of "ms-vsocde.cpptools.*" are deleted after uninstalling? If there are folders for the C++ extensions, you can safely manually delete them.

Also, how did you install the C++ extension? Through the VS Code marketplace or using an offline VSIX from https://github.com/Microsoft/vscode-cpptools/releases? If initially through marketplace, could you try the offline VSIX?

If installation seems correct (no installation errors, no other folder versions of the extension are installed) and cpptools process is running, could you set "C_Cpp.loggingLevel" to "Debug" and share any log outputs?

@sean-mcmanus do you have any other ideas as to what's causing a command not to work?

sean-mcmanus commented 3 years ago

Also, might want to check the Help->Toggle Developer Tools->Console to see if you see logging from our extension with text "activating extension" (if not, our extension isn't activating...the Edit Configuration command itself should trigger an activation). If the offline vsix's still don't help, you might want to try debugging the issue yourself (see https://github.com/microsoft/vscode-cpptools/blob/release/Documentation/Building%20the%20Extension.md ).

rafaelchen commented 3 years ago

@lgritz : I have the similar issue in C/C++ Extension Version: v1.3.1. if I installed the previous version (e.g. 1.3.0). the extension works again.

michelleangela commented 3 years ago

@lgritz could you verify if this is still an issue with the latest version of C++ Extension (version 1.4.1 or insiders)??

michelleangela commented 3 years ago

@rafaelchen could you verify if this is still an issue with the latest version of C++ Extension (version 1.4.1 or insiders)?

rafaelchen commented 3 years ago

@rafaelchen could you verify if this is still an issue with the latest version of C++ Extension (version 1.4.1 or insiders)?

@michelleangela the issue disappears with latest version now, thanks.

lgritz commented 3 years ago

Hi, I'm still having trouble. Fresh VSCode install, cleared out ~/.vscode, reinstalled the latest C++ extension.

When I set the logging level to debug and open the developer console, I see errors like these:

electron/js2c/renderer_init.js:61 The vm module of Node.js is deprecated in the renderer process and will be removed.

workbench.desktop.main.js:62 [Extension Host] (node:88809) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.(Use `Code Helper (Renderer) --trace-deprecation ...` to show where the warning was created)

[Violation] 'setTimeout' handler took 60ms
[Violation] Forced reflow while executing JavaScript took 56ms
DevTools failed to load SourceMap: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/507ce72a4466fbb27b715c3722558bb15afa9f48/core/vs/workbench/workbench.desktop.main.js.map: Load canceled due to load timeout

Is any of that relevant?

sean-mcmanus commented 3 years ago

Those errors don't seem relevant. If those are the only logs you're seeing in the developer console then it appears our extension is not activating. Have you opened a C/C++ file or invoked a C/C++ command to trigger the activation? Are you able to get other extensions to activate?

lgritz commented 3 years ago

Other extensions all seem fine. It's only C++ that I'm having trouble with.

Yes, I have a small C++ file that I'm using to test.

sean-mcmanus commented 3 years ago

You're installing the C/C++ extension via the marketplace? Version 1.4.1? When you do that, do you initially see downloading logging messages, because it's supposed to download our macOS-specific binaries after the initial install. Have you tried installing an offline vsix: https://github.com/microsoft/vscode-cpptools/releases ?

@michelleangela @Colengms Any ideas? Seems like it could be a VS code bug.

lgritz commented 3 years ago

I was installing from the marketplace. Yes, 1.4.1. I uninstalled the extension and re-installed by downloading the vsix. Still fails, but I get this in the log window.

[2021-06-28 15:54:19.899] [exthost] [info] extension host started
[2021-06-28 15:54:19.947] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"}
[2021-06-28 15:54:19.948] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/microsoft-authentication/dist/extension.js
[2021-06-28 15:54:19.955] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.cpptools {"startup":false,"extensionId":{"value":"ms-vscode.cpptools","_lower":"ms-vscode.cpptools"},"activationEvent":"onLanguage:cpp"}
[2021-06-28 15:54:19.955] [exthost] [info] ExtensionService#loadCommonJSModule file:///Users/lg/.vscode/extensions/ms-vscode.cpptools-1.4.1/dist/main
[2021-06-28 15:54:19.981] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
[2021-06-28 15:54:19.981] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/debug-auto-launch/dist/extension
[2021-06-28 15:54:19.983] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-06-28 15:54:19.983] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/main
[2021-06-28 15:54:20.132] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
[2021-06-28 15:54:20.132] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.js-debug/src/extension.js
[2021-06-28 15:54:20.218] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-06-28 15:54:20.218] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github/dist/extension.js
[2021-06-28 15:54:20.273] [exthost] [info] eager extensions activated
[2021-06-28 15:54:20.282] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"}
[2021-06-28 15:54:20.282] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/github-authentication/dist/extension.js
[2021-06-28 15:54:20.287] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"}
[2021-06-28 15:54:20.287] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/emmet/dist/node/emmetNodeMain
[2021-06-28 15:54:20.291] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"}
[2021-06-28 15:54:20.291] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/merge-conflict/dist/mergeConflictMain
[2021-06-28 15:54:20.292] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"}
[2021-06-28 15:54:20.292] [exthost] [info] ExtensionService#loadCommonJSModule file:///Applications/Visual Studio Code.app/Contents/Resources/app/extensions/testing-editor-contributions/dist/extension.js
[2021-06-28 15:54:43.857] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2021-06-28 15:54:43.860] [exthost] [error] Error: timeout
    at Timeout._onTimeout (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:30165)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
[2021-06-28 15:55:13.736] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2021-06-28 15:55:13.736] [exthost] [error] Error: timeout
    at Timeout._onTimeout (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:30165)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
[2021-06-28 15:55:27.376] [exthost] [error] onWillSaveTextDocument-listener from extension 'ms-vscode.cpptools' threw ERROR
[2021-06-28 15:55:27.376] [exthost] [error] Error: timeout
    at Timeout._onTimeout (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:30165)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
sean-mcmanus commented 3 years ago

Are you on an ARM64 M1 mac?

lgritz commented 3 years ago

Intel MacBookPro 2019 16" running Catalina 10.15.7

sean-mcmanus commented 3 years ago

That log window doesn't show everything. Can you view the Help->Toggle Developer Tools->Console and look for "activating extension" (it should also show the path to the extension) and any errors from our extension?

lgritz commented 3 years ago
[Extension Host] activating extension
console.ts:137 [Extension Host] starting language server

But nonetheless, hovering mouse over a symbol just shows "Loading..." forever. Also, using the command palette to select any of "C/C++: Edit configurations (UI)", "C/C++: Edit configurations (JSON)", or "C/C++: Reset Intellisense Database"... all do nothing discernible at all.

Is it possible that this is a permissions problem? Like, some MacOS permissions need to be set for VSCode that I'm lacking?

sean-mcmanus commented 3 years ago

The extension activating is good -- it means the install looks okay.

Your database might be being created in an invalid location (which it may not have write permissions for). Can you set the workspace folder's C_Cpp.default.browse.databaseFilename to something like "${workspaceFolder}/.vscode/vc.db" to make sure that file is getting created? If that still doesn't work, can you enable our debug logging (see https://code.visualstudio.com/docs/cpp/enable-logging-cpp)?

sean-mcmanus commented 3 years ago

Also, when you close VS Code, can you make sure no cpptools processes are running and then check if one gets started after opening VS code?

lgritz commented 3 years ago

Yes LOTS of copies of ~/.vscode/extensions/ms-vscode.cpptools-1.4.1/bin/cpptools still running even after exiting vscode.

Killed them all, then restarted vscode. Did not help.

Changed the databaseFilename as specified, also doesn't seem to help. And no matter what I do to test it out, I never see a vc.db file show up in .vscode in that folder, including if I "rescan workspace" or "reset intellisense database".

Cpp logging level was already set to "debug". But interestingly, I don't see "C++" as one of the choices in the pulldown choices of filters in the output window.

Is maybe there something misconfigured that is screwing me up, that somehow survives an uninstall and reinstall of VSCode itself? Something tucked away in my ~/Library or similar? What is the simplest way to get my account and machine to the state where I never had VSCode installed at all? Maybe if I can get back to that point and start fresh, I will have better luck. At some point in the distant past, I did have this seemingly working!

sean-mcmanus commented 3 years ago

It looks like cpptools is getting stuck for some reason soon after being launched. Can you attach a debugger to https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv to get a call stack (ignoring threads that don't appear to have any work)?

I don't recall any similar reports like this, so something really unusual is happening.

lgritz commented 3 years ago

When I try to attach from inside vscode, I get a dialog box that says:

Unable to start debugging. Program path '/Users/lg/.vscode/extensions/ms-vscode.cpptools-1.4.1/bin/cpptools' is missing or invalid.

LLDB failed with message: Command 'target-attach'. Attach to process failed: 

This may occur if the process's executable was changed after the process was started, such as when installing an update. Try re-launching the application or restarting the machine.
sean-mcmanus commented 3 years ago

Yeah, I'm also unable to attach to cpptools on Mac using lldb or gdb (it used to work). @WardenGnaw Do you know what's going on?

WardenGnaw commented 3 years ago

From the logs, looks like cpptools is invalid. Are you able to start it via command line?

E.g. Run /Users/lg/.vscode/extensions/ms-vscode.cpptools-1.4.1/bin/cpptools

Are you able to attach with just lldb? https://lldb.llvm.org/use/tutorial.html#starting-or-attaching-to-your-program

sean-mcmanus commented 3 years ago

For me, it starts on the command line and lldb attaching works.

lgritz commented 3 years ago
(lldb) process attach --pid 48597
error: attach failed: attach failed (Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries when the attached failed.  The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)

Looking in Console.app, what I see is:

default 11:44:28.294471-0700    debugserver debugserver will use os_log for internal logging.
default 11:44:28.294775-0700    debugserver debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-1200.0.44
 for x86_64.
default 11:44:28.294895-0700    debugserver Got a connection, waiting for process information for launching or attaching.
error   11:44:28.300263-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.300304-0700    debugserver 1 +0.000000 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.300225-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.311733-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.311671-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
default 11:44:28.311794-0700    debugserver 2 +0.011499 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.323997-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.324028-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.324065-0700    debugserver 3 +0.012269 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.334587-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.334625-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.334661-0700    debugserver 4 +0.010596 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.346339-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.346369-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.346398-0700    debugserver 5 +0.011738 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.358072-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.358123-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.358190-0700    debugserver 6 +0.011768 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.369606-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.369628-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.369674-0700    debugserver 7 +0.011488 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.380147-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.380172-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.380304-0700    debugserver 8 +0.010598 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.392435-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.392461-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.392484-0700    debugserver 9 +0.012234 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005
default 11:44:28.403062-0700    kernel  macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (cpptools) (pid: 48597): (cpptools) is hardened, (cpptools) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger
error   11:44:28.403131-0700    debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure)
default 11:44:28.403202-0700    debugserver 10 +0.010691 sec [be71/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 48597, &task ) => err = 0x00000005 ((os/kern) failure) (0x0000000
error   11:44:28.415208-0700    debugserver error: MachTask::StartExceptionThread (): task invalid, exception thread start failed.
error   11:44:28.415226-0700    debugserver error: MachProcess::AttachForDebug failed to start exception thread: unable to start the exception thread
error   11:44:28.415910-0700    debugserver error: Attach failed: "Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries when the attached failed.  The subsystem that denied the attach permission will likely have logged an informative message ab
default 11:44:28.415929-0700    debugserver error: attach failed.
default 11:44:28.415971-0700    debugserver 11 +0.012792 sec [be71/2903]: error: ::read ( 6, 0x700004a34b00, 1024 ) => -1 err = Bad file descriptor (0x00000009)
default 11:44:28.416027-0700    debugserver Exiting.
WardenGnaw commented 3 years ago

Ah, because cpptools is hardened, you will need to disable SIP.

@sean-mcmanus If you want customers to debug your binary, you might want to add get-task-allow as an entitlement to cpptools when hardening.

sean-mcmanus commented 3 years ago

@WardenGnaw Okay, looks like my machine had the SIP disabled. I re-enabled it and got the same failure. I'll see if adding the get-task-allow to our plist fixes it...although I was hitting some other failure with lldb with SIP disabled (no error message, but break wasn't working).

lgritz commented 3 years ago

Sorry for the delay, I needed to wait until it was convenient for me to reboot in order to disable SIP.

Would you believe that once I disabled SIP, then rebooted and got back to the point where I could run vscode on my test file... IT WORKS.

Of course, I would like to re-enable SIP eventually. But does this give any hints about what might be going wrong?

It's late here now, I'm a little exhausted but in the morning I will reboot again, re-enable SIP, and see if it renders C++ intellisense inoperable again

lgritz commented 3 years ago

Couldn't wait. Rebooted again. Re-enable SIP. Reboot.

WORKS.

I have no idea what to make of this. Any theories?

sean-mcmanus commented 3 years ago

Could the restart have fixed it? We're not sure what was causing cpptools to get stuck. Or maybe changing the SIP fixed some bug in the OS? If you repro the problem again and get a call stack, that could help identify the cause, but we haven't received similar reports so it seems like a rare occurrence.

We're looking into adding the get-task-allow entitlement so that a call stack can be obtained while SIP is enabled. UPDATE: 1.5.0-insiders3 should have the entitlements on the binaries, fixing the "target-attach" error.

lgritz commented 3 years ago

The problem has been plaguing me for months, so has persisted through many, many restarts. It doesn't seem likely that it was the reboot alone that helped. It has to be the SIP toggling.

But I did wonder if something got unwedged when I switched off SIP? No hypothesis about what it might be. But I turned SIP back on will keep an eye on whether things keep working.

I still have the following question, however: Is there either a program feature or a set of clear instructions that will 100% for sure remove every last remnant VSCode or its artifacts, so that the next install will be indistinguishable from the first install you ever do on a machine?

Thanks for all the help, by the way, especially the tight communications loop in the last couple days.

sean-mcmanus commented 3 years ago

The only thing I know to do is to uninstall VS Code...theoretically, that should remove everything, but you could also double check at the physical file locations in case there was some problem removing something. If doing that doesn't work for some case, you may want to file a VS Code issue https://github.com/microsoft/vscode/issues . I'm assuming you're not using the settings syncing feature.

lgritz commented 3 years ago

Uninstalling VSCode (on Mac) just removes what's in /Applications. That wouldn't remove anything in ~/Library, for example, so if there is some setting you've long forgotten about that is causing a misbehavior, or a corrupted database or something, it can be very tricky to figure out where that might live. A handy feature might be a thorough "return all user options to factory settings and flush all caches and databases."

sean-mcmanus commented 3 years ago

VS Code stores data in ~/Library? I don't see any.

lgritz commented 3 years ago

$ cd ~/Library $ fd vscode

Caches/com.microsoft.VSCode
Caches/vscode-cpptools
Caches/com.microsoft.VSCode.ShipIt
Preferences/com.microsoft.VSCode.plist
Preferences/ByHost/com.microsoft.VSCode.ShipIt.91EE0198-51E1-555B-A3BC-E3ACE9BFBAA0.plist
Saved Application State/com.microsoft.VSCode.savedState
Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl2
Application Support/Code/CachedExtensionVSIXs/ms-vscode.cpptools-1.4.1
Application Support/Code/CachedExtensionVSIXs/ms-python.vscode-pylance-2021.6.3
Application Support/Code/User/workspaceStorage/df84cd7a565c5b1d4ba0144921f351a5/ms-vscode.cpptools
Application Support/Code/User/workspaceStorage/4452022407e78fba4887dd7ab2ca6348/ms-vscode.cpptools
Application Support/Code/User/workspaceStorage/1eaa37c1a5e35e01ebd6c64d193180f5/ms-vscode.cpptools
Application Support/Code/User/workspaceStorage/ce9408954e065721049090c6561a41b8/ms-vscode.cpptools
Application Support/Code/CachedData/3c4e3df9e89829dce27b7b5c24508306b151f30d/vscode-e1d108fd149352c264576a2cc0954b0c.code
Application Support/Code/User/workspaceStorage/156690e4971cf95480b5bd48cfb519de/ms-vscode.cpptools
lgritz commented 3 years ago

Those are the ones I can find easily, because the files contain the string "vscode" that I thought to search for. If vscode stores anything in files that don't contain those strings, I wouldn't necessarily be able to find them.

sean-mcmanus commented 3 years ago

Yeah, searching online, seems like other VS Code users on mac hit the same issue...VS Code team seems to recommend manually deleted those folders...might be worth filing a VS Code feature request -- I see one for Windows at https://github.com/microsoft/vscode/issues/66837 but I didn't see a Mac one.

lgritz commented 3 years ago

I filed an issue as suggested.

But, dammit, that gave me an excuse to try launching vscode again (was busy in meetings all day), and of course now it does not work again. Same as before.

I don't have the patience at the moment for the 4-reboot cycle it requires to toggling SIP again. Maybe later tonight, and if so, I will try to report back with the results of attaching lldb. Though I'm not quite sure how well that will work -- if I can't catch it misbehaving with SIP disabled, and I can't attach the debugger with SIP enabled when it misbehaves... um, that's quite the conundrum.

sean-mcmanus commented 3 years ago

We plan to publish 1.5.0-insiders3 in 22 hours or so if you want to wait for that, which should allow attaching with SIP (if you don't want to turn SIP off).

sean-mcmanus commented 3 years ago

You should be able to attach to our binaries with SIP enabled with https://github.com/microsoft/vscode-cpptools/releases/tag/1.5.0-insiders3 .

lgritz commented 3 years ago

Does this help?

$ lldb
(lldb) process attach --pid 74041
Process 74041 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff693e269e libsystem_kernel.dylib`__read_nocancel + 10
libsystem_kernel.dylib`__read_nocancel:
->  0x7fff693e269e <+10>: jae    0x7fff693e26a8            ; <+20>
    0x7fff693e26a0 <+12>: movq   %rax, %rdi
    0x7fff693e26a3 <+15>: jmp    0x7fff693e1629            ; cerror_nocancel
    0x7fff693e26a8 <+20>: retq
Target 0: (cpptools) stopped.

Executable module set to "/Users/lg/.vscode/extensions/ms-vscode.cpptools-1.5.0-insiders3/bin/cpptools".
Architecture set to: x86_64h-apple-macosx-.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff693e269e libsystem_kernel.dylib`__read_nocancel + 10
    frame #1: 0x00007fff6932f2cb libsystem_c.dylib`_sread + 16
    frame #2: 0x00007fff6932e946 libsystem_c.dylib`__srefill1 + 24
    frame #3: 0x00007fff6932ea68 libsystem_c.dylib`__srget + 14
    frame #4: 0x00007fff6932ad1c libsystem_c.dylib`getc + 52
    frame #5: 0x00007fff6657ebc9 libc++.1.dylib`std::__1::__stdinbuf<char>::__getchar(bool) + 109
    frame #6: 0x000000010e6152c6 cpptools`std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::getline<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, char) + 150
    frame #7: 0x000000010e5d21ab cpptools`vscode::message_handler::main_loop() + 1739
    frame #8: 0x000000010e5ce91e cpptools`main + 206
    frame #9: 0x00007fff6929fcc9 libdyld.dylib`start + 1
sean-mcmanus commented 3 years ago

No, that's just the main/input thread waiting for stdin. Can you get the call stacks for other threads? It should be a thread that has a non-empty/non-trivial looking call stack (i.e. the worker threads with shallow call stacks can be ignored).

If you attach with VS Code it should show you all the threads unless you hit a bug with pause threads not working (which I was hitting, but I'm not sure how widespread that is).

lgritz commented 3 years ago

OK, relaunch and 'bt' on all 3 of the cpptools processes:

$ ps -ef | grep cpp
  501 75133     1   0 10:45am ??         0:00.03 /Users/lg/.vscode/extensions/ms-vscode.cpptools-1.5.0-insiders3/bin/cpptools
  501 75363     1   0 10:48am ??         0:00.03 /Users/lg/.vscode/extensions/ms-vscode.cpptools-1.5.0-insiders3/bin/cpptools
  501 75382 75376   0 10:48am ??         0:00.03 /Users/lg/.vscode/extensions/ms-vscode.cpptools-1.5.0-insiders3/bin/cpptools
  501 75404   847   0 10:48am ttys009    0:00.00 /usr/bin/grep --color cpp
lg@unagi20 ~/vstest3 $ lldb
(lldb) process attach --pid 75133
Process 75133 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff693e255e libsystem_kernel.dylib`__ulock_wait + 10
libsystem_kernel.dylib`__ulock_wait:
->  0x7fff693e255e <+10>: jae    0x7fff693e2568            ; <+20>
    0x7fff693e2560 <+12>: movq   %rax, %rdi
    0x7fff693e2563 <+15>: jmp    0x7fff693e1629            ; cerror_nocancel
    0x7fff693e2568 <+20>: retq
Target 0: (cpptools) stopped.

Executable module set to "/Users/lg/.vscode/extensions/ms-vscode.cpptools-1.5.0-insiders3/bin/cpptools".
Architecture set to: x86_64h-apple-macosx-.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff693e255e libsystem_kernel.dylib`__ulock_wait + 10
    frame #1: 0x00007fff694a55c2 libsystem_pthread.dylib`_pthread_join + 347
    frame #2: 0x00007fff665a95e6 libc++.1.dylib`std::__1::thread::join() + 24
    frame #3: 0x000000010a22aa8f cpptools`vscode::message_handler::main_loop() + 4015
    frame #4: 0x000000010a22691e cpptools`main + 206
    frame #5: 0x00007fff6929fcc9 libdyld.dylib`start + 1

(lldb) process attach --pid 75363
There is a running process, detach from it and attach?: [Y/n] y
Process 75133 detached
Process 75363 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff693e255e libsystem_kernel.dylib`__ulock_wait + 10
libsystem_kernel.dylib`__ulock_wait:
->  0x7fff693e255e <+10>: jae    0x7fff693e2568            ; <+20>
    0x7fff693e2560 <+12>: movq   %rax, %rdi
    0x7fff693e2563 <+15>: jmp    0x7fff693e1629            ; cerror_nocancel
    0x7fff693e2568 <+20>: retq
Target 0: (cpptools) stopped.

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff693e255e libsystem_kernel.dylib`__ulock_wait + 10
    frame #1: 0x00007fff694a55c2 libsystem_pthread.dylib`_pthread_join + 347
    frame #2: 0x00007fff665a95e6 libc++.1.dylib`std::__1::thread::join() + 24
    frame #3: 0x000000010ea18a8f cpptools`vscode::message_handler::main_loop() + 4015
    frame #4: 0x000000010ea1491e cpptools`main + 206
    frame #5: 0x00007fff6929fcc9 libdyld.dylib`start + 1

(lldb) process attach --pid 75382
There is a running process, detach from it and attach?: [Y/n] y
Process 75363 detached
Process 75382 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff693e269e libsystem_kernel.dylib`__read_nocancel + 10
libsystem_kernel.dylib`__read_nocancel:
->  0x7fff693e269e <+10>: jae    0x7fff693e26a8            ; <+20>
    0x7fff693e26a0 <+12>: movq   %rax, %rdi
    0x7fff693e26a3 <+15>: jmp    0x7fff693e1629            ; cerror_nocancel
    0x7fff693e26a8 <+20>: retq
Target 0: (cpptools) stopped.

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff693e269e libsystem_kernel.dylib`__read_nocancel + 10
    frame #1: 0x00007fff6932f2cb libsystem_c.dylib`_sread + 16
    frame #2: 0x00007fff6932e946 libsystem_c.dylib`__srefill1 + 24
    frame #3: 0x00007fff6932ea68 libsystem_c.dylib`__srget + 14
    frame #4: 0x00007fff6932ad1c libsystem_c.dylib`getc + 52
    frame #5: 0x00007fff6657ebc9 libc++.1.dylib`std::__1::__stdinbuf<char>::__getchar(bool) + 109
    frame #6: 0x00000001083e22c6 cpptools`std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::getline<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, char) + 150
    frame #7: 0x000000010839f1ab cpptools`vscode::message_handler::main_loop() + 1739
    frame #8: 0x000000010839b91e cpptools`main + 206
    frame #9: 0x00007fff6929fcc9 libdyld.dylib`start + 1
sean-mcmanus commented 3 years ago

There should only be 1 cpptools process, each of which has several threads. You only need to debug one of the processes (the others might be dangling and should be killed). We need the additional threads from one of those processes.

The 2 dangling processes appears be stuck on a thread join (i.e. waiting for some other threads to finish before shutting down). It's possible one of those processes has a lock on the database and could cause the bug you're hitting.

lgritz commented 3 years ago
$ lldb
(lldb) process attach --pid 75882
Process 75882 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff693e269e libsystem_kernel.dylib`__read_nocancel + 10
libsystem_kernel.dylib`__read_nocancel:
->  0x7fff693e269e <+10>: jae    0x7fff693e26a8            ; <+20>
    0x7fff693e26a0 <+12>: movq   %rax, %rdi
    0x7fff693e26a3 <+15>: jmp    0x7fff693e1629            ; cerror_nocancel
    0x7fff693e26a8 <+20>: retq
Target 0: (cpptools) stopped.

Executable module set to "/Users/lg/.vscode/extensions/ms-vscode.cpptools-1.5.0-insiders3/bin/cpptools".
Architecture set to: x86_64h-apple-macosx-.
(lldb) bt all
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff693e269e libsystem_kernel.dylib`__read_nocancel + 10
    frame #1: 0x00007fff6932f2cb libsystem_c.dylib`_sread + 16
    frame #2: 0x00007fff6932e946 libsystem_c.dylib`__srefill1 + 24
    frame #3: 0x00007fff6932ea68 libsystem_c.dylib`__srget + 14
    frame #4: 0x00007fff6932ad1c libsystem_c.dylib`getc + 52
    frame #5: 0x00007fff6657ebc9 libc++.1.dylib`std::__1::__stdinbuf<char>::__getchar(bool) + 109
    frame #6: 0x00000001020b52c6 cpptools`std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::getline<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, char) + 150
    frame #7: 0x00000001020721ab cpptools`vscode::message_handler::main_loop() + 1739
    frame #8: 0x000000010206e91e cpptools`main + 206
    frame #9: 0x00007fff6929fcc9 libdyld.dylib`start + 1
  thread #2
    frame #0: 0x00007fff693e5766 libsystem_kernel.dylib`kevent + 10
    frame #1: 0x0000000102755732 cpptools`uv__io_poll + 898
    frame #2: 0x000000010274df41 cpptools`uv_run + 465
    frame #3: 0x00000001026bb3d0 cpptools`msvc::loop_t::run_loop() + 64
    frame #4: 0x00000001026bfb4a cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(std::__1::shared_ptr<msvc::loop_t>), std::__1::shared_ptr<msvc::loop_t> > >(void*) + 74
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #3
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #4
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #5
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #6
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #7
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #8
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #9
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #10
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #11
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #12
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #13
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #14
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #15
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #16
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #17
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #18
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x000000010211753b cpptools`msvc::thread_pool::do_work(unsigned long) + 363
    frame #4: 0x0000000102118fb1 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::add_threads()::$_1> >(void*) + 49
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #19
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572623 libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 93
    frame #3: 0x000000010204af1b cpptools`std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 171
    frame #4: 0x0000000102118f27 cpptools`unsigned int msvc::bitset_event_t::wait_for_any_set<long long, std::__1::ratio<1l, 1000l> >(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> > const&, unsigned int) + 103
    frame #5: 0x0000000102118e22 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, msvc::thread_pool::thread_pool()::$_0> >(void*) + 306
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #20
    frame #0: 0x00007fff693e181e libsystem_kernel.dylib`read + 10
    frame #1: 0x000000010215ded7 cpptools`exec_command_and_get_output(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, unsigned int) + 1351
    frame #2: 0x0000000101fe5858 cpptools`gcc_info::get_system_defaults(gcc_info::compiler_defaults const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, compilation_args&) + 9784
    frame #3: 0x0000000101feb2e9 cpptools`gcc_info::gcc_info(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, vscode::ext::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, vscode::ext::optional<IntelliSenseMode> const&) + 825
    frame #4: 0x0000000101febf82 cpptools`gcc_info::gcc_info(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, vscode::ext::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, vscode::ext::optional<IntelliSenseMode> const&) + 34
    frame #5: 0x0000000101fa7807 cpptools`compiler_info::find_or_create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, vscode::ext::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, vscode::ext::optional<IntelliSenseMode> const&, bool&) + 439
    frame #6: 0x0000000101fa51f6 cpptools`compiler_info::get(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, vscode::ext::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, bool, vscode::ext::optional<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, vscode::ext::optional<IntelliSenseMode> const&, bool, vscode::ext::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool*) + 2470
    frame #7: 0x0000000101fc5c25 cpptools`compiler_info::get(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, configuration const&, bool) + 197
    frame #8: 0x0000000101fc5965 cpptools`configuration::get_compiler_info(bool) const + 85
    frame #9: 0x000000010209cc87 cpptools`vscode::message_handler::cpptools_queryCompilerDefaults() + 247
    frame #10: 0x0000000102078c38 cpptools`vscode::message_handler::dispatch(vscode::vscode_client_message&&, vscode::vscode_server_message&, vscode::message_handler::msg_proc_thread_token) + 19864
    frame #11: 0x0000000102073dc7 cpptools`vscode::message_handler::handle_message(vscode::vscode_client_message&&, vscode::message_handler::msg_proc_thread_token) + 55
    frame #12: 0x00000001020e45d0 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, vscode::message_handler::main_loop()::$_4> >(void*) + 2384
    frame #13: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #14: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #21
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e57d2 cpptools`vscode::message_deque<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false>::pop_impl(bool) + 82
    frame #4: 0x00000001020e56ad cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, vscode::message_handler::main_loop()::$_5> >(void*) + 77
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #22
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e7082 cpptools`vscode::message_deque<vscode::folding_ranges_params, false>::pop_impl(bool) + 82
    frame #4: 0x00000001020e6efd cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_7, std::__1::allocator<vscode::message_handler::main_loop()::$_7>, void ()>::operator()() + 61
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #23
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e6432 cpptools`vscode::message_deque<vscode::browse_engine_update_action, false>::pop_impl(bool) + 82
    frame #4: 0x00000001020e5b5e cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_6, std::__1::allocator<vscode::message_handler::main_loop()::$_6>, void ()>::operator()() + 110
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #24
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e78c2 cpptools`vscode::message_deque<vscode::vscode_client_message, false>::pop_impl(bool) + 98
    frame #4: 0x00000001020e779d cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_8, std::__1::allocator<vscode::message_handler::main_loop()::$_8>, void ()>::operator()() + 61
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #25
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e78c2 cpptools`vscode::message_deque<vscode::vscode_client_message, false>::pop_impl(bool) + 98
    frame #4: 0x00000001020e7acd cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_9, std::__1::allocator<vscode::message_handler::main_loop()::$_9>, void ()>::operator()() + 61
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #26
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e8182 cpptools`vscode::message_deque<vscode::message_handler::parse_file_entry, true>::pop_impl(bool) + 98
    frame #4: 0x00000001020e7c81 cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_10, std::__1::allocator<vscode::message_handler::main_loop()::$_10>, void ()>::operator()() + 97
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #27
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e78c2 cpptools`vscode::message_deque<vscode::vscode_client_message, false>::pop_impl(bool) + 98
    frame #4: 0x00000001020e87cc cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_11, std::__1::allocator<vscode::message_handler::main_loop()::$_11>, void ()>::operator()() + 76
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #28
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e8d52 cpptools`vscode::message_deque<int, false>::pop_impl(bool) + 82
    frame #4: 0x00000001020e89c2 cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_12, std::__1::allocator<vscode::message_handler::main_loop()::$_12>, void ()>::operator()() + 162
    frame #5: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #6: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #7: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
  thread #29
    frame #0: 0x00007fff693e3882 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff694a4425 libsystem_pthread.dylib`_pthread_cond_wait + 698
    frame #2: 0x00007fff66572592 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
    frame #3: 0x00000001020e9017 cpptools`std::__1::__function::__func<vscode::message_handler::main_loop()::$_13, std::__1::allocator<vscode::message_handler::main_loop()::$_13>, void ()>::operator()() + 183
    frame #4: 0x00000001020e7653 cpptools`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::function<void ()> > >(void*) + 51
    frame #5: 0x00007fff694a4109 libsystem_pthread.dylib`_pthread_start + 148
    frame #6: 0x00007fff6949fb8b libsystem_pthread.dylib`thread_start + 15
sean-mcmanus commented 3 years ago

It's stuck querying the compiler defaults, waiting for results from the compilerPath process. What compilerPath is being used? When C_Cpp.loggingLevel is "Debug" do you see output in the C/C++ pane like

Querying compiler for default C++ language standard using command line: "/usr/bin/g++-10" -x c++ -E -dM /dev/null

Are you able to run <compilerPath> -x c++ -E -dM /dev/null on the command line -- does it get stuck or show output?

@Colengms Any ideas why compiler querying could get stuck?

lgritz commented 3 years ago

There is no C/C++ pane in the output window area.

I don't see anything about querying compiler in any of the output window panes, nor in the developer tools console window.

I tried setting compilerPath to /usr/bin/clang++ (system version) or "/usr/local/opt/llvm/bin/clang++" (homebrew version). No change.

sean-mcmanus commented 3 years ago

Yeah, no C/C++ logging pane makes sense, since it's getting stuck before it can get created.

So do you get a bunch of #define output when you run "/usr/bin/clang++ -x c++ -E -dM /dev/null"?

Our process is stuck reading the stdout pipe from the child compiler process. Maybe we can make the read non-blocking with a timeout like we do for Windows.

lgritz commented 3 years ago

Yes, clang++ -x c++ -E -dM /dev/null works as expected.