Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
Description
Clicking on this widget crashes:
#include <QtGui>
class MyWidget : public QWidget
{
public:
MyWidget()
{ }
protected:
void mousePressEvent(QMouseEvent *event)
};
int main(int argc, char **argv)
{
QApplication a(argc, argv);
MyWidget stackOverflow;
stackOverflow.show();
return a.exec();
}
The reason is obvious when getting a decent stack trace:
MyWidget::mousePressEvent(QMouseEvent * 0x0012c560
{type="MouseButtonPress"}) line 14MyWidget::mousePressEvent(QMouseEvent * 0x0012c560 {type="MouseButtonPress"}
) line 14
MyWidget::mousePressEvent(QMouseEvent * 0x0012c560
MyWidget::mousePressEvent(QMouseEvent * 0x0012c560 {type="MouseButtonPress"}
) line 14
MyWidget::mousePressEvent(QMouseEvent * 0x0012c560
) line 14
[...]
but due the exception handling in QEventLoop::exec, the stack trace is instead
$$$00001() line 79
QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag>
) line 166 + 10 bytes
QCoreApplication::exec() line 727 + 21 bytes
QApplication::exec() line 3031
main(int 1, char * * 0x009e62c0) line 22 + 6 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f09, int 1) line 95 + 18 bytes
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c816fd7()
The only thing that points the the stack overflow is the debugger pane saying:
First-chance exception in sandbox43.exe: 0xC00000FD: Stack Overflow.
First-chance exception in sandbox43.exe (QTCORED4.DLL): 0xC0000005: Access Violation.
It's hard to know where the stack overflow occurs though. Maybe a debug build of Qt should not use the try/catch.