Skip to content

Instantly share code, notes, and snippets.

@gusano
Created October 1, 2013 07:27
Show Gist options
  • Save gusano/6774954 to your computer and use it in GitHub Desktop.
Save gusano/6774954 to your computer and use it in GitHub Desktop.
sclang crash when SerialPort closed
sc3> p = SerialPort("/dev/ttyUSB0", 115200)
portName /dev/ttyUSB0
[New Thread 0x7fffa2e93700 (LWP 1105)]
a SerialPort
sc3> p.close()
a SerialPort
sc3> SerialPort /dev/ttyUSB0 was closed
SerialPort Cleanup
terminate called after throwing an instance of 'std::system_error'
what(): Resource deadlock avoided
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffa2e93700 (LWP 1105)]
0x00007ffff18b73d9 in raise () from /usr/lib/libc.so.6
(gdb) thread apply all bt
Thread 12 (Thread 0x7fffa2e93700 (LWP 1105)):
#0 0x00007ffff18b73d9 in raise () from /usr/lib/libc.so.6
#1 0x00007ffff18b87d8 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff1ea3ad5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6
#3 0x00007ffff1ea1c46 in ?? () from /usr/lib/libstdc++.so.6
#4 0x00007ffff1ea0d09 in ?? () from /usr/lib/libstdc++.so.6
#5 0x00007ffff1ea18ba in __gxx_personality_v0 () from /usr/lib/libstdc++.so.6
#6 0x00007ffff1c3c7d3 in ?? () from /usr/lib/libgcc_s.so.1
#7 0x00007ffff1c3cb6b in _Unwind_RaiseException () from /usr/lib/libgcc_s.so.1
#8 0x00007ffff1ea1e91 in __cxa_throw () from /usr/lib/libstdc++.so.6
#9 0x00007ffff1ef3a80 in std::__throw_system_error(int) () from /usr/lib/libstdc++.so.6
#10 0x00007ffff1ef4ac8 in std::thread::join() () from /usr/lib/libstdc++.so.6
#11 0x00000000005b62a1 in SerialPort::~SerialPort (this=0x2d0aa30, __in_chrg=<optimized out>) at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrSerialPrim.cpp:361
#12 0x00000000005b6ec7 in prSerialPort_Cleanup (g=0xa2ac60 <gVMGlobals>, numArgsPushed=1) at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrSerialPrim.cpp:613
#13 0x00000000004c13a5 in doPrimitive (g=0xa2ac60 <gVMGlobals>, meth=0x1f541c0, numArgsPushed=1) at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrPrimitive.cpp:3768
#14 0x000000000051bf5e in Interpret (g=0xa2ac60 <gVMGlobals>) at /home/gusi/dev/supercollider/lang/LangSource/PyrInterpreter3.cpp:2545
#15 0x000000000050d1cb in runInterpreter (g=0xa2ac60 <gVMGlobals>, selector=0xc324a8, numArgsPushed=1) at /home/gusi/dev/supercollider/lang/LangSource/PyrInterpreter3.cpp:127
#16 0x00000000005b6607 in SerialPort::doneAction (this=0x2d0aa30) at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrSerialPrim.cpp:437
#17 0x00000000005b69eb in SerialPort::threadLoop (this=0x2d0aa30) at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrSerialPrim.cpp:522
#18 0x00000000005b8e47 in std::_Mem_fn<void (SerialPort::*)()>::operator()<, void>(SerialPort*) const (this=0x2b0a220, __object=0x2d0aa30) at /usr/include/c++/4.8.1/functional:601
#19 0x00000000005b8da0 in std::_Bind<std::_Mem_fn<void (SerialPort::*)()> (SerialPort*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) (this=0x2b0a220,
__args=<unknown type in /usr/local/bin/sclang, CU 0x32b97b, DIE 0x33ae58>) at /usr/include/c++/4.8.1/functional:1296
#20 0x00000000005b8d11 in std::_Bind<std::_Mem_fn<void (SerialPort::*)()> (SerialPort*)>::operator()<, void>() (this=0x2b0a220) at /usr/include/c++/4.8.1/functional:1355
#21 0x00000000005b8ca0 in std::_Bind_simple<std::_Bind<std::_Mem_fn<void (SerialPort::*)()> (SerialPort*)> ()>::_M_invoke<>(std::_Index_tuple<>) (this=0x2b0a220) at /usr/include/c++/4.8.1/functional:1732
#22 0x00000000005b8be9 in std::_Bind_simple<std::_Bind<std::_Mem_fn<void (SerialPort::*)()> (SerialPort*)> ()>::operator()() (this=0x2b0a220) at /usr/include/c++/4.8.1/functional:1720
#23 0x00000000005b8b7e in std::thread::_Impl<std::_Bind_simple<std::_Bind<std::_Mem_fn<void (SerialPort::*)()> (SerialPort*)> ()> >::_M_run() (this=0x2b0a208) at /usr/include/c++/4.8.1/thread:115
#24 0x00007ffff1ef4d10 in ?? () from /usr/lib/libstdc++.so.6
#25 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#26 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 11 (Thread 0x7fffa1e91700 (LWP 1035)):
#0 0x00007ffff1967a13 in epoll_wait () from /usr/lib/libc.so.6
#1 0x000000000049f317 in boost::asio::detail::epoll_reactor::run (this=0xb75460, block=true, ops=...) at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/detail/impl/epoll_reactor.ipp:392
#2 0x00000000004a0761 in boost::asio::detail::task_io_service::do_run_one (this=0xb760f0, lock=..., this_thread=..., ec=...)
at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/detail/impl/task_io_service.ipp:368
#3 0x00000000004a02d4 in boost::asio::detail::task_io_service::run (this=0xb760f0, ec=...) at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/detail/impl/task_io_service.ipp:153
#4 0x00000000004a0bc7 in boost::asio::io_service::run (this=0xb747d0) at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/impl/io_service.ipp:59
#5 0x000000000049b96b in SC_TerminalClient::inputThreadFn (this=0xb74730) at /home/gusi/dev/supercollider/lang/LangSource/SC_TerminalClient.cpp:546
#6 0x00000000004ab16f in std::_Mem_fn<void (SC_TerminalClient::*)()>::operator()<, void>(SC_TerminalClient*) const (this=0xde7e90, __object=0xb74730) at /usr/include/c++/4.8.1/functional:601
#7 0x00000000004ab0c8 in std::_Bind<std::_Mem_fn<void (SC_TerminalClient::*)()> (SC_TerminalClient*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) (this=0xde7e90,
__args=<unknown type in /usr/local/bin/sclang, CU 0x781, DIE 0x34e31>) at /usr/include/c++/4.8.1/functional:1296
#8 0x00000000004aaf8d in std::_Bind<std::_Mem_fn<void (SC_TerminalClient::*)()> (SC_TerminalClient*)>::operator()<, void>() (this=0xde7e90) at /usr/include/c++/4.8.1/functional:1355
#9 0x00000000004aae56 in std::_Bind_simple<std::_Bind<std::_Mem_fn<void (SC_TerminalClient::*)()> (SC_TerminalClient*)> ()>::_M_invoke<>(std::_Index_tuple<>) (this=0xde7e90)
at /usr/include/c++/4.8.1/functional:1732
#10 0x00000000004aa72b in std::_Bind_simple<std::_Bind<std::_Mem_fn<void (SC_TerminalClient::*)()> (SC_TerminalClient*)> ()>::operator()() (this=0xde7e90) at /usr/include/c++/4.8.1/functional:1720
#11 0x00000000004aa31c in std::thread::_Impl<std::_Bind_simple<std::_Bind<std::_Mem_fn<void (SC_TerminalClient::*)()> (SC_TerminalClient*)> ()> >::_M_run() (this=0xde7e78) at /usr/include/c++/4.8.1/thread:115
#12 0x00007ffff1ef4d10 in ?? () from /usr/lib/libstdc++.so.6
#13 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#14 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 10 (Thread 0x7fffa2692700 (LWP 1034)):
#0 0x00007ffff7bcb03f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007ffff1ef175c in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/libstdc++.so.6
#2 0x00000000004b2b1c in std::condition_variable_any::wait<std::unique_lock<std::timed_mutex> > (this=0xa14ae0 <gSchedCond>, __lock=...) at /usr/include/c++/4.8.1/condition_variable:227
#3 0x00000000004af7a8 in schedRunFunc () at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrSched.cpp:438
#4 0x00000000004b65b3 in std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) (this=0x2d0aa20) at /usr/include/c++/4.8.1/functional:1732
#5 0x00000000004b63a3 in std::_Bind_simple<void (*())()>::operator()() (this=0x2d0aa20) at /usr/include/c++/4.8.1/functional:1720
#6 0x00000000004b6250 in std::thread::_Impl<std::_Bind_simple<void (*())()> >::_M_run() (this=0x2d0aa08) at /usr/include/c++/4.8.1/thread:115
#7 0x00007ffff1ef4d10 in ?? () from /usr/lib/libstdc++.so.6
#8 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#9 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 8 (Thread 0x7fffa3694700 (LWP 1031)):
#0 0x00007ffff19605e3 in select () from /usr/lib/libc.so.6
#1 0x00000000005bdfb8 in SC_LIDManager::loop (this=0xa312a0 <SC_LIDManager::instance()::instance>) at /home/gusi/dev/supercollider/lang/LangPrimSource/SC_LID.cpp:481
#2 0x00000000005bdf3a in SC_LIDManager::threadFunc (arg=0xa312a0 <SC_LIDManager::instance()::instance>) at /home/gusi/dev/supercollider/lang/LangPrimSource/SC_LID.cpp:469
#3 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 7 (Thread 0x7fffa3ee7700 (LWP 1030)):
#0 0x00007ffff7bcb03f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007ffff1ef175c in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/libstdc++.so.6
#2 0x00000000004b31b0 in std::condition_variable_any::wait<std::timed_mutex> (this=0xde9430, __lock=...) at /usr/include/c++/4.8.1/condition_variable:227
#3 0x00000000004b0230 in TempoClock::Run (this=0xde93e0) at /home/gusi/dev/supercollider/lang/LangPrimSource/PyrSched.cpp:853
#4 0x00000000004b68dd in std::_Mem_fn<void* (TempoClock::*)()>::operator()<, void>(TempoClock*) const (this=0xdef470, __object=0xde93e0) at /usr/include/c++/4.8.1/functional:601
#5 0x00000000004b67ca in std::_Bind<std::_Mem_fn<void* (TempoClock::*)()> (TempoClock*)>::__call<void*<>, 0ul> (this=0xdef470, __args=<unknown type in /usr/local/bin/sclang, CU 0x8c656, DIE 0xa5233>)
at /usr/include/c++/4.8.1/functional:1296
#6 0x00000000004b66e3 in std::_Bind<std::_Mem_fn<void* (TempoClock::*)()> (TempoClock*)>::operator()<, void*>() (this=0xdef470) at /usr/include/c++/4.8.1/functional:1355
#7 0x00000000004b6554 in std::_Bind_simple<std::_Bind<std::_Mem_fn<void* (TempoClock::*)()> (TempoClock*)> ()>::_M_invoke<>(std::_Index_tuple<>) (this=0xdef470) at /usr/include/c++/4.8.1/functional:1732
#8 0x00000000004b637b in std::_Bind_simple<std::_Bind<std::_Mem_fn<void* (TempoClock::*)()> (TempoClock*)> ()>::operator()() (this=0xdef470) at /usr/include/c++/4.8.1/functional:1720
#9 0x00000000004b6230 in std::thread::_Impl<std::_Bind_simple<std::_Bind<std::_Mem_fn<void* (TempoClock::*)()> (TempoClock*)> ()> >::_M_run() (this=0xdef458) at /usr/include/c++/4.8.1/thread:115
#10 0x00007ffff1ef4d10 in ?? () from /usr/lib/libstdc++.so.6
#11 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#12 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 3 (Thread 0x7fffe5eed700 (LWP 1026)):
#0 0x00007ffff7bcb03f in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x00007ffff5b43f1d in ?? () from /usr/lib/libQtWebKit.so.4
#2 0x00007ffff5b43f59 in ?? () from /usr/lib/libQtWebKit.so.4
#3 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 2 (Thread 0x7fffea129700 (LWP 1025)):
#0 0x00007ffff1967a13 in epoll_wait () from /usr/lib/libc.so.6
#1 0x000000000049f317 in boost::asio::detail::epoll_reactor::run (this=0xbe40a0, block=true, ops=...) at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/detail/impl/epoll_reactor.ipp:392
#2 0x00000000004a0761 in boost::asio::detail::task_io_service::do_run_one (this=0xa6c390, lock=..., this_thread=..., ec=...)
at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/detail/impl/task_io_service.ipp:368
#3 0x00000000004a02d4 in boost::asio::detail::task_io_service::run (this=0xa6c390, ec=...) at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/detail/impl/task_io_service.ipp:153
#4 0x00000000004a0bc7 in boost::asio::io_service::run (this=0xa31480 <ioService>) at /home/gusi/dev/supercollider/external_libraries/boost/boost/asio/impl/io_service.ipp:59
#5 0x00000000005e49be in asioFunction () at /home/gusi/dev/supercollider/lang/LangPrimSource/SC_ComPort.cpp:53
#6 0x00000000004b65b3 in std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) (this=0xbe34f0) at /usr/include/c++/4.8.1/functional:1732
#7 0x00000000004b63a3 in std::_Bind_simple<void (*())()>::operator()() (this=0xbe34f0) at /usr/include/c++/4.8.1/functional:1720
#8 0x00000000004b6250 in std::thread::_Impl<std::_Bind_simple<void (*())()> >::_M_run() (this=0xbe34d8) at /usr/include/c++/4.8.1/thread:115
#9 0x00007ffff1ef4d10 in ?? () from /usr/lib/libstdc++.so.6
#10 0x00007ffff7bc70a2 in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007ffff196743d in clone () from /usr/lib/libc.so.6
Thread 1 (Thread 0x7ffff7f9b7c0 (LWP 1021)):
#0 0x00007ffff195e96d in poll () from /usr/lib/libc.so.6
#1 0x00007fffeeb4b084 in ?? () from /usr/lib/libglib-2.0.so.0
#2 0x00007fffeeb4b18c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3 0x00007ffff292cb25 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#4 0x00007ffff320d266 in ?? () from /usr/lib/libQtGui.so.4
#5 0x00007ffff28feb1f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6 0x00007ffff28fee15 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7 0x00007ffff2903f4b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#8 0x00000000004accbb in QtCollider::LangClient::commandLoop (this=0xb74720) at /home/gusi/dev/supercollider/QtCollider/LanguageClient.cpp:44
#9 0x000000000049acc8 in SC_TerminalClient::run (this=0xb74730, argc=0, argv=0x7fffffffe7d0) at /home/gusi/dev/supercollider/lang/LangSource/SC_TerminalClient.cpp:257
#10 0x000000000049a27b in main (argc=1, argv=0x7fffffffe7c8) at /home/gusi/dev/supercollider/lang/LangSource/cmdLineFuncs.cpp:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment