[Qt-interest] Segmentation faults when executing QMessageBox::warning or similar.

Davor J. DavorJ at live.com
Thu Jul 29 10:29:06 CEST 2010


The situation in which this is occurring is not all that standard I think. 
Basically, what I am doing is redirecting the qWarning() messages to a log 
and a QMessageBox::warning(...) box with qInstallMsgHandler as explained in 
the docs. Now, those messages might occur on various occasions during code 
execution, and QMessageBox::warning dialogs might get executed in all kinds 
of situations. Anyhow, in some cases the program gives a segmentation fault 
on running QMessageBox::warning(0, "Warning!", msg). More specifically it 
crashes somewhere in execution of QWidget::show() which is called on showing 
the QDialog-based warning message. Digging deeper led me to sending internal 
events by QCoreApplication::notifyInternal() and there I got lost in 
recursion...

I solved my specific crashing by delaying the warning message with 
Qt::QueuedConnection but as I do not know the cause, I do not know whether 
this is a real solution either.

So, I thought to post it here in case someone might know better what might 
be going on. I might even submit it as a bug if people think it might be 
one.

Regards,
Davor 





More information about the Qt-interest-old mailing list