Closed chep closed 9 years ago
I can reproduce it easily. Each time I use rtags in test.tpp I have a segfault.
Makefile: all: gcc -o test test.cpp
test.cpp:
int main()
{
int i = 0;
Test
test.hpp:
template
test.tpp:
template
template
Sorry about the delay. I can reproduce it. Seems to be an issue with my assumptions in the completion machinery.I'll try to fix it. Thanks for the report.
I think it should work now. Let me know if not.
Anders
No more segfault here, thank you very much.
Glad to hear.
Anders
On Mon, Apr 20, 2015 at 11:28 PM, Cédric Chépied notifications@github.com wrote:
No more segfault here, thank you very much.
— Reply to this email directly or view it on GitHub https://github.com/Andersbakken/rtags/issues/336#issuecomment-94653137.
Hi Anders,
My rdm crashes very often. I think this is because of C++ template but I'm not sure. All I know is that it crashes everytime I write a single line in my tpp file, containing template implementations.
I compiled with debug symbol to get backtrace and I got 2 different ones:
/home/chep/bin/rc --current-file=/home/chep/my-file.tpp --unsaved-file=/home/chep/my-file.tpp:3724 -Y -l /home/chep/my-file.tpp:53:2: Got completion request for /home/chep/my-file.tpp:53:2 [New Thread 0x7ffff1d2c700 (LWP 16679)] [New Thread 0x7ffff252d700 (LWP 16678)] [New Thread 0x7ffff2d2e700 (LWP 16644)]
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff1d2c700 (LWP 16679)] 0x00007ffff700b916 in ?? () from /usr/lib/libclang.so (gdb) bt
0 0x00007ffff700b916 in ?? () from /usr/lib/libclang.so
1 0x00007ffff70165c1 in ?? () from /usr/lib/libclang.so
2 0x00007ffff40ca927 in llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) ()
from /usr/lib/libLLVM-3.6.so
3 0x00007ffff40ca974 in ?? () from /usr/lib/libLLVM-3.6.so
4 0x00007ffff40f76ed in ?? () from /usr/lib/libLLVM-3.6.so
5 0x00007ffff671c374 in start_thread () from /usr/lib/libpthread.so.0
6 0x00007ffff54a127d in clone () from /usr/lib/libc.so.6
And
(gdb) bt
0 0x0000000000482366 in _M_find_before_node (code=, k=, __n=0,
1 _M_find_node (c=, key=, __bkt=0, this=0x75b478)
2 find (__k=, this=0x75b478) at /usr/include/c++/4.9.2/bits/hashtable.h:1321
3 find (__x=, this=0x75b478) at /usr/include/c++/4.9.2/bits/unordered_map.h:578
4 value (ok=0x0, defaultValue=..., key=, this=0x75b478)
5 JobScheduler::dump (this=0x75b3a0, conn=std::shared_ptr (count 9, weak 2) 0x138ff70)
6 0x00000000004bb00c in Server::dumpJobs (this=,
7 0x00000000004d853a in StatusJob::execute (this=)
8 0x00000000004afba7 in QueryJob::run (this=this@entry=0x7fffffffc8d0,
9 0x00000000004bc2ad in Server::status (this=this@entry=0x75a7e0,
10 0x00000000004cd8a6 in Server::handleQueryMessage (this=0x75a7e0,
11 0x00000000004d0d1e in Server::onNewMessage (this=0x75a7e0,
12 0x00000000004f97d4 in operator() (args#1=..., args#0=..., this=)
---Type to continue, or q to quit---
at /usr/include/c++/4.9.2/functional:2439
13 operator()std::shared_ptr<Message&, std::shared_ptr&> (this=0x138ffb8)
14 Connection::onDataAvailable(std::shared_ptr const&, Buffer&&) (this=,
15 0x000000000051a465 in operator() (
16 operator()std::shared_ptr<SocketClient&, Buffer> (this=0x138fd08)
17 SocketClient::socketCallback (this=0x138fcd0, f=, mode=1)
18 0x00000000004fdaa9 in operator() (args#1=1, args#0=24, this=0x7fffffffd5c0)
19 EventLoop::fireSocket (this=this@entry=0x75a3e0, fd=24, mode=1)
20 0x00000000004feb3d in EventLoop::processSocketEvents (this=this@entry=0x75a3e0,
21 0x000000000050039c in EventLoop::exec (this=0x75a3e0, timeoutTime=timeoutTime@entry=-1)
22 0x0000000000438a9b in main (argc=, argv=)