-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intellisense process crash caused by calling stack overflow #7215
Comments
Our IntelliSense parser is trying to parse some template in some file (i.e. the specific file you have active when the crash occurs). Are you able to locate the template that is causing the crash? It could be in an included header as well. |
#include <iostream>
using namespace std;
template <char c, int k=0>
struct StringSearch {
template <int L> static constexpr
inline const char* _(char const (&val)[L]) {
return k >= L? val: val[L-k-1]==c? (&val[L-k]): StringSearch<c, k+1>::_(val);
}
};
template <char c>
struct StringSearch<c, 32> {
template <int L> static constexpr
inline const char* _(char const (&val)[L]) {
return val;
}
};
int main(int argc, char const *argv[])
{
const char* res = StringSearch<'/'>::_(__FILE__);
cout << res << endl;
return asdasd;
} I find it was this code snippet that make cpptools crash. |
Thanks. I can repro the bug, but strangely it only seems to repro on Mac, so we need to investigate what is special about that. |
It looks like our Mac executable has too small of a stack size. I tried using -Wl,-stack_size to increase the stack size, but it doesn't appear to be working. UPDATE: Ah, looks like we need to increase the stack size of the threads we create. Mac's use a small thread stack size for some odd reason (Linux/Windows don't have the issue). |
Fixed in 1.9.1 (or 1.9.0?) |
Type: LanguageService
Intellisense not working, and I found "intellisense process crash detected" in log panel.
It crashed everytime after I open the workspace. Seems only repro in specific workspace.
Describe the bug
The workspace has 2 project, one of which has about 1000+ source files, the other one has about 100 source files.
Additional context
Before crash, I attach debugger to cpptools-srv, and got the following call stack. I think this crash was caused by stack overflow? The fault instruction is `push %sp %bp'
The text was updated successfully, but these errors were encountered: