-
Notifications
You must be signed in to change notification settings - Fork 97
Crash while parsing unsaved file #206
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
Comments
Can you try to reduce the content of the file to the bare minimum and send it to me? I'm pretty sure something doesn't work well with some files with special characters (see #163), I fear that emacs is doing some conversion or such but I don't understand all the implication of such things. |
I have verified this file only has ASCII characters, so I don't think it's the same problem as in #163. I'll try to look into it further. |
FYI I believe 2e73722 fixes the segfault. This doesn't fix the missing newline issue though, it will just make the error less cryptic. |
Thanks for the changes! Indeed I have updated irony-mode today and have not experienced crashes so far. I get these every now and then though:
and
And not just in that same file anymore. BTW, I use irony + company + flycheck. |
Could you enable debug |
Turned the flag on but didn't get any extra information from Emacs. The log file has this:
|
I got a backtrace from Emacs. It was an error about removing the compiler string from the compilation command line when setting up the compilation database. I then removed all *.elc files and started Emacs again. So far so good. |
Ok. Are you able to reproduce the clang crash on the command line?
|
I do not have any more irony-server crashes. I got another backtrace from Emacs:
|
Could you show some of the content of @Hylen may be of help too. It may be nice to test the
Does it happens every single time or is it intermittent? |
It looks as if the call to irony--send-request-sync in irony-cdb-libclang--server-exact-flags returns t. I can't guess why it would do that. I don't think the above call to irony-server would give t, so maybe the callback stack is messed up or something else is wrong on the elisp side. |
@Sarcasm It is intermittent. Testing |
Yeah, |
@asandroq, can you disable flycheck and see if you still get the error? |
Without flycheck everything seems to work fine ( It is weird because I don't see the "newline missing at the end" error anymore, although AFAIK the function used by irony.el to send the buffer to the server is the same for both UPDATE: Scratch this, I still see problems. From Emacs:
From the irony log:
|
|
@asandroq that's an assertion failing inside clang, are you using a recent llvm? if you are and you can provide input for repro, that's a reportable bug in clang. It looks like it's catching a memory leak in this case. |
I think I've observed the original error with the missing newline lately at work. I don't have much time to debug while working however, and I can't paste any logs or code. What's weird is I only see it at work, and not at home. In the log file, I'm seeing the message
It seems to happen for about every file I open and edit. After removing the "return 0", I got the error
which makes it seem as if the size of the buffer gets calculated wrong. I will investigate more closely when I have time. Since this doesn't seem to be the error here anymore, should I open a new issue for it? |
Hi,
I have a specific file that is parsed correctly when saved, but crashes irony-server when sent as unsaved content. This is the backtrace:
The problem seems to be in Command.cpp, line 265:
I have done some debugging and it seems that, for this specific file, when unsaved, the newline is never sent to the server. Or the server somehow loses it. I cannot explain why. Moreover, the server should not crash in this situation. I don't know if the backtrace is a hint as to why the input stream loses the newline.
The file only has ASCII characters. I also tried changing the Elisp code to send another character instead of a newline, but the end result is the same.
The text was updated successfully, but these errors were encountered: