[Qt-interest] SIGSEGV When Closing Child Top-Level Window

Josiah Bryan jbryan at productiveconcepts.com
Thu Nov 19 20:50:56 CET 2009


Odd problem when closing a child top-level QMainWindow (e.g. a secondary 
mainwindow opened from a first main winodw). (This is with the Qt 4.6 RC 
1 - however, it also happens with previous versions of Qt as well - 
stack trace is the same, but source paths are, of course, different.)

Steps are:

(A) MainWindow opens (B) SongEditorWindow opens (C) SlideEditorWindow.

Closing (C) is fine. However, when closing (B) after closing (C), 
program segfaults with following stack trace. Odd thing is, it never 
touches my code - its all in the event loop and QApplication. I've tried 
all sorts of things - changing the destructor, not deleting (C) when 
closed, calling deleteLater() on (C) when closed, etc. Nothing changes 
the stacktrace when it crashes when (B) is closed.

HOWEVER - If I don't ever open (C), but just go (A)->(B), then close (B) 
(without opening (C)) - it never crashes.


But I can't find what in my code is causing the crash, since the 
stacktrace doesn't even *hint* at whats wrong.

I checked the pointer that line #1 (below - the argument 
(act=0xbff00a3c)) - and that is NOT the pointer to (B) or (C) (B ptr = 
SongEditorWindow(0xd801270), C ptr = SlideEditorWindow(0xd9218f8)).

Any ideas, anyone? Thanks!

-josiah



Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208432912 (LWP 26616)]
0x00000010 in ?? ()
(gdb) bt
#0  0x00000010 in ?? ()
#1  0x00d383b8 in QApplication::x11ProcessEvent (this=0xbfeab25c, 
event=0xbfeaaed8) at 
/var/tmp/qt-x11-src-4.6.0/src/gui/kernel/qapplication_x11.cpp:3420
#2  0x00d64754 in x11EventSourceDispatch (s=0xa968ba8, callback=0, 
user_data=0x0) at 
/var/tmp/qt-x11-src-4.6.0/src/gui/kernel/qguieventdispatcher_glib.cpp:146
#3  0x0570510c in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#4  0x0570854f in ?? () from /lib/libglib-2.0.so.0
#5  0x05708ab5 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#6  0x0059d568 in QEventDispatcherGlib::processEvents (this=0xa963c78, 
flags=@0xbfeab0d8) at 
/var/tmp/qt-x11-src-4.6.0/src/corelib/kernel/qeventdispatcher_glib.cpp:407
#7  0x00d64515 in QGuiEventDispatcherGlib::processEvents 
(this=0xa963c78, flags=@0xbfeab108) at 
/var/tmp/qt-x11-src-4.6.0/src/gui/kernel/qguieventdispatcher_glib.cpp:202
#8  0x0056eaad in QEventLoop::processEvents (this=0xbfeab180, 
flags=@0xbfeab148) at 
/var/tmp/qt-x11-src-4.6.0/src/corelib/kernel/qeventloop.cpp:149
#9  0x0056ee3d in QEventLoop::exec (this=0xbfeab180, flags=@0xbfeab188) 
at /var/tmp/qt-x11-src-4.6.0/src/corelib/kernel/qeventloop.cpp:201
#10 0x00570c6c in QCoreApplication::exec () at 
/var/tmp/qt-x11-src-4.6.0/src/corelib/kernel/qcoreapplication.cpp:981
#11 0x00ca9207 in QApplication::exec () at 
/var/tmp/qt-x11-src-4.6.0/src/gui/kernel/qapplication.cpp:3570
#12 0x08070a4a in main (argc=1, argv=0xbfeab314) at main.cpp:22
(gdb) q


-=-=-=-=-=-=-=-=-=-=-=-=-
Josiah Bryan
Productive Concepts, Inc.
jbryan at pciint.com
(765) 964-6009, ext. 224




More information about the Qt-interest-old mailing list