Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. a SIGSEGV in Linux
Qt 6.11 is out! See what's new in the release blog

a SIGSEGV in Linux

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 5 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sjlee
    wrote on last edited by sjlee
    #1

    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:95
    
    

    The 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 ).

    JonBJ Q 3 Replies Last reply
    0
    • S Offline
      S Offline
      sjlee
      wrote on last edited by sjlee
      #14

      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.

      1 Reply Last reply
      0
      • S sjlee

        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:95
        
        

        The 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 ).

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @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?

        S 1 Reply Last reply
        0
        • JonBJ JonB

          @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?

          S Offline
          S Offline
          sjlee
          wrote on last edited by sjlee
          #3

          @JonB
          Hi, Regarding the terms, please refer to this site: https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html

          Thank you.

          JonBJ 1 Reply Last reply
          0
          • S sjlee

            @JonB
            Hi, Regarding the terms, please refer to this site: https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html

            Thank you.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #4

            @sjlee
            I have absolutely no idea how that interacts/changes with your running Qt application, about which you say nothing. Perhaps somebody else does.

            1 Reply Last reply
            0
            • S sjlee

              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:95
              
              

              The 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 ).

              Q Offline
              Q Offline
              Qt embedded developer
              wrote on last edited by
              #5

              @sjlee said in a SIGSEGV in Linux:

              exit.c:139

              may be this line cause crash in your code.

              S 1 Reply Last reply
              0
              • S sjlee

                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:95
                
                

                The 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 ).

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #6

                @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 :)

                S 1 Reply Last reply
                0
                • JonBJ JonB

                  @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 :)

                  S Offline
                  S Offline
                  sjlee
                  wrote on last edited by sjlee
                  #7
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • Q Qt embedded developer

                    @sjlee said in a SIGSEGV in Linux:

                    exit.c:139

                    may be this line cause crash in your code.

                    S Offline
                    S Offline
                    sjlee
                    wrote on last edited by
                    #8

                    @Qt-embedded-developer

                    Thanks for the answer. Our app source code doesn't have exit.c. Maybe Qt or its calling library would have it.

                    C 1 Reply Last reply
                    0
                    • S sjlee

                      @Qt-embedded-developer

                      Thanks for the answer. Our app source code doesn't have exit.c. Maybe Qt or its calling library would have it.

                      C Offline
                      C Offline
                      ChrisW67
                      wrote on last edited by
                      #9

                      @sjlee "exit.c" is quite likely the source file that implements the standard C library exit(). Is Across::RunCommonRoutine() one of yours? It seems to be the only thing outside Qt/Standard library/OS to touch that trace.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sjlee
                        wrote on last edited by sjlee
                        #10
                        This post is deleted!
                        S 1 Reply Last reply
                        0
                        • S sjlee

                          This post is deleted!

                          S Offline
                          S Offline
                          sjlee
                          wrote on last edited by
                          #11
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            sjlee
                            wrote on last edited by
                            #12
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • Kent-DorfmanK Offline
                              Kent-DorfmanK Offline
                              Kent-Dorfman
                              wrote on last edited by
                              #13

                              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.

                              The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                sjlee
                                wrote on last edited by sjlee
                                #14

                                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.

                                1 Reply Last reply
                                0
                                • S sjlee has marked this topic as solved on

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved