Vscode-cpptools: The C/Cpp Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted

Created on 5 Jan 2017  路  54Comments  路  Source: microsoft/vscode-cpptools

Moved from https://github.com/Microsoft/vscode/issues/18139

  • VSCode Version: Code 1.8.1 (ee428b0eead68bf0fb99ab5fdc4439be227b6281, 2016-12-19T14:49:23.350Z)
  • OS Version: Windows_NT ia32 10.0.10586
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|code-gnu-global|austin|0.2.1|
|cpptools|ms-vscode|0.9.3|


Steps to Reproduce:

  1. Install the c/c++ intellisense, complete C/C++ language support including code-editing and debugging.
  2. restart and start coding, it gives the error mentioned in the title bar.
Language Service bug fixed (release pending)

Most helpful comment

Thanks a ton for reporting this bug. We've had this bug from "the very beginning"...it's shocking it took so long for someone to report it. It can repro whenever the text in a document increases in size. It could be the source of the memory corruption and other crashes you've experienced. We have a fix and will try to get it released soon.

All 54 comments

@prasoonnaik Moved your request to here.

We're buggy in the new, unnamed file scenario. It sounds like you need to save the file first. Is that a workaround for you?

Also just seen this error. Is there anywhere I can look to see the cause?

What did you do to cause it? There are several conditions where this is known to occur (unsaved file, non-glibc 2.18 OS, non-64-bit OS). We need more info. What is your OS?

Windows Professional 7 64bit

Are you using an unsaved file? How far can you get before the crash message appears?

I think there may have been an unsaved file. The message only appeared once. I think I just restarted VS Code.

same problem on the environment below:

  • VSCode Version: Code 1.9.1 (f9d0c687ff2ea7aabd85fb9a43129117c0ecf519, 2017-02-08T23:44:55.542Z)
  • OS Version: Linux x64 4.9.0-1-amd64
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|vscode-theme-onedark|akamud|1.1.0|
|python|donjayamanne|0.5.8|
|code-runner|formulahendry|0.6.9|
|cpptools|ms-vscode|0.10.0|
|Ruby|rebornix|0.10.4|
|java|redhat|0.0.10|
|todotasks|sandy081|0.4.0|
|shader|slevesque|0.2.2|


Before this error comes out, the memory usage of process "~/.vscode/extensions/ms-vscode.cpptools-0.10.0/bin/Microsoft.VSCode.CPP.Extension.linux" will be increasing until all the ram run out. And then I kill this process, then causing this error.

Does the memory usage problem start immediately without taking any actions? Does it repro for all projects? We're still trying to get a repro. Are you using any Unicode characters with values > 0xffff or >0xff in identifiers?

Up to now, the memory problem seems occur ramdomly, I'll report later if finding any useful clue. And I'm not using Unicode characters(> 0xffff or >0xff ) in identifiers ;)

If it's a gradual memory increase and the config in the bottom right is red, then it could be due to a problem with our handling of symbolic links in an infinite recursion.

I get this all the time, requiring a restart every 10-20 minutes. The project is very simple.

  • VSCode Version: Code 1.10.2 (8076a19fdcab7e1fc1707952d652f0bb6c6db331, 2017-03-08T14:02:52.799Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|cpptools|ms-vscode|0.10.2|;


Steps to Reproduce:

  1. Load up folder of attached project.
  2. Add/edit new code for around 10-20 minutes.

It might be worth mentioning that open in my environment are duplicate files with lowercase names and a period postfix.

image

These are opened by the debugger automatically when I step and this is a known bug in vscode. However, it might be causing the cpp tools some grief.

I wasn't able to repro your issue. Can you try 0.10.3 to see if it's fixed? If you could narrow down the repro requirements that would help a lot.

That would be difficult, I'm just coding without thought so anything can happen in those 10 minutes.

Are there no crash dumps or stack traces I can give you? It's a shame this is not open-source as I'd be more than happy to dig into it.

I will update to the latest version tomorrow morning and see what happens.

Okay. I need to know what symptom you're getting. Does the Event Viewer show that the Microsoft.VSCode.CPP.Extension.exe has crashed? Or is the process still alive but you see "Loading..." in the tooltip and nothing works? If the app is crashing you can get a user-mode dump via https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx . Do you get the crashed 5 times message? Is memory/CPU usage really high near the failure? What is the size of the .browse.vc.db?

I added my comment here because I am seeing exactly what the issue text says:

image

This is with 0.10.3. The executable is no longer in the process list, there is no "Loading..." and I am not aware of any memory/cpu problems at the time of the crash. At least, I'm a i7-6800 with 6 cores (setup as 12 logical) with 32 GB of RAM and nothing I've been doing has been stressing the machine even a little.

I've enabled UM dumps and will see if it happens again.

Where is this .browse.vc.db file located?

On Windows, the browse DB should be under %appdata%/Code/User/workspaceStorage/{hash}/ms-vscode.cpptools/

Does it still crash for you if the duplicate files are all closed, or do you only get a crash after debugging?

Thanks.

I can't remove the duplicate files from the list of recently opened files but I can close them (i.e. they're still selectable).

There has been a debugging session but I've had it crash without debugging.

The largest DB file I have is 35MB.

Took about 5 minutes to crash that time. No crash dumps, unfortunately:

image

I've added CustomDumpFlags just in case it expects the key even though the dump type says not to use it.

Nope. That was a quick one!

If you have a version of Visual Studio or windbg installed, you should be able to attach to the Microsoft.VSCode.CPP.Extension.exe process and save a dump when it crashes and breaks in to the debugger.

I'll try that next week, thanks for the help. I'm heading off work for the weekend.

I am having this problem, too with a relatively small mingw based project in Windows 10. I'm now watching the process with procmon so I can figure out what it's doing before the crash. One thing I noticed in the procmon log was that the extension was query/reading *.o files until I excluded them using the exclude files filter. Is it supposed to be doing that?

The DB files don't seem to be excessively large. Although I have the db name set to "databaseFilename" : "chunks.vs.db" - I have both that and a .BROWSE.VC.DB under my AppData\Roaming\Code\User\workspaceStorage\9579cac8ebcc1d93e3a73c892073cd93\ms-vscode.cpptools with modification times within a couple of minutes of the crash times.

Can you create a new issue about the two DB's in the save location so it doesn't get lost under this topic about crashes? I believe what you are seeing is expected - we likely created the default DB before you set the databaseFilename property in the json file.

Regarding the *.o stuff. We should be querying all files under your workspace to see if they are files or folders, but I wouldn't expect us to actually read the contents of *.o files unless you added it to the global files.associations setting.

I mention it, because just before the crash there is a whole stream of reads of .BROWSE.VC.DB, 4096 bytes at a time. Not sure why it touches it, if I change the name..

We released 0.10.4 today with a fix for a crash in signature help that many people were hitting. Please let us know if you continue to see the crashing message in VS Code.

I started back up on this project this morning and attached Visual Studio. Pressing enter to start a new line and backspacing it out again gives this:

Exception thrown at 0x7449A832 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: antlr::NoViableAltException at memory location 0x03B2CDD4.
Exception thrown at 0x7449A832 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

There's a constant stream in the output. I'll continue working until I get a crash and sync to latest version.

UPDATE These messages still occur with 0.10.4

Crash! I was typing an if statement and decided to move away from it unfinished. So I typed:

if (

and then moved the cursor up a few lines and it crashed. Apart from the stream of messages above, its last lines were:

Exception thrown at 0x7449A832 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: std::length_error at memory location 0x03B2F600.
Unhandled exception at 0x008310AC in Microsoft.VSCode.CPP.Extension.exe: Fatal program exit requested.

Callstack:

>   Microsoft.VSCode.CPP.Extension.exe!008310ac()   Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for Microsoft.VSCode.CPP.Extension.exe]    
    Microsoft.VSCode.CPP.Extension.exe!0080d9eb()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!007e405e()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!007e4d45()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!007e5dc4()   Unknown
    ntdll.dll!77002d72()    Unknown
    ntdll.dll!77002d44()    Unknown
    ntdll.dll!76fdf28f()    Unknown
    ntdll.dll!76ff08ef()    Unknown
    ntdll.dll!76fa92e9()    Unknown
    Microsoft.VSCode.CPP.Extension.exe!007e5871()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00790055()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003efe4c()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003f3e05()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003e56f1()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!0041e876()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!0041e408()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00433c33()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!004025af()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003f556f()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003fb6d1()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003ebb0c()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003f2cb4()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003efdc8()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!003eefe8()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00810da4()   Unknown
    kernel32.dll!740f62c4() Unknown
    ntdll.dll!76fe0fd9()    Unknown
    ntdll.dll!76fe0fa4()    Unknown

Minidump attached. I never knew about int 29h!

Your .dmp shows you're using the old 0.10.3 extension that doesn't have the bug fix. The stream of exception messages are "by design" -- they occur when our parser is running. The bug your describing should not be occurring unless you have an old .exe.

Yes. I know that.

I mentioned in the post above that I would continue to test with 0.10.3 to repro the crash and then update. My hope was that you could use it against a known EXE to verify the callstack matched the crash you have fixed.

And as mentioned, I have updated and am testing the new EXE now.

This time round I've been coding for about 2 hours before a crash. Output is:

Exception thrown at 0x7449A832 in Microsoft.VSCode.CPP.Extension.exe: Microsoft C++ exception: std::out_of_range at memory location 0x03CFF3D0.
Unhandled exception at 0x00EE192C in Microsoft.VSCode.CPP.Extension.exe: Fatal program exit requested.

Callstack:

>   Microsoft.VSCode.CPP.Extension.exe!00ee192c()   Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for Microsoft.VSCode.CPP.Extension.exe]    
    Microsoft.VSCode.CPP.Extension.exe!00ebe26b()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00e948de()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00e955c5()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00e96644()   Unknown
    ntdll.dll!77002d72()    Unknown
    ntdll.dll!77002d44()    Unknown
    ntdll.dll!76fdf28f()    Unknown
    ntdll.dll!76ff013c()    Unknown
    KernelBase.dll!744ac5a1()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00e960f1()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00e408f0()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aa3ecc()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a956b7()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aaf421()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ac0c9b()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ac26bd()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aaf76b()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aa568b()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aab85d()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9bb27()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aa2e40()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9ff54()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9f174()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ec1624()   Unknown
    kernel32.dll!740f62c4() Unknown
    ntdll.dll!76fe0fd9()    Unknown
    ntdll.dll!76fe0fa4()    Unknown

Minidump attached.

I have the 52 MB pdb for the .exe, but I'm unable to get any call stack with that dmp. Maybe because it's a minidump? Do you know how I can get a call stack? Are you able to create a full dmp next time? There's some problem in our build system that is preventing the symbols from being indexed to the symbol server, but we may be able to upload the pdb to some other location.

Full dumps are about 30MB compressed. I'll have a see if I can get one the next time round.

Okay, I figured out how to get the call stack (it wanted the path to the .exe for some strange reason), but all I see is exception handling code for an out_of_range exception, but I don't see the call stack for the source of the exception.
Microsoft.VSCode.CPP.Extension.exe!abort() Line 77 C++
Microsoft.VSCode.CPP.Extension.exe!terminate() Line 58 C++

Microsoft.VSCode.CPP.Extension.exe!FindHandler(EHExceptionRecord * pExcept=0x03cfee70, EHRegistrationNode * pRN=0x03cff92c, _CONTEXT * pContext=0x03cfeec0, void * pDC=0x03cfedfc, const _s_FuncInfo * pFuncInfo=0x00fddcf0, unsigned char recursive='\0', int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000) Line 605 C++
Microsoft.VSCode.CPP.Extension.exe!__InternalCxxFrameHandler(EHExceptionRecord * pExcept=0x03cfee70, EHRegistrationNode * pRN=0x03cff92c, _CONTEXT * pContext=0x03cfeec0, void * pDC=0x03cfedfc, const _s_FuncInfo * pFuncInfo=0x00fddcf0, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char recursive='\0') Line 439 C++
Microsoft.VSCode.CPP.Extension.exe!__CxxFrameHandler3(EHExceptionRecord * pExcept=0x03cfee70, EHRegistrationNode * pRN=0x03cff92c, void * pContext=0x03cfeec0, void * pDC=0x03cfedfc) Line 288 C++

I've verified the crash is occurring in our main thread and the symbol/parsing threads are okay, so it looks like the crash was caused by an explicit action you did, such as signature help, hover, go to def, etc..

There was an intellisense popup active during the crash. It's really hard to remember the actions I was performing while coding as it's a pretty subconscious act.

Anyway, here's another one which is an entirely different callstack. I think I was editing the string in the second Log statement in this code at the time; at least, the popup is frozen in place while VS has caught the crash:

image

Critical error detected c0000374
Microsoft.VSCode.CPP.Extension.exe has triggered a breakpoint.
>   ntdll.dll!77059cd4()    Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 
    ntdll.dll!7705d4b2()    Unknown
    ntdll.dll!7705bc33()    Unknown
    ntdll.dll!7700208f()    Unknown
    ntdll.dll!7705bb5e()    Unknown
    ntdll.dll!77012dc1()    Unknown
    ntdll.dll!76fcbacd()    Unknown
    ntdll.dll!76fc5c0c()    Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a90860()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a8f8a5()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9f174()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ec1624()   Unknown
    kernel32.dll!740f62c4() Unknown
    ntdll.dll!76fe0fd9()    Unknown
    ntdll.dll!76fe0fa4()    Unknown

Full dump attached.

Actually, no... I was editing the 3rd statement which is incomplete in that picture...

Great, that dmp worked and I got a call stack. It's a crash in our autocomplete code. A call to vector::push_back(&&) is failing as it attempts to grow/reallocate -- very strange. Looks like a heap corruption. I ran AppVerifier and it's not reporting any problems. It seems like this only repros in a particular scenario, because we haven't gotten other crash reports from 0.10.4. Previously we had heap corruptions when UTF8 characters > 1 byte were used, but they should all be fixed. We have not gotten any Windows Error Reporting crash reports from 0.10.4 yet, only 0.10.3 (with the length_error exception, which got fixed in 0.10.4).

This was after a copy/paste operation:

Exception thrown at 0x00E958FE in Microsoft.VSCode.CPP.Extension.exe: 0xC0000005: Access violation writing location 0x047B4000.
>   Microsoft.VSCode.CPP.Extension.exe!00e958fe()   Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for Microsoft.VSCode.CPP.Extension.exe]    
    Microsoft.VSCode.CPP.Extension.exe!00accf96()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ace94a()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aceb1c()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00acddb3()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9bc99()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ab012d()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aa54c1()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aab85d()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9bb27()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00aa2e40()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9ff54()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00a9f174()   Unknown
    Microsoft.VSCode.CPP.Extension.exe!00ec1624()   Unknown
    kernel32.dll!740f62c4() Unknown
    ntdll.dll!76fe0fd9()    Unknown
    ntdll.dll!76fe0fa4()    Unknown

After each of these the environment never really recovers and repeatedly crashes quickly until the "5 times" limit.

That's a completely different crash in our didChange code. It's failing to do a string replace. I can't seem to repro the bug, but we're investigating still...

Thanks a ton for reporting this bug. We've had this bug from "the very beginning"...it's shocking it took so long for someone to report it. It can repro whenever the text in a document increases in size. It could be the source of the memory corruption and other crashes you've experienced. We have a fix and will try to get it released soon.

No problem. Might be worth mentioning something about my environment that I've only just realised may be important: I'm running 2 windows, each opening unique folders but one is a sub folder of the other.

Having 2 windows (VS Code instances) where one is a sub folder of the other shouldn't have any effect on crashes (because the processes are independent), unless possibly if both instances are manually set to use the same browse database file.

@dwilliamson As of 0.10.5, all known crashes have been fixed now (excluding bad_alloc, which shouldn't repro in normal conditions). Please send us more dmps/callstacks if you're able to repro any.

Latest version has been going strong for 6 hours so far without crashing.

I am encountering the "The C/Cpp Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted." error in VSCode after recently updating.

Version 1.10.2
Commit 8076a19fdcab7e1fc1707952d652f0bb6c6db331
Date 2017-03-08T14:02:52.799Z
Shell 1.4.6
Renderer 53.0.2785.143
Node 6.5.0

  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:

|Extension|Author|Version|
|---|---|---|
|cpptools|ms-vscode|0.9.2|;

I'm was editing two C files (with ".ino") extensions side-by-side; specifically the HX711Serial.ino and HX711SerialBegin.ino from https://github.com/bogde/HX711/tree/master/examples

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DemoCrazer picture DemoCrazer  路  3Comments

montery8 picture montery8  路  3Comments

arl picture arl  路  3Comments

ismadelgad11 picture ismadelgad11  路  3Comments

ecbrodie picture ecbrodie  路  3Comments