Open jobukkit opened 4 years ago
Anything that causes a crash is an immediate top priority, so I'll look into this as soon as I'm able, likely this weekend. Quick follow-up question: is there any specific software that triggers this issue more than other software?
Anything that causes a crash is an immediate top priority, so I'll look into this as soon as I'm able, likely this weekend. Quick follow-up question: is there any specific software that triggers this issue more than other software?
I mainly tried to play the game Klax, so that could be a good starting point.
Okay, so per the symptoms there's pretty clearly an out-of-bounds memory access here, that sometimes intrudes upon the CPC's state and sometimes gets caught by the OS. I was able to see it do the former, but annoyingly no actual crashes and no misbehaviour in a debug build. So no obvious way to get the tools just to give me the answer yet.
The crash reports all agree on the issue being at https://github.com/TomHarte/CLK/blob/ddae086661821acfe8ad642fa744dacb96bb7a8e/Machines/AmstradCPC/AmstradCPC.cpp#L227 which given that the machine has been running successfully previously, probably implies something in an inlined copy of output_border, though nothing yet jumps out.
But I'll dig in further.
Putting the crash issue aside for a moment and concentrating on Klax, I made something of a shocking discovery: the version I'm having issues with has actually never worked properly in the emulator, going back to the beginning of Amstrad CPC support a couple of years ago. So I definitely need to dig in there. It wasn't amongst my testing set; the weakest part of my CPC is definitely the 8272 so I'd probably count a loading error as the first possibility, but we'll see.
On the crashing thing, I think I finally figured that out. I'll be putting out a new release shortly; it's building now. Of course it's not impossible that it would also fix Klax, since the issue was an illegal memory access that would produce undefined behaviour, but I'd rate it as unlikely so I'm going to keep this ticket open but narrow the title.
Update to the above: I still think the crashing is resolved, but something else goes amiss sometimes to corrupt certain regions CPC memory. Whether that dumps you back to the command line or not depends on the software — I'm looking into it again.
I was able to play Chase HQ all the way through without encountering any problems.
Playing Fantasy World Dizzy all the way through I noticed that usually, sometime not too long after I start playing, some of Dizzy's frames of animation are slightly corrupted. Usually it's a frame of his leftward roll, but on one occasion it extended to one frame of his leftward walk.
Sorry, I'm actually being pretty useless at this as it turns out. An image and tiny video of the moment of a Klax crash is attached. I notice that what's sprayed across the screen looks like original graphic data so it's unlikely that the problem here is a memory buffer error from another component or anything like that.
When I try to run Amstrad CPC software I get randomly thrown back to the BASIC 1.1 screen or (less commonly) CLK crashes altogether. Three crash logs: