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

Abort (uncaught bad_weak_ptr()?) from Connection::onClientDisconnected(). #383

Closed toojays closed 9 years ago

toojays commented 9 years ago

rtags cb817751 dumped core. I'm not exactly sure what I was doing at the time, but the backtrace looks like:

Core was generated by `rdm --rp-nice-value=10'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f0627e85cc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f0627e85cc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f0627e890d8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00000000004f3a43 in __throw_bad_weak_ptr () at /usr/include/c++/5/bits/shared_ptr_base.h:79
#3  _M_add_ref_lock (this=<optimised out>) at /usr/include/c++/5/bits/shared_ptr_base.h:244
#4  __shared_count (__r=..., this=<optimised out>) at /usr/include/c++/5/bits/shared_ptr_base.h:827
#5  __shared_ptr<Connection> (__r=..., this=<optimised out>) at /usr/include/c++/5/bits/shared_ptr_base.h:949
#6  shared_ptr<Connection> (__r=..., this=<optimised out>) at /usr/include/c++/5/bits/shared_ptr.h:251
#7  shared_from_this (this=<optimised out>) at /usr/include/c++/5/bits/shared_ptr.h:573
#8  Connection::onClientDisconnected (this=<optimised out>) at /home/jscott/src/rtags/src/rct/rct/Connection.h:102
#9  0x0000000000513a3e in operator() (__args#0=..., this=0x3c644c8) at /usr/include/c++/5/functional:2271
#10 operator()<std::shared_ptr<SocketClient>&> (this=0x2cb58d8) at /home/jscott/src/rtags/src/rct/rct/SignalSlot.h:69
#11 SocketClient::socketCallback (this=0x2cb5780, f=<optimised out>, mode=1) at /home/jscott/src/rtags/src/rct/rct/SocketClient.cpp:603
#12 0x00000000004f9078 in operator() (__args#1=1, __args#0=21, this=0x7ffccbb53f00) at /usr/include/c++/5/functional:2271
#13 EventLoop::fireSocket (this=this@entry=0x2517f20, fd=<optimised out>, mode=1) at /home/jscott/src/rtags/src/rct/rct/EventLoop.cpp:684
#14 0x00000000004f9def in EventLoop::processSocketEvents (this=this@entry=0x2517f20, events=events@entry=0x7ffccbb54120, eventCount=<optimised out>) at /home/jscott/src/rtags/src/rct/rct/EventLoop.cpp:823
#15 0x00000000004fb5f7 in EventLoop::exec (this=0x2517f20, timeoutTime=timeoutTime@entry=-1) at /home/jscott/src/rtags/src/rct/rct/EventLoop.cpp:941
#16 0x00000000004387bf in main (argc=<optimised out>, argv=0x7ffccbb55688) at /home/jscott/src/rtags/src/rdm.cpp:729
Andersbakken commented 9 years ago

Hi

Can you check your rct-config.h and see if

define HAVE_EPOLL

is defined or not?

Anders

toojays commented 9 years ago

It is defined:

#ifndef RCT_CONFIG_H
#define RCT_CONFIG_H

#define HAVE_BACKTRACE
#define HAVE_CLOCK_MONOTONIC_RAW
#define HAVE_CLOCK_MONOTONIC
/* #undef HAVE_MACH_ABSOLUTE_TIME */
#define HAVE_INOTIFY
/* #undef HAVE_KQUEUE */
/* #undef HAVE_CHANGENOTIFICATION */
/* #undef HAVE_PROCESSORINFORMATION */
/* #undef HAVE_CYGWIN */
#define HAVE_EPOLL
/* #undef HAVE_NOSIGPIPE */
#define HAVE_NOSIGNAL
/* #undef HAVE_FSEVENTS */
#define HAVE_STATMTIM
#define HAVE_CLOEXEC
#define HAVE_SCHEDIDLE
#define HAVE_SHMDEST
/* #undef HAVE_SCRIPTENGINE */
/* #undef HAVE_UNORDERDED_MAP_WORKING_MOVE_CONSTRUCTOR */
#if !defined(HAVE_EPOLL) && !defined(HAVE_KQUEUE)
#define HAVE_SELECT
#endif

#endif
Andersbakken commented 9 years ago

I believe this https://github.com/Andersbakken/rct/pull/30 fixes it. Can you verify?

toojays commented 9 years ago

This looks fixed now. Thanks Anders.

Andersbakken commented 9 years ago

My pleasure. It was even a contribution. OSS at its finest :-) https://github.com/Andersbakken/rct/commit/0be84220cadeaf15c2111582d16dfc3c1859e8ce

On Wed, Jul 29, 2015 at 9:20 PM, John Steele Scott <notifications@github.com

wrote:

This looks fixed now. Thanks Anders.

— Reply to this email directly or view it on GitHub https://github.com/Andersbakken/rtags/issues/383#issuecomment-126178261.