[Development] QTBUG-48709: calling ::exit() may crash

Giulio Camuffo giuliocamuffo at gmail.com
Wed Oct 21 08:42:03 CEST 2015


2015-10-21 4:15 GMT+03:00 Robert Griebl <robert.griebl at pelagicore.com>:
> On 20.10.2015 17:56, Thiago Macieira wrote:
>> ...because the application will unload the libraries while other threads are
>> still running code from those threads. In the bug report, the crash happens
>> because of the QXcbEventReader thread, but it could have been any other thread
>> we start or any other library starts.
>>
>> Can anyone think of a solution to this problem?
>
> We had the exact some problem with Wayland a few weeks ago, where
> QtWayland would call ::exit() if it encounters an error: the process
> would then crash while trying to cleanup a sqlite database. Because
> there's no normal QApplication shutdown, no qAddPostRoutine() cleanup
> takes place and the databases are still active when the sqlite plugins
> get unloaded.

That's also what the xcb plugin does when the X server dies, so it's a
quite common issue.

>
> You only really have 2 possibilities here:
>
>   1) if you really must exit *now*, do it the ugly way: call _Exit()
>
>   2) if you can return to the event-loop one more time, call qApp->exit()

The problem with qApp->exit(), at least on wayland, is that quite
often the app doesn't really quit, but waits forever for threads to
stop, so it's not an option.


--
Giulio

>
>
> --
> Robert Griebl
> SENIOR SOFTWARE ENGINEER
>
> Pelagicore AG
> Balanstr. 55, 81541 Munich, Germany
> robert.griebl at pelagicore.com
> www.pelagicore.com
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list