On Tue, 17 Apr 2001 12:18:12 +0800, you wrote:
"Alexandre Julliard" julliard@winehq.com wrote:
Commenting lines 36-37 physDev->pen.width = GDI_ROUND((FLOAT)pen->logpen.lopnWidth.x * dc->xformWorld2Vport.eM11 * 0.5); in X11DRV_PEN_SelectObject (graphics/x11drv/pen.c) cures the problem.
Why call to floor() leads to crash?
Exception c000008f is EXCEPTION_FLT_INEXACT_RESULT. Probably one of the floating point values is invalid, or something similar.
On the other hand this exception is normally masked, even something as simple as a division of 1.0 by 3.0 can generate it because the result cannot be represented exactly. Also the round-to-int instruction that has just happened here can cause it. So the question would be, why it is not masked?
Exception occurs when pen->logpen.lopnWidth.x = 0 and dc->xformWorld2Vport.eM11 = 0.0 It's very strange. Attached patch helps to eliminate crash. But I don't understand where the source of problem.
| 0x40897fde (X11DRV_PEN_SelectObject+0x8e [pen.c:69]): fldcw 0xfffffffe(%edx)
This instruction loads the control status word with a new value. Bit 5 of the CW (0x20) ,PM Precision Mask , is the mask bit for this exception.
Find out how this bit has become zero (disassembly of the instructions before the crash). If I put a breakpoint on the instruction above, the CW is loaded with 0x37f: all FP exceptions are off.
Rein.