March 14, 2012

drhalftone drhalftone
Lab Rat
23 posts

QDialog::exec() crash…

 

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 0×7fff8d0d3551
1 -[NSMenu _addSidebandMenuUpdaterForRoles:token:priority:handler:] 0 0×7fff8d0d342f
2 -[NSApplication setMainMenu:] 0 0×7fff8d0d2d3e
3 QMenuBarPrivate::macUpdateMenuBarImmediatly 0 0×100fd612c
4 -[NSObject performSelector:] 0 0×7fff95ba7021
5 -[NSApplication(QApplicationIntegration) qt_sendPostedMessage:] 0 0×100fa2994
6 -[NSApplication(QApplicationIntegration) qt_filterEvent:] 0 0×100fa2789
7 -[QNSApplication sendEvent:] 0 0×100fa282b
8 -[NSApplication _realDoModalLoop:peek:] 0 0×7fff8d3733ff
9 -[NSApplication runModalSession:] 0 0×7fff8d36cbb4
10 QEventDispatcherMac::processEvents 0 0×100fab9bf
11 QEventLoop::exec 0 0×100c42b18
12 QDialog::exec 0 0×101443093
13 SKAdaptiveThresholdWidget::processImage skadaptivethresholdwidget.cpp 320 0×10009124b
14 SKAdaptiveThresholdWidget::on_okButton_clicked skadaptivethresholdwidget.cpp 88 0×10009141f
15 SKAdaptiveThresholdWidget::qt_static_metacall moc_skadaptivethresholdwidget.cpp 70 0×100109c56
16 SKAdaptiveThresholdWidget::qt_metacall moc_skadaptivethresholdwidget.cpp 119 0×100109dc3
17 QMetaObject::activate 0 0×100c5aad5
18 QAbstractButton::clicked 0 0×1015e4325
19 QAbstractButtonPrivate::emitClicked 0 0×10135243e
20 QAbstractButtonPrivate::click 0 0×10135315a
… <More>

The SK… class is my QDialog subclass.

8 replies

March 14, 2012

drhalftone drhalftone
Lab Rat
23 posts

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)

March 18, 2012

bruno_pages bruno_pages
Lab Rat
4 posts

Hi,

I have a similar problem occurring randomly when I close dialog (Qt 4.7.4 or Qt 4.8.0 under MacOS X Lion) :

  1. 0 QAction::isVisible  0 0x1014b1474
  2. 1 QMenuBarPrivate::macUpdateMenuBarImmediatly  0 0x10149c6f4
  3. 2 -[NSObject performSelector:]  0 0x7fff8aebe021
  4. 3 -[NSApplication(QApplicationIntegration) qt_sendPostedMessage:]  0 0x101468ad5
  5. 4 -[NSApplication(QApplicationIntegration) qt_filterEvent:]  0 0x101468890
  6. 5 -[QNSApplication sendEvent:]  0 0x10146894d
  7. 6 -[NSApplication run]  0 0x7fff898c21f2
  8. 7 QEventDispatcherMac::processEvents  0 0x101473750
  9. 8 QEventLoop::processEvents  0 0x1023d5664
  10. 9 QEventLoop::exec  0 0x1023d5a14
  11. 10 QCoreApplication::exec  0 0x1023d890c
  12. 11 main main.cpp 206 0x1009d38f8

and there is the same (one year old !) here : http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg167652.html [mail-archive.com]

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 ?

March 18, 2012

drhalftone drhalftone
Lab Rat
23 posts

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?

March 19, 2012

Volker Volker
Robot Herder
5428 posts
drhalftone wrote:
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?

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.

March 19, 2012

bruno_pages bruno_pages
Lab Rat
4 posts

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 …

Thanks

March 20, 2012

drhalftone drhalftone
Lab Rat
23 posts

Just posted the bug, its issue Qt QTBUG-24866, please follow up with your own experiences…

March 21, 2012

bruno_pages bruno_pages
Lab Rat
4 posts

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 [bugreports.qt-project.org] giving a very small application I made to allow them to reproduce the crash.

March 23, 2012

bruno_pages bruno_pages
Lab Rat
4 posts

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)

 
  ‹‹ Problem in masking the widget?[solved]      XK_question generates asterisk key ››

You must log in to post a reply. Not a member yet? Register here!