Open lixiaolan opened 4 years ago
I was able to 'fix' this issue. After running rdm in gdb and checking the back-trace it appeared the exception was triggered in clang/llvm rather than rtags proper. I then installed a newer version of clang/llvm (6.0 for what it's worth) and re-installed rtags with the new version. This has resolved the issue for me. Technically there is still some kind of bug present when using rtags with clang/llvm version 3.8 so maybe this can stay open for visibility.
Hope it helps :)
Describe the bug Code complete at causes segfault when code is malformed. In this particular example, I define a constructor both in the header file and in the object code.
To Reproduce
Create 3 files as following in some folder:
game.cpp
game.h
makefile
Now generate the compile commands. I ran
bear make
to get the following:Note: running
make
results in errors because the code is wrong (both.cpp
and.h
define the constructor implementation). Even so,bear make
happily generates compile commands.Now run rtags and load the commands:
Finally, try running any code completion inside of
.cpp
files. E.g:At this point rdm crashes with the following trace:
Expected behavior I would expect (in general) that rdm not segfault.
Note: The above example is a greatly simplified scenario. I came across this bug while working on a project and narrowed it down to this minimal example in order to help clarify the problem. So, though it might seem pathological, this was and is a real issue :)
Screenshots/Backtrace (backtrace is printed above)
Environment:
OS/Version
rtags version
Emacs version
(not needed since it isn't used for this bug)
llvm/clang
Note: Please let me know if I can provide any further information to help get to the bottom of this. I did notice that this may be related to another bug filed previously: https://github.com/Andersbakken/rtags/issues/1363. I can't tell if this is the same problem or not so I filed a separate bug. In any case, both are worth a look. I am very interested in improving the stability of rtags as I am a fan of the functionality but concerned about the crashes :)