Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
4.8.0, 5.3.2
-
None
-
Tested on :
Qt4.8 / Qt5.3 and MacOSX 10.9
Qt4.8 and MacOSX 10.10
-
40c927e7331ea4ac9ca50de48560b700e657cded
Description
The application crash when enable the Floating point exception FE_INVALID exception.
Try the following (tested on Qt 4.8 & 5.3 on Mac OSX)
For commodity reason, I've copy/paste the feenableexcept() from glib
Any idea ? glib problem or Qt problem ??
Thanks,
Laurent
#include <qapplication.h> #include <qmainwindow.h> #include <qlineedit.h> #include <fenv.h> int main(int argc,char** argv) { // ------------------------------------------------------ // ENABLE FPE : Copy/Paste feenableexcept() code from glib // ------------------------------------------------------ unsigned int excepts = FE_INVALID; static fenv_t fenv; unsigned int new_excepts = excepts & FE_ALL_EXCEPT, old_excepts; // previous masks if ( fegetenv (&fenv) ) { return -1; } old_excepts = fenv.__control & FE_ALL_EXCEPT; // unmask // fenv.__control &= ~new_excepts; fenv.__mxcsr &= ~(new_excepts << 7); int result = ( fesetenv (&fenv) ? -1 : old_excepts ); // ------------------------------------------------------ // ------------------------------------------------------ // Create a minimum window // ------------------------------------------------------ QApplication application(argc, argv); QLineEdit edit; edit.show(); // Will crash at the next line if you type "O" in the lineEdit // Will also crash for other random strings ;-) qApp->exec(); return 0; }
Attachments
For Gerrit Dashboard: QTBUG-42717 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
143401,5 | XCB: prevent a fp division by zero | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |