a SIGSEGV in Linux
-
Hello,
I have a SIGSEGV crash in Qt. Could you please tell me what the crash is? Thanks in advance.
Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 77 exit.c: No such file or directory. [Current thread is 1 (Thread 0x7f070281e700 (LWP 4848))] (gdb) (gdb) (gdb) bt #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 #1 0x00007f070370cbe0 in __GI_exit (status=<optimized out>) at exit.c:139 #2 0x00007f0700aca371 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) [clone .cold] () from /usr/local/bin/across/libQt5XcbQpa.so.5 #3 0x00007f0700af8de3 in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/local/bin/across/libQt5XcbQpa.so.5 #4 0x00007f07031b417d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007f07031b4400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00007f07031b44a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007f07043522fe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #8 0x00007f07042fd20b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #9 0x00007f0704304ade in QCoreApplication::exec() () from /usr/local/bin/across/libQt5Core.so.5 #10 0x000000000056adf9 in Across::RunCommonRoutine(int&, char**, _ACROSS_CONTEXT*, __sigset_t const*, int&)::{lambda()#3}::operator()() const () #11 0x00007f0703ce9240 in std::execute_native_thread_routine (__p=0x1690b70) --Type <RET> for more, q to quit, c to continue without paging-- /var/tmp/sayongza/gcc-9.3.0_source/gcc-9.3.0/libstdc++-v3/src/c++11/thread.cc:80 #12 0x00007f070404d609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #13 0x00007f07037e5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95The backtrace is for Qt5.14.2 and it still occurs on Qt5.15.
It would occur sometimes when a user session changes, e.g., user login or logout (but I don't know exactly which moment ). -
Found the source of the crash.
void QXcbConnection::processXcbEvents(QEventLoop::ProcessEventsFlags flags) { int connection_error = xcb_connection_has_error(xcb_connection()); if (connection_error) { qWarning("The X11 connection broke (error %d). Did the X11 server die?", connection_error); exit(1); <= HERE }In my app, Qt runs in a child thread and when it meets the exit(1), the standard cleanup proceeds. But my app is multi-threaded...
Thank you everyone for your help.
-
Hello,
I have a SIGSEGV crash in Qt. Could you please tell me what the crash is? Thanks in advance.
Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 77 exit.c: No such file or directory. [Current thread is 1 (Thread 0x7f070281e700 (LWP 4848))] (gdb) (gdb) (gdb) bt #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 #1 0x00007f070370cbe0 in __GI_exit (status=<optimized out>) at exit.c:139 #2 0x00007f0700aca371 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) [clone .cold] () from /usr/local/bin/across/libQt5XcbQpa.so.5 #3 0x00007f0700af8de3 in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/local/bin/across/libQt5XcbQpa.so.5 #4 0x00007f07031b417d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007f07031b4400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00007f07031b44a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007f07043522fe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #8 0x00007f07042fd20b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #9 0x00007f0704304ade in QCoreApplication::exec() () from /usr/local/bin/across/libQt5Core.so.5 #10 0x000000000056adf9 in Across::RunCommonRoutine(int&, char**, _ACROSS_CONTEXT*, __sigset_t const*, int&)::{lambda()#3}::operator()() const () #11 0x00007f0703ce9240 in std::execute_native_thread_routine (__p=0x1690b70) --Type <RET> for more, q to quit, c to continue without paging-- /var/tmp/sayongza/gcc-9.3.0_source/gcc-9.3.0/libstdc++-v3/src/c++11/thread.cc:80 #12 0x00007f070404d609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #13 0x00007f07037e5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95The backtrace is for Qt5.14.2 and it still occurs on Qt5.15.
It would occur sometimes when a user session changes, e.g., user login or logout (but I don't know exactly which moment ). -
@sjlee said in a SIGSEGV in Linux:
a user session changes, e.g., user login or logout
Qt, as a C++ library, does not have any "user session" or "user login or logout", so what does this mean?
-
@JonB
Hi, Regarding the terms, please refer to this site: https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.htmlThank you.
-
Hello,
I have a SIGSEGV crash in Qt. Could you please tell me what the crash is? Thanks in advance.
Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 77 exit.c: No such file or directory. [Current thread is 1 (Thread 0x7f070281e700 (LWP 4848))] (gdb) (gdb) (gdb) bt #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 #1 0x00007f070370cbe0 in __GI_exit (status=<optimized out>) at exit.c:139 #2 0x00007f0700aca371 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) [clone .cold] () from /usr/local/bin/across/libQt5XcbQpa.so.5 #3 0x00007f0700af8de3 in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/local/bin/across/libQt5XcbQpa.so.5 #4 0x00007f07031b417d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007f07031b4400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00007f07031b44a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007f07043522fe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #8 0x00007f07042fd20b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #9 0x00007f0704304ade in QCoreApplication::exec() () from /usr/local/bin/across/libQt5Core.so.5 #10 0x000000000056adf9 in Across::RunCommonRoutine(int&, char**, _ACROSS_CONTEXT*, __sigset_t const*, int&)::{lambda()#3}::operator()() const () #11 0x00007f0703ce9240 in std::execute_native_thread_routine (__p=0x1690b70) --Type <RET> for more, q to quit, c to continue without paging-- /var/tmp/sayongza/gcc-9.3.0_source/gcc-9.3.0/libstdc++-v3/src/c++11/thread.cc:80 #12 0x00007f070404d609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #13 0x00007f07037e5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95The backtrace is for Qt5.14.2 and it still occurs on Qt5.15.
It would occur sometimes when a user session changes, e.g., user login or logout (but I don't know exactly which moment ). -
Hello,
I have a SIGSEGV crash in Qt. Could you please tell me what the crash is? Thanks in advance.
Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 77 exit.c: No such file or directory. [Current thread is 1 (Thread 0x7f070281e700 (LWP 4848))] (gdb) (gdb) (gdb) bt #0 0x00007f070370c9f6 in __run_exit_handlers (status=1, listp=0x7f07038ae718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:77 #1 0x00007f070370cbe0 in __GI_exit (status=<optimized out>) at exit.c:139 #2 0x00007f0700aca371 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) [clone .cold] () from /usr/local/bin/across/libQt5XcbQpa.so.5 #3 0x00007f0700af8de3 in xcbSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/local/bin/across/libQt5XcbQpa.so.5 #4 0x00007f07031b417d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007f07031b4400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00007f07031b44a3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007f07043522fe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #8 0x00007f07042fd20b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/local/bin/across/libQt5Core.so.5 #9 0x00007f0704304ade in QCoreApplication::exec() () from /usr/local/bin/across/libQt5Core.so.5 #10 0x000000000056adf9 in Across::RunCommonRoutine(int&, char**, _ACROSS_CONTEXT*, __sigset_t const*, int&)::{lambda()#3}::operator()() const () #11 0x00007f0703ce9240 in std::execute_native_thread_routine (__p=0x1690b70) --Type <RET> for more, q to quit, c to continue without paging-- /var/tmp/sayongza/gcc-9.3.0_source/gcc-9.3.0/libstdc++-v3/src/c++11/thread.cc:80 #12 0x00007f070404d609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #13 0x00007f07037e5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95The backtrace is for Qt5.14.2 and it still occurs on Qt5.15.
It would occur sometimes when a user session changes, e.g., user login or logout (but I don't know exactly which moment ).@sjlee
BTW, if it helps any. It looks like there is an Xcb event causing process exit. When a C program exits there is an_atexit()function which is called during program to place a list of functions to call when the C program exits. I imagine C++ leverages something like this to place a bunch of destructor calls in a list. And somewhere in processing this list, or calling the functions on it, you are getting a SIGSEGV. It is not clear how detailed the debugger is in pinpointing exactly where. Maybe, for example, it's a double-destruction, or the object to be destructed has already been destroyed, or something of that ilk?I don't know what you are supposed to do with this information, but there you are :)
-
@sjlee
BTW, if it helps any. It looks like there is an Xcb event causing process exit. When a C program exits there is an_atexit()function which is called during program to place a list of functions to call when the C program exits. I imagine C++ leverages something like this to place a bunch of destructor calls in a list. And somewhere in processing this list, or calling the functions on it, you are getting a SIGSEGV. It is not clear how detailed the debugger is in pinpointing exactly where. Maybe, for example, it's a double-destruction, or the object to be destructed has already been destroyed, or something of that ilk?I don't know what you are supposed to do with this information, but there you are :)
-
Thanks for the answer. Our app source code doesn't have exit.c. Maybe Qt or its calling library would have it.
-
Thanks for the answer. Our app source code doesn't have exit.c. Maybe Qt or its calling library would have it.
-
When I see something like this the first thing that comes to mind is that interdependent object destructors are being destroyed in the wrong order.
-
Found the source of the crash.
void QXcbConnection::processXcbEvents(QEventLoop::ProcessEventsFlags flags) { int connection_error = xcb_connection_has_error(xcb_connection()); if (connection_error) { qWarning("The X11 connection broke (error %d). Did the X11 server die?", connection_error); exit(1); <= HERE }In my app, Qt runs in a child thread and when it meets the exit(1), the standard cleanup proceeds. But my app is multi-threaded...
Thank you everyone for your help.
-
S sjlee has marked this topic as solved on