Closed ImJoyed closed 2 months ago
@ImJoyed It looks like a crash tag parsing C:\Users\Model\Documents\Hello\build\Hello_autogen\mocs_compilation.cpp . Does adding
"C_Cpp.files.exclude": [
"**/Hello_autogen": "true"
]
fix the issue?
If you open a different folder that doesn't contain that file, does it still crash?
Can you comment out the code in that function, attach a debugger to the cpptools.exe process and then uncomment the code to get a crash call stack?
@ImJoyed It looks like a crash tag parsing C:\Users\Model\Documents\Hello\build\Hello_autogen\mocs_compilation.cpp . Does adding
"C_Cpp.files.exclude": [ "**/Hello_autogen": "true" ]
fix the issue?
If you open a different folder that doesn't contain that file, does it still crash?
Can you comment out the code in that function, attach a debugger to the cpptools.exe process and then uncomment the code to get a crash call stack?
I added Hello_autogen in exclude files, but the issue still occurred.
I only opened a hello.cpp
file, and the issue still occurred.
@ImJoyed It might be some problem loading an OS dll that is needed for tag parsing (i.e. some DLL dependency that is missing from your Win7 SP1 installation). Can you get a repro that doesn't repro the crash (no tag parsing messages are logged), such as an empty workspace folder with a c_cpp_properties.json that has "compilerPath": ""
, then attach a debugger to cpptools.exe (see https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv) and then add a source file to get it to tag parse it and then crash and provide the crash call stack? That would help us diagnose the cause.
You may need to install the Visual C++ Redistributable package or the .NET Framework (SDK), see a previous issue https://github.com/microsoft/vscode-cpptools/issues/2878 , if the issue is missing/expected DLLs (the crash call stack might show it's trying to load a library).
I followed the instructions from this link: https://github.com/microsoft/vscode-cpptools/wiki/Attaching-debugger-to-cpptools-or-cpptools%E2%80%90srv, but when debugging, it immediately ends after attaching, and I can't get any useful information.
You can see that the debug toolbar only appears for a moment and then disappears.
https://github.com/user-attachments/assets/6a3e4a69-33ff-495d-85fe-d5ec238ec4df
@sean-mcmanus
I installed the same version of VSCode and the C/C++ Extension on a Windows 10 system, and they work fine. However, my internal network environment only supports Windows 7. Does the plugin have any dependencies, such as C++ runtime or .NET, that might affect its functionality?
My VSCode on Win7 cannot attach to the process for debugging, so I switched to using WinDbg for debugging and got the following information. It looks like there is an issue when calling the RtlUserThreadStart function from the ntdll library.
PID 2816
Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
*** wait with pending attach
Symbol search path is: C:\Symbols
Executable search path is:
ModLoad: 00000001`3ff60000 00000001`41452000 cpptools.exe
ModLoad: 00000000`77c10000 00000000`77db9000 ntdll.dll
ModLoad: 00000000`779f0000 00000000`77b0f000 C:\Windows\system32\kernel32.dll
ModLoad: 000007fe`fdc50000 000007fe`fdcbb000 C:\Windows\system32\KERNELBASE.dll
ModLoad: 000007fe`fea20000 000007fe`fea6d000 C:\Windows\system32\WS2_32.dll
ModLoad: 000007fe`fe980000 000007fe`fea1f000 C:\Windows\system32\msvcrt.dll
ModLoad: 000007fe`ffb10000 000007fe`ffc3d000 C:\Windows\system32\RPCRT4.dll
ModLoad: 000007fe`ffad0000 000007fe`ffad8000 C:\Windows\system32\NSI.dll
ModLoad: 000007fe`fcea0000 000007fe`fcebe000 C:\Windows\system32\USERENV.dll
ModLoad: 000007fe`fdb60000 000007fe`fdb6f000 C:\Windows\system32\profapi.dll
ModLoad: 00000000`77b10000 00000000`77c0a000 C:\Windows\system32\USER32.dll
ModLoad: 000007fe`fecd0000 000007fe`fed37000 C:\Windows\system32\GDI32.dll
ModLoad: 000007fe`fe3a0000 000007fe`fe3ae000 C:\Windows\system32\LPK.dll
ModLoad: 000007fe`fdf30000 000007fe`fdff9000 C:\Windows\system32\USP10.dll
ModLoad: 000007fe`fed40000 000007fe`ffac8000 C:\Windows\system32\SHELL32.dll
ModLoad: 000007fe`ffea0000 000007fe`fff11000 C:\Windows\system32\SHLWAPI.dll
ModLoad: 000007fe`fe4c0000 000007fe`fe6c3000 C:\Windows\system32\ole32.dll
ModLoad: 000007fe`fe2c0000 000007fe`fe397000 C:\Windows\system32\OLEAUT32.dll
ModLoad: 000007fe`fe8a0000 000007fe`fe97b000 C:\Windows\system32\ADVAPI32.dll
ModLoad: 000007fe`fe2a0000 000007fe`fe2bf000 C:\Windows\SYSTEM32\sechost.dll
ModLoad: 000007fe`f0350000 000007fe`f03bf000 C:\Windows\system32\mscoree.dll
(b00.814): Break instruction exception - code 80000003 (first chance)
ntdll!LdrpDoDebuggerBreak+0x30:
00000000`77cbcb60 cc int 3
0:001> gh
ModLoad: 000007fe`ffae0000 000007fe`ffb0e000 C:\Windows\system32\IMM32.DLL
ModLoad: 000007fe`fe3b0000 000007fe`fe4b9000 C:\Windows\system32\MSCTF.dll
ntdll!RtlUserThreadStart:
00000000`77c3c500 4883ec48 sub rsp,48h
0:000> gh
^ No runnable debuggees error in 'gh'
PID 1900
Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
*** wait with pending attach
Symbol search path is: C:\Symbols
Executable search path is:
ModLoad: 00000001`3ff60000 00000001`41452000 c:\Users\Model\.vscode\extensions\ms-vscode.cpptools-1.21.6\bin\cpptools.exe
ModLoad: 00000000`77c10000 00000000`77db9000 C:\Windows\SYSTEM32\ntdll.dll
ModLoad: 00000000`779f0000 00000000`77b0f000 C:\Windows\system32\kernel32.dll
ModLoad: 000007fe`fdc50000 000007fe`fdcbb000 C:\Windows\system32\KERNELBASE.dll
ModLoad: 000007fe`fea20000 000007fe`fea6d000 C:\Windows\system32\WS2_32.dll
ModLoad: 000007fe`fe980000 000007fe`fea1f000 C:\Windows\system32\msvcrt.dll
ModLoad: 000007fe`ffb10000 000007fe`ffc3d000 C:\Windows\system32\RPCRT4.dll
ModLoad: 000007fe`ffad0000 000007fe`ffad8000 C:\Windows\system32\NSI.dll
ModLoad: 000007fe`fcea0000 000007fe`fcebe000 C:\Windows\system32\USERENV.dll
ModLoad: 000007fe`fdb60000 000007fe`fdb6f000 C:\Windows\system32\profapi.dll
ModLoad: 00000000`77b10000 00000000`77c0a000 C:\Windows\system32\USER32.dll
ModLoad: 000007fe`fecd0000 000007fe`fed37000 C:\Windows\system32\GDI32.dll
ModLoad: 000007fe`fe3a0000 000007fe`fe3ae000 C:\Windows\system32\LPK.dll
ModLoad: 000007fe`fdf30000 000007fe`fdff9000 C:\Windows\system32\USP10.dll
ModLoad: 000007fe`fed40000 000007fe`ffac8000 C:\Windows\system32\SHELL32.dll
ModLoad: 000007fe`ffea0000 000007fe`fff11000 C:\Windows\system32\SHLWAPI.dll
ModLoad: 000007fe`fe4c0000 000007fe`fe6c3000 C:\Windows\system32\ole32.dll
ModLoad: 000007fe`fe2c0000 000007fe`fe397000 C:\Windows\system32\OLEAUT32.dll
ModLoad: 000007fe`fe8a0000 000007fe`fe97b000 C:\Windows\system32\ADVAPI32.dll
ModLoad: 000007fe`fe2a0000 000007fe`fe2bf000 C:\Windows\SYSTEM32\sechost.dll
ModLoad: 000007fe`f0350000 000007fe`f03bf000 C:\Windows\system32\mscoree.dll
ModLoad: 000007fe`ffae0000 000007fe`ffb0e000 C:\Windows\system32\IMM32.DLL
ModLoad: 000007fe`fe3b0000 000007fe`fe4b9000 C:\Windows\system32\MSCTF.dll
ModLoad: 000007fe`fc240000 000007fe`fc296000 C:\Windows\system32\uxtheme.dll
ModLoad: 000007fe`fd390000 000007fe`fd3e5000 C:\Windows\system32\mswsock.dll
ModLoad: 000007fe`fcd90000 000007fe`fcd97000 C:\Windows\System32\wshtcpip.dll
ModLoad: 000007fe`fd380000 000007fe`fd387000 C:\Windows\System32\wship6.dll
ModLoad: 000007fe`fd9f0000 000007fe`fda47000 C:\Windows\system32\apphelp.dll
(76c.dac): Break instruction exception - code 80000003 (first chance)
ntdll!DbgBreakPoint:
00000000`77c60530 cc int 3
0:015> gh
ntdll!RtlUserThreadStart:
00000000`77c3c500 4883ec48 sub rsp,48h
0:004> gh
^ No runnable debuggees error in 'gh'
I resolved the issue.
After installing the KB2533623 update and the DotNet 4.6.1 runtime, the crash no longer occurs. But I don't know which one was effective, perhaps both worked simultaneously.
I couldn't debug cpptools using Attach, and then I noticed that the json specified cppvsdbg. So, I tried installing Visual Studio 2019, but installing this version on Windows 7 requires the KB2533623 update and the DotNet 4.6.1 runtime. After completing the installation, cpptools stopped encountering exceptions.
Environment
Bug Summary and Steps to Reproduce
Bug Summary: I found this VSCode version is the last version, that support Win7. And I know is so old, so I try some old C/C++ extension versions, but don't work. When I open a qt cmake project, i have do nothing, I got that error: The language server crashed 5 times in the last 3 minutes. It will not be restarted.
Steps to reproduce: Only open a qt cmake project, the OS and VSCode are installed recent, no other operation.
Expected behavior: I wang develope a qt cmake project on Win7.
Configuration and Logs
Other Extensions
Additional context
No response