-
Notifications
You must be signed in to change notification settings - Fork 99
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
libclang crash #326
Comments
I've been having this exact problem for a few days now, except it crashes when I type "std" (but only in certain files, it seems? At least it feels like it only happens in certain files, but I could be wrong). What happens is emacs freezes for a second or two when I type "std", and then Flycheck indicates that something is wrong (showing a ? for number of errors in the modeline). I'm using Spacemacs on OSX 10.11.6. I compiled the Irony server with the libclang included with Xcode, using headers that I found in some other issue thread about compiling the server on OSX. My .clang_complete looks like the following:
Irony server doesn't seem to be able to find the standard library without these includes (except the
I'm afraid I can't show the file and location where it crashes, for privacy reasons. I was able to recreate this crash by running the server manually, and doing a parse, diagnostics, and then complete command in a certain file on a certain spot. Please tell me if I can provide any additional information that might be of help! Edit: Clarification: It doesn't only crash when I type "std", it crashes from a bunch of other stuff as well. Can't really find what those cases have in common. |
It's strange because it crashes 9 out of 10 cases (with irony-server command). I don't know why it doesn't crash sometimes. Also I took a look at irony-server code: |
Commenting this line in TUManager.cpp fixes the crash: parseTUOptions_ &= ~CXTranslationUnit_CacheCompletionResults; |
Sorry for the silence, The issue does not seem trivial and I have limited time, I appreciate that you were able to nail down the issue to a piece of code. A few questions:
|
Also, until I can reproduce the issue. Can you try to reproduce the issue under |
It's really weird. It feels like on some days, the server crashes with every other statement I write, and on other days it doesn't crash at all. I suspect it just depends on which files I'm currently working with on those days, but it's still a bit odd. I think I've only seen it crash when working in .cpp files. I was working exclusively in .h files on thursday and friday, and I don't remember it crashing at all. I can't seem to produce any crashes right now, don't know why. My system is a MacBook Air, running OS X El Capitan 10.11.6.
I don't currently have time tinkering with irony-server, so I can't try removing lines and recompiling right now. |
I tested removing the line @sebastiencs talked about:
I haven't seen any downside yet, I tried with a somewhat older version of libclang. Would be nice to have a minimal example that we can reproduce, understand, give to libclang. Personally I haven't noticed the issue yet on my setup. OS X Clang version are always a little bit hard to reason about for me. Looks like it matches 3.8.0, which is what I use. |
Yeah, I'd prefer being able to use the vanilla LLVM clang, but it's cumbersome on a Mac. This is the best (only) guide I've found for mapping Apple LLVM versions to vanilla LLVM versions. It says my version is probably based on LLVM 3.8.0. I'll have time to try removing that line and recompiling the server today. Will report back if I notice anything. |
I also tried with the llvm releases tarball from http://llvm.org/releases/ (3.8.0 and 3.8.1)
|
Thanks for the feedback. I do not have time to investigate more deeply but I committed the fix you proposed (4b63b80). People will complain if there are downside I guess... |
I'm still having this problem, though it's not as frequent. It seems like it mainly happens in files that make heavy use of macros to generate code. |
I have a project where I included QtWebChannel and I had very often crashes with libclang.
The messages in the Messages buffer are:
I was able to reproduce the crash with this simple case:
With this case it crashes almost always, if it doesn't I restart emacs.
My cursor is at the pipe place. At this point, I'm waiting 2-3 seconds (until flycheck signal me that there is a problem) and I execute 'company-complete'. Then I receive the error message.
There is the irony.log:
I tried to reproduce the error with this command but clang success to get the right completion:
(note that if I don't use -fPIC, Qt give an preprocessor error, but still there is the completion written. Could it be the problem ? I also set the column at 6)
I tried to reproduce with irony-server:
I tried with 3 versions of libclang/llvm including one without assertion (#206) and 3 versions of Qt. It always crashes.
I didn't take a look at irony code but is there any way to get more informations about what is happening ?
The text was updated successfully, but these errors were encountered: