Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

libclang crash, then SIGPIPE #188

Closed Gravemind closed 10 years ago

Gravemind commented 10 years ago

I got sevral time the same crash when editing "not-yet-buildable" code in emacs

Here the gdb with a debug build

[ 36%] 10/28 17:02:47 ~/documents/?????????????????.cpp error in 899ms. (1 deps) (dirty).
libclang: crash detected during parsing: {
  'source_filename' : '/home/??????????????'
  'command_line_args' : ['-Wall', '-Wextra', '-ffast-math', '-O2', '-g', '-m64', '-fno-strict-aliasing', '-mfpmath=sse', '-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-attributes', '-Wno-unused-local-typedefs', '-std=gnu++0x', '-fno-exceptions', '-c', '-ferror-limit=0', '-Wall', '-fspell-checking', '-Wno-unknown-warning-option', '???????????'],
  'unsaved_files' : [],
  'options' : 1,
}
got failure clang -Wall -Wextra -ffast-math -O2 -g -m64 -fno-strict-aliasing -mfpmath=sse -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-attributes -Wno-unused-local-typedefs -std=gnu++0x -fno-exceptions -c -ferror-limit=0 -Wall -fspell-checking -Wno-unknown-warning-option ??????????

[ 39%] 11/28 17:02:47 ~/documents/??????????????????.cpp error in 906ms. (1 deps) (dirty).
libclang: crash detected during parsing: {
  'source_filename' : '/home/????????????????.cpp'
  'command_line_args' : ['-Wall', '-Wextra', '-ffast-math', '-O2', '-g', '-m64', '-fno-strict-aliasing', '-mfpmath=sse', '-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-attributes', '-Wno-unused-local-typedefs', '-std=gnu++0x', '-fno-exceptions', '-c', '-ferror-limit=0', '-Wall', '-fspell-checking', '-Wno-unknown-warning-option', '???????????????'],
  'unsaved_files' : [],
  'options' : 1,
}
got failure clang -Wall -Wextra -ffast-math -O2 -g -m64 -fno-strict-aliasing -mfpmath=sse -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-attributes -Wno-unused-local-typedefs -std=gnu++0x -fno-exceptions -c -ferror-limit=0 -Wall -fspell-checking -Wno-unknown-warning-option ???????????

Program received signal SIGPIPE, Broken pipe.
0x00007ffff714460d in write () from /usr/lib/libpthread.so.0
(gdb) bt
#0  0x00007ffff714460d in write () from /usr/lib/libpthread.so.0
#1  0x00007ffff5a6214f in Process::handleInput (this=0x3bfb720, fd=18) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:617
#2  0x00007ffff5a61d6b in Process::processCallback (this=0x3bfb720, fd=18, mode=2) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:564
#3  0x00007ffff5a69fdf in std::_Mem_fn<void (Process::*)(int, int)>::operator()<int, unsigned int, void>(Process*, int&&, unsigned int&&) const (this=0x43fb080, __object=0x3bfb720) at /usr/include/c++/4.9.0/functional:569
#4  0x00007ffff5a68e42 in std::_Bind<std::_Mem_fn<void (Process::*)(int, int)> (Process*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, int&&, unsigned int&&, 0ul, 1ul, 2ul>(std::tuple<int&&, unsigned int&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (
    this=0x43fb080, __args=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x1005ae, DIE 0x130fdf>) at /usr/include/c++/4.9.0/functional:1264
#5  0x00007ffff5a6701d in std::_Bind<std::_Mem_fn<void (Process::*)(int, int)> (Process*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<int, unsigned int, void>(int&&, unsigned int&&) (this=0x43fb080) at /usr/include/c++/4.9.0/functional:1323
#6  0x00007ffff5a65359 in std::_Function_handler<void (int, unsigned int), std::_Bind<std::_Mem_fn<void (Process::*)(int, int)> (Process*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, int, unsigned int) (__functor=..., __args#0=18, 
    __args#1=2) at /usr/include/c++/4.9.0/functional:2039
#7  0x00007ffff5a3ee4c in std::function<void (int, unsigned int)>::operator()(int, unsigned int) const (this=0x7fffffffd680, __args#0=18, __args#1=2) at /usr/include/c++/4.9.0/functional:2439
#8  0x00007ffff5a3a8e7 in EventLoop::fireSocket (this=0x62d270, fd=18, mode=2) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:648
#9  0x00007ffff5a3ad91 in EventLoop::processSocketEvents (this=0x62d270, events=0x7fffffffd840, eventCount=1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:788
#10 0x00007ffff5a3b0f4 in EventLoop::exec (this=0x62d270, timeoutTime=-1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:893
#11 0x000000000041324c in main (argc=2, argv=0x7fffffffe718) at /home/jo/bin/rtags/src/rdm.cpp:547
(gdb) f 1
#1  0x00007ffff5a6214f in Process::handleInput (this=0x3bfb720, fd=18) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:617
617             eintrwrap(w, ::write(fd, front.mid(mStdInIndex).constData(), want));
(gdb) l
612         //printf("Process::handleInput in loop\n");
613         int w, want;
614         const String& front = mStdInBuffer.front();
615         if (mStdInIndex) {
616             want = front.size() - mStdInIndex;
617             eintrwrap(w, ::write(fd, front.mid(mStdInIndex).constData(), want));
618         } else {
619             want = front.size();
620             eintrwrap(w, ::write(fd, front.constData(), want));
621         }
(gdb) 

gdb fails to generate a core file, I hope this will be enough.

Andersbakken commented 10 years ago

Hi

This is actually a clang bug. Somehow clang will crash on us a lot of the time if the files being indexed are changed underneath them. I've put in some code that I hope addresses this (it's hard to reproduce reliably) by reading the file into memory ourselves and then using their CXUnsavedFiles API to prevent them from hitting the file system. If you find a way to reliably reproduce this problem I would love to have you try with 01c466e applied.

regards

Anders

On Tue, Jun 24, 2014 at 8:26 AM, Gravemind notifications@github.com wrote:

I got sevral time the same crash when editing "not-yet-buildable" code in emacs

Here the gdb with a debug build

[ 36%] 10/28 17:02:47 ~/documents/?????????????????.cpp error in 899ms. (1 deps) (dirty). libclang: crash detected during parsing: { 'source_filename' : '/home/??????????????' 'command_line_args' : ['-Wall', '-Wextra', '-ffast-math', '-O2', '-g', '-m64', '-fno-strict-aliasing', '-mfpmath=sse', '-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-attributes', '-Wno-unused-local-typedefs', '-std=gnu++0x', '-fno-exceptions', '-c', '-ferror-limit=0', '-Wall', '-fspell-checking', '-Wno-unknown-warning-option', '???????????'], 'unsaved_files' : [], 'options' : 1, } got failure clang -Wall -Wextra -ffast-math -O2 -g -m64 -fno-strict-aliasing -mfpmath=sse -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-attributes -Wno-unused-local-typedefs -std=gnu++0x -fno-exceptions -c -ferror-limit=0 -Wall -fspell-checking -Wno-unknown-warning-option ??????????

[ 39%] 11/28 17:02:47 ~/documents/??????????????????.cpp error in 906ms. (1 deps) (dirty). libclang: crash detected during parsing: { 'source_filename' : '/home/????????????????.cpp' 'command_line_args' : ['-Wall', '-Wextra', '-ffast-math', '-O2', '-g', '-m64', '-fno-strict-aliasing', '-mfpmath=sse', '-Wno-unused-variable', '-Wno-unused-parameter', '-Wno-unused-but-set-variable', '-Wno-attributes', '-Wno-unused-local-typedefs', '-std=gnu++0x', '-fno-exceptions', '-c', '-ferror-limit=0', '-Wall', '-fspell-checking', '-Wno-unknown-warning-option', '???????????????'], 'unsaved_files' : [], 'options' : 1, } got failure clang -Wall -Wextra -ffast-math -O2 -g -m64 -fno-strict-aliasing -mfpmath=sse -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-attributes -Wno-unused-local-typedefs -std=gnu++0x -fno-exceptions -c -ferror-limit=0 -Wall -fspell-checking -Wno-unknown-warning-option ???????????

Program received signal SIGPIPE, Broken pipe. 0x00007ffff714460d in write () from /usr/lib/libpthread.so.0 (gdb) bt

0 0x00007ffff714460d in write () from /usr/lib/libpthread.so.0

1 0x00007ffff5a6214f in Process::handleInput (this=0x3bfb720, fd=18) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:617

2 0x00007ffff5a61d6b in Process::processCallback (this=0x3bfb720, fd=18, mode=2) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:564

3 0x00007ffff5a69fdf in std::_Memfn<void (Process::*)(int, int)>::operator()<int, unsigned int, void>(Process, int&&, unsigned int&&) const (this=0x43fb080, __object=0x3bfb720) at /usr/include/c++/4.9.0/functional:569

4 0x00007ffff5a68e42 in std::_Bind<std::_Memfn<void (Process::)(int, int)> (Process_, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, int&&, unsigned int&&, 0ul, 1ul, 2ul>(std::tuple<int&&, unsigned int&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (

this=0x43fb080, __args=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x1005ae, DIE 0x130fdf>) at /usr/include/c++/4.9.0/functional:1264

5 0x00007ffff5a6701d in std::_Bind<std::_Memfn<void (Process::)(int, int)> (Process_, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<int, unsigned int, void>(int&&, unsigned int&&) (this=0x43fb080) at /usr/include/c++/4.9.0/functional:1323

6 0x00007ffff5a65359 in std::_Function_handler<void (int, unsigned int), std::_Bind<std::_Memfn<void (Process::)(int, int)> (Process*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, int, unsigned int) (functor=..., args#0=18,

__args#1=2) at /usr/include/c++/4.9.0/functional:2039

7 0x00007ffff5a3ee4c in std::function<void (int, unsigned int)>::operator()(int, unsigned int) const (this=0x7fffffffd680, args#0=18, args#1=2) at /usr/include/c++/4.9.0/functional:2439

8 0x00007ffff5a3a8e7 in EventLoop::fireSocket (this=0x62d270, fd=18, mode=2) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:648

9 0x00007ffff5a3ad91 in EventLoop::processSocketEvents (this=0x62d270, events=0x7fffffffd840, eventCount=1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:788

10 0x00007ffff5a3b0f4 in EventLoop::exec (this=0x62d270, timeoutTime=-1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:893

11 0x000000000041324c in main (argc=2, argv=0x7fffffffe718) at /home/jo/bin/rtags/src/rdm.cpp:547

(gdb) f 1

1 0x00007ffff5a6214f in Process::handleInput (this=0x3bfb720, fd=18) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:617

617 eintrwrap(w, ::write(fd, front.mid(mStdInIndex).constData(), want)); (gdb) l 612 //printf("Process::handleInput in loop\n"); 613 int w, want; 614 const String& front = mStdInBuffer.front(); 615 if (mStdInIndex) { 616 want = front.size() - mStdInIndex; 617 eintrwrap(w, ::write(fd, front.mid(mStdInIndex).constData(), want)); 618 } else { 619 want = front.size(); 620 eintrwrap(w, ::write(fd, front.constData(), want)); 621 } (gdb)

gdb fails to generate a core file, I hope this will be enough.

— Reply to this email directly or view it on GitHub https://github.com/Andersbakken/rtags/issues/188.

Gravemind commented 10 years ago

I was able to reproduce it, and still crash.

I have a .h file which is included in 28 cpp files, in emacs I C-w the whole .h, then save, then undo, save, undo, save, undo... not too quickly, at maybe 1 save per second.

But the ouput changed and it seems to SIGPIPE eslewhere. No more crash detected during parsing just "normal" compilation error and then

Program received signal SIGPIPE, Broken pipe.
0x00007ffff714460d in write () from /usr/lib/libpthread.so.0
(gdb) bt
#0  0x00007ffff714460d in write () from /usr/lib/libpthread.so.0
#1  0x00007ffff5a714de in SocketClient::writeTo (this=0x1078470, host=..., port=0, data=0x361fe18 "\006", size=6) at /home/jo/bin/rtags/src/rct/rct/SocketClient.cpp:455
#2  0x00007ffff5a719a7 in SocketClient::write (this=0x1078470, data=0x361fe18 "\006", size=6) at /home/jo/bin/rtags/src/rct/rct/SocketClient.cpp:505
#3  0x00007ffff78beecf in SocketClient::write (this=0x1078470, data=...) at /home/jo/bin/rtags/src/rct/rct/SocketClient.h:56
#4  0x00007ffff5a25318 in Connection::send (this=0x2f96fc0, messageId=2 '\002', message=...) at /home/jo/bin/rtags/src/rct/rct/Connection.cpp:105
#5  0x00007ffff78912f0 in Connection::send(Message&&) (this=0x2f96fc0, message=<unknown type in /home/jo/bin/rtags/src/librtags.so, CU 0x0, DIE 0x6a2c3>) at /home/jo/bin/rtags/src/rct/rct/Connection.h:100
#6  0x00007ffff78911df in Connection::finish (this=0x2f96fc0, status=0) at /home/jo/bin/rtags/src/rct/rct/Connection.h:54
#7  0x00007ffff793bbb2 in Server::handleIndexerMessage (this=0x62d670, message=..., conn=0x2f96fc0) at /home/jo/bin/rtags/src/Server.cpp:455
#8  0x00007ffff793a690 in Server::onNewMessage (this=0x62d670, message=0x2ec3a70, connection=0x2f96fc0) at /home/jo/bin/rtags/src/Server.cpp:302
#9  0x00007ffff7965ad7 in std::_Mem_fn<void (Server::*)(Message*, Connection*)>::operator()<Message*, Connection*, void>(Server*, Message*&&, Connection*&&) const (this=0x12cb630, __object=0x62d670) at /usr/include/c++/4.9.0/functional:569
#10 0x00007ffff7962c68 in std::_Bind<std::_Mem_fn<void (Server::*)(Message*, Connection*)> (Server*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, Message*&&, Connection*&&, 0ul, 1ul, 2ul>(std::tuple<Message*&&, Connection*&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x12cb630, __args=<unknown type in /home/jo/bin/rtags/src/librtags.so, CU 0x7d0997, DIE 0x8a6973>) at /usr/include/c++/4.9.0/functional:1264
#11 0x00007ffff795dd83 in std::_Bind<std::_Mem_fn<void (Server::*)(Message*, Connection*)> (Server*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<Message*, Connection*, void>(Message*&&, Connection*&&) (this=0x12cb630) at /usr/include/c++/4.9.0/functional:1323
#12 0x00007ffff7959037 in std::_Function_handler<void (Message*, Connection*), std::_Bind<std::_Mem_fn<void (Server::*)(Message*, Connection*)> (Server*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, Message*, Connection*) (
    __functor=..., __args#0=0x2ec3a70, __args#1=0x2f96fc0) at /usr/include/c++/4.9.0/functional:2039
#13 0x00007ffff5a2d006 in std::function<void (Message*, Connection*)>::operator()(Message*, Connection*) const (this=0x2d7c008, __args#0=0x2ec3a70, __args#1=0x2f96fc0) at /usr/include/c++/4.9.0/functional:2439
#14 0x00007ffff5a29ffa in Signal<std::function<void (Message*, Connection*)> >::operator()<Message*&, Connection*>(Message*&, Connection*&&) (this=0x2f96ff8) at /home/jo/bin/rtags/src/rct/rct/SignalSlot.h:69
#15 0x00007ffff5a25a82 in Connection::onDataAvailable(std::shared_ptr<SocketClient> const&, Buffer&&) (this=0x2f96fc0, buffer=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x27f55, DIE 0x5b6a5>) at /home/jo/bin/rtags/src/rct/rct/Connection.cpp:191
#16 0x00007ffff5a35663 in std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)>::operator()<std::shared_ptr<SocketClient> const&, Buffer, void>(Connection*, std::shared_ptr<SocketClient> const&, Buffer&&) const (this=0x8cb7e0, 
    __object=0x2f96fc0) at /usr/include/c++/4.9.0/functional:569
#17 0x00007ffff5a3359a in std::_Bind<std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)> (Connection*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, std::shared_ptr<SocketClient> const&, Buffer&&, 0ul, 1ul, 2ul>(std::tuple<std::shared_ptr<SocketClient> const&, Buffer&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x8cb7e0, __args=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x27f55, DIE 0x6601d>) at /usr/include/c++/4.9.0/functional:1264
#18 0x00007ffff5a30605 in std::_Bind<std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)> (Connection*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<std::shared_ptr<SocketClient> const&, Buffer, void>(std::shared_ptr<SocketClient> const&, Buffer&&) (this=0x8cb7e0) at /usr/include/c++/4.9.0/functional:1323
#19 0x00007ffff5a2def9 in std::_Function_handler<void (std::shared_ptr<SocketClient> const&, Buffer&&), std::_Bind<std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)> (Connection*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, std::shared_ptr<SocketClient> const&, Buffer&&) (__functor=..., __args#0=std::shared_ptr (count 3, weak 1) 0x1078470, __args#1=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x27f55, DIE 0x618c8>) at /usr/include/c++/4.9.0/functional:2039
#20 0x00007ffff5a74eb6 in std::function<void (std::shared_ptr<SocketClient> const&, Buffer&&)>::operator()(std::shared_ptr<SocketClient> const&, Buffer&&) const (this=0x28c4918, __args#0=std::shared_ptr (count 3, weak 1) 0x1078470, 
    __args#1=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x15b919, DIE 0x18288c>) at /usr/include/c++/4.9.0/functional:2439
#21 0x00007ffff5a73b68 in Signal<std::function<void (std::shared_ptr<SocketClient> const&, Buffer&&)> >::operator()<std::shared_ptr<SocketClient>&, Buffer>(std::shared_ptr<SocketClient>&, Buffer&&) (this=0x10784a8) at /home/jo/bin/rtags/src/rct/rct/SignalSlot.h:69
#22 0x00007ffff5a71fa1 in SocketClient::socketCallback (this=0x1078470, f=13, mode=1) at /home/jo/bin/rtags/src/rct/rct/SocketClient.cpp:597
#23 0x00007ffff5a78c39 in std::_Mem_fn<void (SocketClient::*)(int, int)>::operator()<int, unsigned int, void>(SocketClient*, int&&, unsigned int&&) const (this=0x66ec90, __object=0x1078470) at /usr/include/c++/4.9.0/functional:569
#24 0x00007ffff5a76e68 in std::_Bind<std::_Mem_fn<void (SocketClient::*)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, int&&, unsigned int&&, 0ul, 1ul, 2ul>(std::tuple<int&&, unsigned int&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (
    this=0x66ec90, __args=<unknown type in /home/jo/bin/rtags/src/rct/librct.so, CU 0x15b919, DIE 0x18472c>) at /usr/include/c++/4.9.0/functional:1264
#25 0x00007ffff5a7584d in std::_Bind<std::_Mem_fn<void (SocketClient::*)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<int, unsigned int, void>(int&&, unsigned int&&) (this=0x66ec90) at /usr/include/c++/4.9.0/functional:1323
#26 0x00007ffff5a7452b in std::_Function_handler<void (int, unsigned int), std::_Bind<std::_Mem_fn<void (SocketClient::*)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, int, unsigned int) (__functor=..., 
    __args#0=13, __args#1=1) at /usr/include/c++/4.9.0/functional:2039
#27 0x00007ffff5a3ee4c in std::function<void (int, unsigned int)>::operator()(int, unsigned int) const (this=0x7fffffffd680, __args#0=13, __args#1=1) at /usr/include/c++/4.9.0/functional:2439
#28 0x00007ffff5a3a8e7 in EventLoop::fireSocket (this=0x62d270, fd=13, mode=1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:648
#29 0x00007ffff5a3ad91 in EventLoop::processSocketEvents (this=0x62d270, events=0x7fffffffd840, eventCount=10) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:788
#30 0x00007ffff5a3b0f4 in EventLoop::exec (this=0x62d270, timeoutTime=-1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:893
#31 0x000000000041324c in main (argc=2, argv=0x7fffffffe718) at /home/jo/bin/rtags/src/rdm.cpp:547
Gravemind commented 10 years ago

Nope the callstack did not changed:

#0  0x00007ffff714460d in write () from /usr/lib/libpthread.so.0
#1  0x00007ffff5a6214f in Process::handleInput (this=0x14e5370, fd=21) at /home/jo/bin/rtags/src/rct/rct/Process.cpp:617

But still, no crash detected during parsing in the output

jhanssen commented 10 years ago

If you're seeing problems outside of gdb then I think SIGPIPE is masking the real bug here, we explicitly call

signal(SIGPIPE, SIG_IGN)

very early on and if you ignore SIGPIPE in gdb by doing

handle SIGPIPE nostop noprint pass

you should no longer be stopping when that happens. Could you rerun with that and see if you still have problems and post a new stacktrace if you do? Thanks.

Gravemind commented 10 years ago

Yep no longer SIGPIPE, I see some crash detected during parsing but it continues without crashing. But now:

*** Error in `/home/jo/bin/rtags/bin/rdm': double free or corruption (!prev): 0x000000000133c120 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x73f8e)[0x7ffff4506f8e]
/usr/lib/libc.so.6(+0x7988e)[0x7ffff450c88e]
/usr/lib/libc.so.6(+0x7a04b)[0x7ffff450d04b]
/home/jo/bin/rtags/src/librtags.so(_ZN16DeleteLaterEventI10ConnectionE4execEv+0x39)[0x7ffff7968931]
/home/jo/bin/rtags/src/rct/librct.so(_ZN9EventLoop16sendPostedEventsEv+0x9d)[0x7ffff5a3cae1]
/home/jo/bin/rtags/src/rct/librct.so(_ZN9EventLoop4execEi+0xa3)[0x7ffff5a3aee9]
/home/jo/bin/rtags/bin/rdm(main+0x1cad)[0x41324c]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7ffff44b3000]
/home/jo/bin/rtags/bin/rdm[0x4110d9]
======= Memory map: ========
00400000-00427000 r-xp 00000000 08:03 7866606                            /home/jo/bin/rtags/bin/rdm
00627000-00628000 rw-p 00027000 08:03 7866606                            /home/jo/bin/rtags/bin/rdm
00628000-040e3000 rw-p 00000000 00:00 0                                  [heap]
7fffb4000000-7fffb7639000 rw-p 00000000 00:00 0 
7fffb7639000-7fffb8000000 ---p 00000000 00:00 0 
...........
Program received signal SIGABRT, Aborted.
0x00007ffff44c6d67 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff44c6d67 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff44c8118 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff4506f93 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007ffff450c88e in malloc_printerr () from /usr/lib/libc.so.6
#4  0x00007ffff450d04b in _int_free () from /usr/lib/libc.so.6
#5  0x00007ffff7968931 in DeleteLaterEvent<Connection>::exec (this=0x18e0dc0) at /home/jo/bin/rtags/src/rct/rct/EventLoop.h:71
#6  0x00007ffff5a3cae1 in EventLoop::sendPostedEvents (this=0x62d270) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:258
#7  0x00007ffff5a3aee9 in EventLoop::exec (this=0x62d270, timeoutTime=-1) at /home/jo/bin/rtags/src/rct/rct/EventLoop.cpp:810
#8  0x000000000041324c in main (argc=2, argv=0x7fffffffe718) at /home/jo/bin/rtags/src/rdm.cpp:547
jhanssen commented 10 years ago

I've seen that lately as well but haven't been able to reliably reproduce it. Are you able to, and if so what steps do I need to take? Also, if you could run under valgrind and send back the output then that would be awesome.

Gravemind commented 10 years ago

Could not yet get it crashed, it's very slow down under valgrind (even in release)

but here the errors I got in release build with CXXFLAGS=-g:

https://gist.github.com/Gravemind/18db4cb8c838d4276038#file-gistfile1-txt

jhanssen commented 10 years ago

Thanks.

I think I might have fixed it in 03641e28. Could you check perhaps?

Gravemind commented 10 years ago

Great, no crash so far, Thank You ! (and no valgrind errors)