pruten / shoebill

A Macintosh II emulator that runs A/UX
BSD 2-Clause "Simplified" License
364 stars 66 forks source link

Crash when doing /etc/fs/ufs/mkfs #1

Closed fuerst closed 10 years ago

fuerst commented 10 years ago

First: amazing work you have done with Shoebill. Running A/UX in an emulator is fascinating!

I encountered an error though when doing /etc/fs/ufs/mkfs /dev/rdsk/c1d0s0 1000000. c1d0s0 is an _Apple_UNIXSVR2 partition. Shoebill crashes during or at the end of the super-block creation. Running A/UX 3.0.0.

I'm using Shoebill compiled from sources. Latest commit was at Sat Apr 19 12:12:15 2014 -0400. Let me know if you need more information or testing.

pruten commented 10 years ago

Thanks! Can you send me more information from the crash report? When it crashes, it'll bring up a "Shoebill has quit unexpectedly" dialog. Click the "Report" button, and then copy out the text. I particularly need to know the assert string, e.g. ... Application Specific Information: Assertion failed: (!"reset called"), function inst_reset, file ../intermediates/cpu.post.c, line 1372. ...

fuerst commented 10 years ago

Sent the Crash Report by email to your gmail address. But there is no assert string.

fuerst commented 10 years ago

When running it through Xcode I still see not assert string. That's what I get at the end of the log:

...
scsi_reg_read: reading from register bus_and_status(5) (set to 0x48)

inst_fmove_control: notice: (EA = 2/0 12fff3e4 CSI = 111)
inst_fmovem: pre=000000ff mask=000000ff EA=2/0 addr=0x12fff3f0 size=96 to mem
inst_fmovem: writing 3.141593 from fp0 40 00 00 00 c9 0f da a2 21 68 c2 35
inst_fmovem: writing 0.000000 from fp1 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp2 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp3 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp4 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp5 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp6 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp7 00 00 00 00 00 00 00 00 00 00 00 00
pflush!inst_fmove_control: notice: (EA = 2/0 12fff3e4 CSI = 111)
inst_fmovem: pre=000000ff mask=000000ff EA=2/0 addr=0x12fff3f0 size=96 from mem
inst_fmovem: read 3.040000 to fp0
inst_fmovem: read 0.304000 to fp1
inst_fmovem: read 0.000000 to fp2
inst_fmovem: read 0.000000 to fp3
inst_fmovem: read 0.000000 to fp4
inst_fmovem: read 0.000000 to fp5
inst_fmovem: read 0.000000 to fp6
inst_fmovem: read 0.000000 to fp7
rte: sr=0x0000 pc=0x47f03b4c format=0x0080, post-pop a7=0x12fffffe
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Unknown instruction (0x33fe)!
Interrupt pri 1! mask=0
interrupt: pushed format 0x0064 to 0x12ffff5c
interrupt: pushed pc 0x00000020 to 0x12ffff58
interrupt: pushed sr 0x2004 to 0x12ffff56
Unknown instruction (0x33fe)!
  (repeated ~150 times)
Unknown instruction (0x33fe)!
Fired nubus interrupt 9
Interrupt pri 2! mask=0
interrupt: pushed format 0x0068 to 0x12fffa24
interrupt: pushed pc 0x00000000 to 0x12fffa20
interrupt: pushed sr 0x2004 to 0x12fffa1e
Interrupt pri 1! mask=0
interrupt: pushed format 0x0064 to 0x12fffa1c
interrupt: pushed pc 0x00000004 to 0x12fffa18
interrupt: pushed sr 0x2004 to 0x12fffa16
Unknown instruction (0x33fe)!
  (repeated ~200 times)
Unknown instruction (0x33fe)!
Fired nubus interrupt 9
Interrupt pri 2! mask=0
interrupt: pushed format 0x0068 to 0x12fff63c
interrupt: pushed pc 0x00000000 to 0x12fff638
interrupt: pushed sr 0x2004 to 0x12fff636
Interrupt pri 1! mask=0
interrupt: pushed format 0x0064 to 0x12fff634
interrupt: pushed pc 0x00000004 to 0x12fff630
interrupt: pushed sr 0x2004 to 0x12fff62e
Unknown instruction (0x33fe)!
  (repeated ~300 times)
Unknown instruction (0x33fe)!
(lldb) 
fuerst commented 10 years ago

BTW: When changing the A/UX session type from A/UX Finder (32-bit) to Console Emulator it suddenly works without crashing. The Xcode log looks like this:

...
scsi_reg_read: reading from register bus_and_status(5) (set to 0x48)

pflushr!inst_fmove_control: notice: (EA = 2/0 12fff3e4 CSI = 111)
inst_fmovem: pre=000000ff mask=000000ff EA=2/0 addr=0x12fff3f0 size=96 to mem
inst_fmovem: writing 3.040000 from fp0 40 00 00 00 c2 8f 5c 28 f5 3d 00 00
inst_fmovem: writing 0.304000 from fp1 3f fd 00 00 9b a5 e3 53 f7 64 00 00
inst_fmovem: writing 0.000000 from fp2 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp3 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp4 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp5 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp6 00 00 00 00 00 00 00 00 00 00 00 00
inst_fmovem: writing 0.000000 from fp7 00 00 00 00 00 00 00 00 00 00 00 00
pflush!inst_fmove_control: notice: (EA = 2/0 12fff3e4 CSI = 111)
inst_fmovem: pre=000000ff mask=000000ff EA=2/0 addr=0x12fff3f0 size=96 from mem
inst_fmovem: read 3.141593 to fp0
inst_fmovem: read 0.000000 to fp1
inst_fmovem: read 0.000000 to fp2
inst_fmovem: read 0.000000 to fp3
inst_fmovem: read 0.000000 to fp4
inst_fmovem: read 0.000000 to fp5
inst_fmovem: read 0.000000 to fp6
inst_fmovem: read 0.000000 to fp7
rte: sr=0x0000 pc=0x47f05ef0 format=0x0080, post-pop a7=0x12fffffe
pflush!rte: sr=0x0004 pc=0x000047e2 format=0xa008, post-pop a7=0x12ffffe6
pflush!rte: sr=0x2019 pc=0x00055678 format=0xa008, post-pop a7=0x12ffff3c
pflush!rte: sr=0x2019 pc=0x00055678 format=0xa008, post-pop a7=0x12ffff3c
rte: sr=0x0010 pc=0x47f03b66 format=0x0080, post-pop a7=0x12fffffe
pflush!rte: sr=0x0010 pc=0x47f03b76 format=0xa008, post-pop a7=0x12ffffe6
rte: sr=0x0010 pc=0x47f03bc4 format=0x0080, post-pop a7=0x12fffffe
rte: sr=0x0000 pc=0x47f03bec format=0x0080, post-pop a7=0x12fffffe
Interrupt pri 1! mask=0
Fired nubus interrupt 9
interrupt: pushed format 0x0064 to 0x12fffde6
interrupt: pushed pc 0x0005485e to 0x12fffde2
interrupt: pushed sr 0x2000 to 0x12fffde0
Interrupt pri 2! mask=0
interrupt: pushed format 0x0068 to 0x12fffdda
interrupt: pushed pc 0x100115a4 to 0x12fffdd6
interrupt: pushed sr 0x2000 to 0x12fffdd4
movem: For movem 4/7, deciding to write 0x12fffdca for a7
via_reg_read: reading from via2 reg ifr (13)
via_reg_read: reading from via2 reg ier (14)
via_reg_write: writing 0x82 to via2 reg ifr (13)
via_reg_read: reading from via2 reg ora15 (15)
nubus_video_write_func: got a write to 0x90f00000 sz=4 data=0x1
via_reg_write: writing 0x82 to via2 reg ifr (13)
via_reg_read: reading from via2 reg ora15 (15)
via_reg_read: reading from via2 reg ifr (13)
via_reg_read: reading from via2 reg ier (14)
via_reg_read: reading from via2 reg ifr (13)
rte: sr=0x2000 pc=0x100115a4 format=0x0068, post-pop a7=0x12fffddc
via_reg_read: reading from via1 reg ifr (13)
movem: For movem 4/7, deciding to write 0x12fffdd6 for a7
via_reg_read: reading from via1 reg ifr (13)
...
pruten commented 10 years ago

Ah, I was unable to repro the problem from the console shell. I'll try again from the Finder. From the stack trace, it looks like it got into a double-page fault - which isn't really handled at all, so it just recursed through the page fault-generator until shoebill ran out of stack. The stack trace only lists 500 frames, so I can't see the original problem. Most likely it's a problem with the emulator, rather than a legitimate double-fault. That 0x33fe is "unknown" a bunch of times is telling - off the top of my head, I think that's a MOVE instruction. If that's a legit instruction, then not-handling it is a likely culprit.

pruten commented 10 years ago

Aha, it is a valid MOVE instruction, and here's the bogus line in decoder_gen.c that excludes it

sub_range(inst, "00 xx xxxxxx 111 110");

I'm pushing bigger change to the MOVE instruction later, so I'll include this fix in that.

pruten commented 10 years ago

In the mean time, if you'd like, you can just comment out that line in core/decoder_gen.c and recompile. It might just fix the problem :)

pruten commented 10 years ago

wait, belay that root cause. 0x33fe really is an illegal instruction. I'll have to see if I can repro the problem later tonight and investigate more deeply...

fuerst commented 10 years ago

Sure, I'll better wait :)

fuerst commented 10 years ago

In Shoebill 0.0.2 mkfs now works when called from the CommandShell in the A/UX Finder (32-bit). Thanks a lot!

pruten commented 10 years ago

Huh! That's a complete accident, I have no idea what fixed it XD