I'm writing an application that creates a QDialog subclass that includes an OpenGL display, and it crashes at the exec() command. Here is the stack trace:
0 -[NSMenu _sidebandUpdaterRoles] 0 0x7fff8d0d3551
1 -[NSMenu _addSidebandMenuUpdaterForRoles:token:priority:handler:] 0 0x7fff8d0d342f
2 -[NSApplication setMainMenu:] 0 0x7fff8d0d2d3e
3 QMenuBarPrivate::macUpdateMenuBarImmediatly 0 0x100fd612c
4 -[NSObject performSelector:] 0 0x7fff95ba7021
5 -[NSApplication(QApplicationIntegration) qt_sendPostedMessage:] 0 0x100fa2994
6 -[NSApplication(QApplicationIntegration) qt_filterEvent:] 0 0x100fa2789
7 -[QNSApplication sendEvent:] 0 0x100fa282b
8 -[NSApplication _realDoModalLoop:peek:] 0 0x7fff8d3733ff
9 -[NSApplication runModalSession:] 0 0x7fff8d36cbb4
10 QEventDispatcherMac::processEvents 0 0x100fab9bf
11 QEventLoop::exec 0 0x100c42b18
12 QDialog::exec 0 0x101443093
13 SKAdaptiveThresholdWidget::processImage skadaptivethresholdwidget.cpp 320 0x10009124b
14 SKAdaptiveThresholdWidget::on_okButton_clicked skadaptivethresholdwidget.cpp 88 0x10009141f
15 SKAdaptiveThresholdWidget::qt_static_metacall moc_skadaptivethresholdwidget.cpp 70 0x100109c56
16 SKAdaptiveThresholdWidget::qt_metacall moc_skadaptivethresholdwidget.cpp 119 0x100109dc3
17 QMetaObject::activate 0 0x100c5aad5
18 QAbstractButton::clicked 0 0x1015e4325
19 QAbstractButtonPrivate::emitClicked 0 0x10135243e
20 QAbstractButtonPrivate::click 0 0x10135315a
The SK... class is my QDialog subclass.
I should add that this code was tested on Windows 7 without any problems related to this particular crash. So for now, let me say it seems to be restricted to Mac OS X (10.7.3)
I have a similar problem occurring randomly when I close dialog (Qt 4.7.4 or Qt 4.8.0 under MacOS X Lion) :
@0 QAction::isVisible 0 0x1014b1474
1 QMenuBarPrivate::macUpdateMenuBarImmediatly 0 0x10149c6f4
2 -[NSObject performSelector:] 0 0x7fff8aebe021
3 -[NSApplication(QApplicationIntegration) qt_sendPostedMessage:] 0 0x101468ad5
4 -[NSApplication(QApplicationIntegration) qt_filterEvent:] 0 0x101468890
5 -[QNSApplication sendEvent:] 0 0x10146894d
6 -[NSApplication run] 0 0x7fff898c21f2
7 QEventDispatcherMac::processEvents 0 0x101473750
8 QEventLoop::processEvents 0 0x1023d5664
9 QEventLoop::exec 0 0x1023d5a14
10 QCoreApplication::exec 0 0x1023d890c
11 main main.cpp 206 0x1009d38f8
and there is the same (one year old !) here : "http://firstname.lastname@example.org/msg167652.html":http://email@example.com/msg167652.html
I don't have this problem during the execution under several Linux nor Windows, but macUpdateMenuBarImmediatly is certainly associated to the mac and the management of the global menus ;-)
is someone find a way to fix/bypass this crash ?
I switched back to compiling with the 4.7.4 libraries and have not had a crash yet. Seems like this should be elevated to bug status. Any idea how to do that?
[quote author="drhalftone" date="1332108250"]I switched back to compiling with the 4.7.4 libraries and have not had a crash yet. Seems like this should be elevated to bug status. Any idea how to do that?[/quote]
Just go to the public bugtracker at https://bugreports.qt-project.org - you can create an account over there easily. Don't forget to report back the issue ID here, please, so that others can track its status too. Thanks.
As I said unfortunately I have exactly the same problem with Qt4.7.4 and 4.8.0 (MacOS 10.7.3 as you), I will try to reproduce the problem with a small program and post it in the bug tracker.
Let's note I also had random crashes associated to the presence of a toolbar in the GUI, even without using it, the day I removed it I stopped to have problem (both again QT4.7.4 and Qt4.8.0, but under Windows, I have my mac since only Saturday).
I didn't have all these problems with Qt2.3 / 3.X I used since 8 years ...
Just posted the bug, its issue Qt QTBUG-24866, please follow up with your own experiences...
I don't know for you but in my case the crash is visibly linked to the use of 'computed' menus ( through aboutToShow) even the crash occurs later (not when the menu is shown / hidden). I also created an "issue":https://bugreports.qt-project.org/browse/QTBUG-24917 giving a very small application I made to allow them to reproduce the crash.
to bypass the problem just call QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar) at the beginning of your program allowing to not use native menubar (e.g, the menubar at the top of the main screen on Mac OS X)