01 March 2022, 18:50 | #1 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
EVALEXCEPTION c0000005!
I'm getting this semi-randomly, but frequently, when I'm calling the motorola ffp library fpa code.
I don't know what to do apart from uploading the dmp and log files here. I don't know how to debug code that causes the emulator to crash. |
01 March 2022, 19:13 | #2 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
|
Try without JIT and/or try the 32-bit version of WinUAE. Code that crashes the Amiga can crash WinUAE as well in JIT mode in pathological cases (e.g. when it happens in supervisor mode). 32-bit versions seems to at least in some cases handle it better. Without JIT it shouldn't crash and you'll probably see it in some kind of HALT state.
|
01 March 2022, 19:14 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Exe is not official winuae.exe which makes dump file useless.
Does it happen without JIT? |
01 March 2022, 19:25 | #4 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,216
|
This is a division by zero exception, which happens if you, err, divide by zero. The later versions of mathffp does not create this exception anymore, but return the largest possible value. Note that IEEE math never returns exceptions, it just returns INF in this case. Unfortunately, the mathFFP model does not define INFs.
FFP should really not be used anymore. It is, as far as numerics are concerned, a pretty bad format and not very robust. |
01 March 2022, 19:36 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
No, lets not confuse PC and Amiga exceptions.
Cause is read from 0xFFFFFFFFFFFFFFFF, seems to be caused by CPU jumping to that address. Which usually means JIT is getting confused, possibly caused by stack overrun. |
01 March 2022, 19:47 | #6 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
I will try and get my code out to run it in a more approved environment, and following the advice from paraj above, but as the code that seems to be triggering the problem is part of my logging/debugging to the VS Code integration I don't know whether the bug will be reproducible, as it's semi-random as it is. |
|
02 March 2022, 12:23 | #7 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
I now have a clean install of WinUAE 4.9.1 and have created an A500 configuration, adding a directory backed hard drive (so I can copy my executable over) and enabling the log file. And I can see my logging appearing in the log file too, which is nice.
But I don't understand how to disable the JIT. All those options under CPU are greyed out for me. |
02 March 2022, 18:28 | #8 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
|
Quote:
I don't know how you output the debug information, but if it isn't compatible you probably want to NOP out the fewest possible instructions (i.e. if it involves some detection code, skip that and just don't do the final "debug output" call). |
|
02 March 2022, 19:20 | #9 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
I can reproduce the crash, but its frequency seems to depend on things outside of my view, even back in the environment where it was crashing often. This morning it was crashing within seconds, after leaving the house for a couple of hours the code suddenly became almost stable. All with no code changes. I do have one very questionable bit of code that I'm looking into rewriting (pushing my assembly skills though), to do with copying the results that the fpa function returns on the stack into a permanent location. I think (know, or suspect, depending on my frame of mind) that this whole returning things on the stack just won't work in supervisor mode, which my code is running in, for better or worse, or if I use this function from within an interrupt, is the same, same thing. But, if I'm not using an experimental JIT mode, and I can write code that crashes the emulator, then I'd love to help find the information needed to fix it. Or, conversely, I'd love to find a way to make code running on my real Amigas exit to a fill Windows 10 desktop. |
|
02 March 2022, 19:36 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Do you mean your config is plain 68000?
Then make sure "more compatible" is ticked because otherwise memory accesses are "more direct" and bad accesses are not always detected (prefers speed than accuracy) Does this "fix" the crash? (and now emulated Amiga most likely crashes) Do you see "program did something stupid" or other log messages before the crash? (keep log window open by running winuae with -log command line parameter) |
02 March 2022, 20:01 | #11 | |||
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
I've tried not to fiddle.
Quote:
Quote:
Quote:
Are programs not allowed to do stupid things? |
|||
03 March 2022, 07:21 | #12 |
Registered User
Join Date: Nov 2015
Location: Italy
Posts: 191
|
|
03 March 2022, 08:11 | #13 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
|
03 March 2022, 09:34 | #14 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
03 March 2022, 09:46 | #15 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
I have multiple options to fix this. Yesterday I tried to go all in and fix the assembly code to write the return value into a buffer pointed to by A0 rather than on the stack, which would be the nicest solution. That code currently doesn't work, but I will try again before giving up and going for one of my other options. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|