View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037907 | FPC | Compiler | public | 2020-10-11 11:18 | 2020-10-25 18:10 |
Reporter | Alfred | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | won't fix | ||
Platform | Haiku | ||||
Product Version | 3.3.1 | ||||
Summary | 0037907: Building compiler on Haiku fails with FPU exception | ||||
Description | The compiler exception mask does not mask enough exceptions on Haiku. Proposed change for Haiku: Default8087CW : word = $137F; With this change, the compiler gets build with success. The included patch could be applied to trunk and fixes also. | ||||
Additional Information | See forum: https://forum.lazarus.freepascal.org/index.php/topic,50362.msg380331.html#msg380331 Please apply to fixes also. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
fpcpatch_haikufpu.patch (472 bytes)
Index: rtl/inc/mathh.inc =================================================================== --- rtl/inc/mathh.inc (revision 43466) +++ rtl/inc/mathh.inc (working copy) @@ -16,7 +16,11 @@ {$if defined(cpui8086) or defined(cpui386) or defined(cpux86_64)} const + {$ifdef Haiku} + Default8087CW : word = $137F; + {$else} Default8087CW : word = $1332; + {$endif} procedure Set8087CW(cw:word); function Get8087CW:word; |
|
It could be that the proposed mask is masking too much. To analyze, included screenshot of crash report. |
|
I cannot make anything out of the crash report. So shall we apply the patch or not? |
|
Yes, please apply the patch. Its just a blocking Haiku-quirk. Tests show no negative side-effects. |
|
Related to r46210 ? |
|
What I don't get is why it's saying "unexpected exception in kernel mode". Is the Haiku kernel not able to handle the usermode switching on certain math exceptions? If so that would be a bug in Haiku in my opinion... |
|
I did some more research. The FPU exception can be masked by setting only the "Invalid Operation Exception"-bit. Seemingly, an arithmetic instruction has encountered an invalid operand. Somewhere. Unknown. However, this is enough to get things running on Haiku: Default8087CW : word = $1333; Please apply. |
|
I'm still not sure whether this is simply solving the symptom instead of the cause. |
|
I agree with Sven, we shouldn't apply a patch which just hides bugs of the OS. |
|
As I do not know the real cause of this issue, I can offer no help in resolving. I am also definitely no Haiku expert. So, this issue might be closed. In the meantime, I will let fpcupdeluxe patch the FPC sources to mask the "Invalid Operation Exception"-bit to get a running FPC on Haiku. And will keep track of user reports. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-11 11:18 | Alfred | New Issue | |
2020-10-11 11:18 | Alfred | File Added: fpcpatch_haikufpu.patch | |
2020-10-11 11:47 | Alfred | Note Added: 0126235 | |
2020-10-11 11:47 | Alfred | File Added: HaikuException.JPG | |
2020-10-11 21:14 | Florian | Note Added: 0126245 | |
2020-10-11 21:15 | Florian | Status | new => feedback |
2020-10-11 21:15 | Florian | FPCTarget | => - |
2020-10-11 21:20 | Alfred | Note Added: 0126247 | |
2020-10-11 21:20 | Alfred | Status | feedback => new |
2020-10-11 21:41 | Marco van de Voort | Note Added: 0126248 | |
2020-10-12 11:36 | Sven Barth | Note Added: 0126253 | |
2020-10-13 12:39 | Alfred | Note Added: 0126280 | |
2020-10-14 12:56 | Sven Barth | Note Added: 0126292 | |
2020-10-15 21:25 | Florian | Note Added: 0126337 | |
2020-10-18 18:49 | Alfred | Note Added: 0126400 | |
2020-10-25 18:10 | Florian | Assigned To | => Florian |
2020-10-25 18:10 | Florian | Status | new => resolved |
2020-10-25 18:10 | Florian | Resolution | open => won't fix |