Sunfish dies on 06/04 ROM
Frederick Bambrough (1372) 817 posts |
Crashes on startup Internal error: abort on data transfer at &FFAFF33AC. BB -xM. Postmortem 51d68 in function _ZN6ibicon5mountEPKc 2f2f0 in function _ZN7sunfish9getmountsEv 2fe34 in function _ZN7sunfishC1Ev fc179ffc in unknown procedure 30250 in function main fc179ffc in unknown procedure Arg2: 0x000081e8 33256 -> [0xe1a0c00d 0xe92dd80f 0xe24cb004 0xebffffa3] Arg1: 0x000fb660 1029728 -> [0x6e75533c 0x68736966 0x72694424 0x52212e3e] fc14bb98 in shared library function 81d8 in function ____init |
Steve Pampling (1551) 7931 posts |
What was the last known good setup? |
Frederick Bambrough (1372) 817 posts |
30th March 2016. Reverted back to this date & it’s working again. |
Steve Pampling (1551) 7931 posts |
My thought is download the ROM and Zeropain package tomorrow, try again and see what you get. |
Jeffrey Lee (213) 6046 posts |
Looks like Sunfish has fallen victim to the error pointer sanity checks that I added to the kernel. Specifically there’s this routine in the Sunfish module which tries to trigger callbacks: |trigger_callback| STMFD sp!,{lr} TEQ a1, a1 ; Set Z TEQ pc, pc ; EQ if 32-bit mode TEQNEP pc, #0 MRSEQ a1, CPSR ; Acts a NOP for TEQP BICEQ a1, a1, #&f ; Preserve 32bit mode bit MSREQ CPSR_c, a1 MOV a1, a1 ; Avoid StrongARM MSR bug SWI XOS_GenerateError ; Force callback SWI XOS_EnterOS ; Back from whence we came LDMFD sp!, {pc} On exit from OS_GenerateError, the V flag will be set, and the kernel tries to check the error pointer. But the error pointer isn’t an error pointer at all, it’s the PSR, so it ends up trying to read from &60000110 and promptly crashes. This could be fixed by changing the kernel to not try reading from the error pointer, but that would kind of defeat the purpose of the code. Instead of crashing in the kernel, where useful crash logs can be collected (the annotation hasn’t picked it up, but R12 is the SWI number and the top word of the SVC stack is the return address of the SWI call), if the error pointer is truly bad you’d end up crashing somewhere else and have no idea what code is the culprit. Another fix could be to make the kernel avoid checking XOS_GenerateError (we know the error pointer won’t have originated from OS_GenerateError, and the X flag means the error will never be acted on, so the SWI is essentially a no-op as far as errors are concerned). I’ll probably go with that approach, since I can assume there’ll be at least a few other programs which are abusing XOS_GenerateError like that. |
Chris Hall (132) 3502 posts |
There’s a handy dodge to convert a zero terminated string to a BASIC string using XOS_GenerateError – this may be used a lot? |
Steve Fryatt (216) 2046 posts |
I don’t know about anyone else, but I was told off – either here or in the newsgroups – by someone involved with ROOL for not doing it. Previously all of my BASIC apps used a traditional FNzero_string() which stepped through the memory with ? until zero was found; having been told that this was suboptimal, they almost all now (ab)use XOS_GenerateError after the most recent set of updates… Oops. |
Frederick Bambrough (1372) 817 posts |
Crumbs. Always takes so long to get something fixed round here. We should double Jeffrey’s pay. 😁 |
Rick Murray (539) 13402 posts |
Where this is necessary, I prefer to loop. Suboptimal or not, it isn’t relying on a side effect. Besides, has anybody traced this in an emulator or something? Exactly how optimal is it to invoke the SWI call mechanism to essentially perform a NOP, all of this more or less being a side effect to the intended action…? [disclosure: if I need to do this a lot, I write it in assembler, not BASIC ;-)] |
Ron (2686) 63 posts |
Has there been any update on the Sunfish issue? I’ve downloaded the source but there’s a lot of unfamiliar stuff in there…rtk & python. The Sunfish front-end is repeatedly crashing with an abort on Instruction fetch at &00000004 It is also unhappy & crashes if one of your NFS drives is failing and it can’t connect. It is also unhappy with this with a low vector build. I think the module appears to run OK and is stable. |
Glen Walker (2585) 469 posts |
I am also interested in Sunfish (and Moonfish) so it would be great to know if Alex is still interested in this program… Or if not…maybe someone else can look at releasing an update? |