Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
5.4.1
-
None
-
* Windows 7 x64
* Qt 5.4.1
* MinGW 4.9.1 32bits
Description
When calling Menu.popup() in QML, the process crash with SIGFPE.
The issue comes from QtQuickMenu::popup() in qquickmenu.cpp:377 :
if (mousePos.x() == int(qInf())) {
The integer cast effectively emits the SIGFPE.
This does not happens in standard cases. However, if for any reason the floating point unit control word has been changed previously the process may crash.
I successfully prevented the crash by reseting the floating point control word to its original value just before calling Menu.popup(). Here is the function I used, if anyone want to test:
void setFpu(unsigned short fpu) { unsigned short var = fpu; asm("fldcw -2(%ebp)"); }
A quick fix could be to replace the comparison by:
mousePos.x() == std::numeric_limits<int>::min()
Attachments
Issue Links
- relates to
-
QTBUG-69167 Floating point exception in QPointF::toPoint() with qInf()s
- Closed
-
QTBUG-52472 Undefined Behaviour in qsimpledrag.cpp line 207
- Closed
-
QTBUG-61783 SwipeDelegate left and right components not reacting on touchscreen press
- Closed
For Gerrit Dashboard: QTBUG-45045 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
393144,2 | Stop using QGuiApplicationPrivate::lastCursorPosition.toPoint() | dev | qt/qtdeclarative | Status: MERGED | -1 | 0 |
393209,9 | Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to use | dev | qt/qtbase | Status: MERGED | +2 | 0 |
394092,2 | Stop using QGuiApplicationPrivate::lastCursorPosition.toPoint() | 6.3 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
394093,2 | Stop using QGuiApplicationPrivate::lastCursorPosition.toPoint() | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
397257,2 | Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to use | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
397259,2 | Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to use | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
397260,2 | Make QGuiApplicationPrivate::lastCursorPosition.toPoint() safe to use | 6.2.4 | qt/qtbase | Status: MERGED | +2 | 0 |