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. SIGSEGV: CoreApplicationPrivate29sendThroughObjectEventFilters using std::exit(0)
Forum Update on Monday, May 27th 2025

SIGSEGV: CoreApplicationPrivate29sendThroughObjectEventFilters using std::exit(0)

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 923 Views
  • 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.
  • F Offline
    F Offline
    franku
    wrote on 12 Apr 2013, 18:26 last edited by
    #1

    Hi all, I am trying to fix a problem in my QApplication which has to do something with the std::exit() function. The application is built an run on a openSuse Linux 12.1 with Qt 4.8.2 installed.

    The application looks similar like this:

    @
    int main(int argc, char* argv[])
    {
    atexit(cleanup); //external library code uses std::exit()

    QApplication app(argc, argv);
    app.setQuitOnLastWindowClosed(false);

    MainWindow* win = MainWindowSingleton::instance();
    win->show();
    libraryCode->doSomething();

    //simulate a "library-exit"
    bool test = true;
    if(test)
    std::exit(0); //SIGSEGV

    return 0;
    }

    void cleanup()
    {
    MainWindowSingleton::destroy();
    }
    @

    I cannot send all the code but the above shows mostly the layout of my program. It is linked against a larger library that uses the std::exit() function if any error occurs. But instead of exiting cleanly my application now raises a segmentation fault in this Qt Method: CoreApplicationPrivate29sendThroughObjectEventFiltersEP7QObject.

    There is a singleton for my MainWindow that gets destroyed in the cleanup handler. When the application exits normally (bool test = false) then I have no problem. It only segfaults when running through the exit() handlers. Did many debugging attempts but with no effort.

    I'd really have to be prepared for the std::exit() since the library has no alternative. Has someone experience when mixing the std:exit() with Qt code?

    This, Jen, is the internet.

    1 Reply Last reply
    0

    1/1

    12 Apr 2013, 18:26

    • Login

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