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. Segmentation fault during QApplication.exec()
Forum Updated to NodeBB v4.3 + New Features

Segmentation fault during QApplication.exec()

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 4.6k Views 3 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.
  • J Offline
    J Offline
    Jibims
    wrote on last edited by
    #1

    Hey,

    I've got a segmentation during the QApplication.exec() call, the seg fault doesn't occurs every time i launch the program bur more ling 6 times on 10. Do you know what could cause it ?

    Here is a backtrace from GDB:
    Thread 1 "client" received signal SIGSEGV, Segmentation fault.
    0x00007ffff61fcd56 in QMetaObject::activate(QObject*, int, int, void**) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    (gdb) bt full
    #0 0x00007ffff61fcd56 in QMetaObject::activate(QObject*, int, int, void**) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    No symbol table info available.
    #1 0x00007ffff7669b07 in QWidgetLineControl::processKeyEvent(QKeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #2 0x00007ffff75d9daa in QLineEdit::keyPressEvent(QKeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #3 0x00007ffff74e9db4 in QWidget::event(QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #4 0x00007ffff75df6f5 in QLineEdit::event(QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #5 0x00007ffff74a452c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #6 0x00007ffff74ab029 in QApplication::notify(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #7 0x00007ffff61d5ae0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    No symbol table info available.
    #8 0x00007ffff750752b in ?? () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #9 0x00007ffff74a452c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #10 0x00007ffff74ab220 in QApplication::notify(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
    No symbol table info available.
    #11 0x00007ffff61d5ae0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    No symbol table info available.
    #12 0x00007ffff6775a58 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5
    No symbol table info available.
    #13 0x00007ffff677a725 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5
    No symbol table info available.
    #14 0x00007ffff675be73 in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5
    No symbol table info available.
    #15 0x00007fffec943080 in ?? () from /home/benjamin/Qt5.7.0/5.7/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5
    No symbol table info available.
    #16 0x00007ffff1db4197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
    No symbol table info available.
    #17 0x00007ffff1db43f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
    No symbol table info available.
    #18 0x00007ffff1db449c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
    No symbol table info available.
    #19 0x00007ffff6223047 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    No symbol table info available.
    #20 0x00007ffff61d3dca in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    No symbol table info available.
    #21 0x00007ffff61dbbad in QCoreApplication::exec() () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
    No symbol table info available.
    #22 0x0000000000408e92 in main (argc=2, argv=0x7fffffffe3b8) at /home/benjamin/CLionProjects/Group4/code/client/ClientLauncher.cpp:37
    application = <incomplete type>
    app = {_vptr.App = 0x64f628 <vtable for App+16>, server_ip_address = 0x7fffffffe765 "127.0.0.1", player_id = 11, username = "b", current_manager = 0xa1f290}
    app = {_vptr.App = 0x64f628 <vtable for App+16>, server_ip_address = 0x7fffffffe765 "127.0.0.1", player_id = 11, username = "b", current_manager = 0xa1f290}

    JKSHJ 1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi, welcome to the forum.

      signal SIGSEGV, Segmentation fault.

      ClientLauncher.cpp:37

      Somewhere in line 37 bad things happen. Maybe you want to show us some code? :)

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jibims
        wrote on last edited by
        #3

        I can't post all the source code but line 37 is simply : return application.exec();

        J 1 Reply Last reply
        0
        • J Jibims

          I can't post all the source code but line 37 is simply : return application.exec();

          J Offline
          J Offline
          Jibims
          wrote on last edited by Jibims
          #4

          application is a QApplication ;)

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Without code, no-one but you can find out.

            1 Reply Last reply
            0
            • J Jibims

              Hey,

              I've got a segmentation during the QApplication.exec() call, the seg fault doesn't occurs every time i launch the program bur more ling 6 times on 10. Do you know what could cause it ?

              Here is a backtrace from GDB:
              Thread 1 "client" received signal SIGSEGV, Segmentation fault.
              0x00007ffff61fcd56 in QMetaObject::activate(QObject*, int, int, void**) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              (gdb) bt full
              #0 0x00007ffff61fcd56 in QMetaObject::activate(QObject*, int, int, void**) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              No symbol table info available.
              #1 0x00007ffff7669b07 in QWidgetLineControl::processKeyEvent(QKeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #2 0x00007ffff75d9daa in QLineEdit::keyPressEvent(QKeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #3 0x00007ffff74e9db4 in QWidget::event(QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #4 0x00007ffff75df6f5 in QLineEdit::event(QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #5 0x00007ffff74a452c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #6 0x00007ffff74ab029 in QApplication::notify(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #7 0x00007ffff61d5ae0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              No symbol table info available.
              #8 0x00007ffff750752b in ?? () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #9 0x00007ffff74a452c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #10 0x00007ffff74ab220 in QApplication::notify(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              No symbol table info available.
              #11 0x00007ffff61d5ae0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              No symbol table info available.
              #12 0x00007ffff6775a58 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5
              No symbol table info available.
              #13 0x00007ffff677a725 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5
              No symbol table info available.
              #14 0x00007ffff675be73 in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5
              No symbol table info available.
              #15 0x00007fffec943080 in ?? () from /home/benjamin/Qt5.7.0/5.7/gcc_64/plugins/platforms/../../lib/libQt5XcbQpa.so.5
              No symbol table info available.
              #16 0x00007ffff1db4197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
              No symbol table info available.
              #17 0x00007ffff1db43f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
              No symbol table info available.
              #18 0x00007ffff1db449c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
              No symbol table info available.
              #19 0x00007ffff6223047 in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              No symbol table info available.
              #20 0x00007ffff61d3dca in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              No symbol table info available.
              #21 0x00007ffff61dbbad in QCoreApplication::exec() () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5
              No symbol table info available.
              #22 0x0000000000408e92 in main (argc=2, argv=0x7fffffffe3b8) at /home/benjamin/CLionProjects/Group4/code/client/ClientLauncher.cpp:37
              application = <incomplete type>
              app = {_vptr.App = 0x64f628 <vtable for App+16>, server_ip_address = 0x7fffffffe765 "127.0.0.1", player_id = 11, username = "b", current_manager = 0xa1f290}
              app = {_vptr.App = 0x64f628 <vtable for App+16>, server_ip_address = 0x7fffffffe765 "127.0.0.1", player_id = 11, username = "b", current_manager = 0xa1f290}

              JKSHJ Online
              JKSHJ Online
              JKSH
              Moderators
              wrote on last edited by
              #6

              @Jibims said in Segmentation fault during QApplication.exec():

              #1 0x00007ffff7669b07 in QWidgetLineControl::processKeyEvent(QKeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5
              #2 0x00007ffff75d9daa in QLineEdit::keyPressEvent(QKeyEvent*) () from /home/benjamin/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5

              I don't know what's causing the crash, but these lines look interesting. Are you pressing any keys during application startup? Does it still crash if you refrain from pressing any keys?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • J Offline
                J Offline
                Jibims
                wrote on last edited by
                #7

                Yep, there is no seg fault if i don't press any key

                JKSHJ 1 Reply Last reply
                0
                • J Jibims

                  Yep, there is no seg fault if i don't press any key

                  JKSHJ Online
                  JKSHJ Online
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  @Jibims said in Segmentation fault during QApplication.exec():

                  Yep, there is no seg fault if i don't press any key

                  So back in Qt 5.4, does it crash if you press keys at startup?

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  J 1 Reply Last reply
                  0
                  • JKSHJ JKSH

                    @Jibims said in Segmentation fault during QApplication.exec():

                    Yep, there is no seg fault if i don't press any key

                    So back in Qt 5.4, does it crash if you press keys at startup?

                    J Offline
                    J Offline
                    Jibims
                    wrote on last edited by
                    #9

                    @JKSH Dunno, i have to use Qt 5.7 :/

                    JKSHJ 1 Reply Last reply
                    0
                    • J Jibims

                      @JKSH Dunno, i have to use Qt 5.7 :/

                      JKSHJ Online
                      JKSHJ Online
                      JKSH
                      Moderators
                      wrote on last edited by
                      #10

                      @Jibims said in Segmentation fault during QApplication.exec():

                      @JKSH Dunno, i have to use Qt 5.7 :/

                      Sorry, I got mixed up between your issue and someone else (they got crashes after upgrading from Qt 5.4).

                      Anyway,

                      1. Is it a particular key that causes the crash? Or does it crash no matter what key you're pressing at startup?
                      2. At startup, if you wait for 5 seconds before you press the key(s), does it still crash?

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Hi,

                        Even if you have to use 5.7, it's a good idea to test against an older version to help determine whether that behaviour is new to 5.7.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        • Login

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