NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/42410: Bug in makefs gives unhandled exception on MIPS Magnum R4000



>Number:         42410
>Category:       bin
>Synopsis:       Bug in makefs gives unhandled exception on MIPS Magnum R4000
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 04 19:50:00 +0000 2009
>Originator:     Hervé Poussineau
>Release:        5.0.1
>Organization:
>Environment:
>Description:
When trying to start NetBSD 5.0.1 on a MIPS Magnum R4000 (emulated in Qemu) with
the "multi(0)cdrom(4)fdisk(0)boot multi(0)cdrom(4)fdisk(0)netbsd" command, I 
get:

Jazz Monitor. Version 174
Press H for help, Q to quit.
AdEL exception occurred.
 at=00000000 v0=00000000 v1=00000004 a0=8000aefd a1=00000000 a2=807f53b0
 a3=807f53b4 t0=8000af22 t1=8000be74 t2=00000074 t3=00000054 t4=8000af1e
 t5=00000005 t6=00000005 t7=807f53a4 s0=8000aefd s1=00000653 s2=000001ad
 s3=000001ad s4=0000a000 s5=00000000 s6=8000ad50 s7=8000bf00 t8=00000004
 t9=807f53b8 k0=80041f50 k1=80000194 gp=00002566 sp=8000ace8 s8=8000bf07
 ra=80025e34 psr=20000803 epc=80025edc cause=00004010 errorepc=00000000
 badvaddr=8000aeff
>

After searching, the problem lies in iso cdrom format, and not in program 
itself.
This is proved by the fact that extracting all files and creating a new iso file
lets me boot NetBSD without problem.

Here is a hex-dump of the root directory of the file arccd-5.0.1.iso

0000a000: fe 00 14 00 00 00 00 00 - 00 14 00 08 00 00 00 00   ........ ........
0000a010: 08 00 00 00 00 00 00 00 - 00 02 00 00 01 00 00 01   ........ ........
0000a020: 01 00 53 50 07 01 be ef - 00 45 52 b9 01 0a 49 5e   ..SP.... .ER...I.
0000a030: 01 49 45 45 45 5f 50 31 - 32 38 32 54 48 45 20 49   .IEEE.P1 282THE.I
0000a040: 45 45 45 20 50 31 32 38 - 32 20 50 52 4f 54 4f 43   EEE.P128 2.PROTOC
0000a050: 4f 4c 20 50 52 4f 56 49 - 44 45 53 20 53 55 50 50   OL.PROVI DES.SUPP
0000a060: 4f 52 54 20 46 4f 52 20 - 50 4f 53 49 58 20 46 49   ORT.FOR. POSIX.FI
0000a070: 4c 45 20 53 59 53 54 45 - 4d 20 53 45 4d 41 4e 54   LE.SYSTE M.SEMANT
0000a080: 49 43 53 2e 50 4c 45 41 - 53 45 20 43 4f 4e 54 41   ICS.PLEA SE.CONTA
0000a090: 43 54 20 54 48 45 20 49 - 45 45 45 20 53 54 41 4e   CT.THE.I EEE.STAN
0000a0a0: 44 41 52 44 53 20 44 45 - 50 41 52 54 4d 45 4e 54   DARDS.DE PARTMENT
0000a0b0: 2c 20 50 49 53 43 41 54 - 41 57 41 59 2c 20 4e 4a   ..PISCAT AWAY..NJ
0000a0c0: 2c 20 55 53 41 20 46 4f - 52 20 54 48 45 20 50 31   ..USA.FO R.THE.P1
0000a0d0: 32 38 32 20 53 50 45 43 - 49 46 49 43 41 54 49 4f   282.SPEC IFICATIO
0000a0e0: 4e 2e 50 58 24 01 ed 41 - 00 00 00 00 41 ed 03 00   N.PX...A ....A...
0000a0f0: 00 00 00 00 00 03 63 02 - 00 00 00 00 02 63#46 00   ......c. .....cF.
0000a100: 14 00 00 00 00 00 00 14 - 00 08 00 00 00 00 08 00   ........ ........
0000a110: 00 00 00 00 00 00 00 02 - 00 00 01 00 00 01 01 01   ........ ........
0000a120: 50 58 24 01 ed 41 00 00 - 00 00 41 ed 03 00 00 00   PX...A.. ..A.....
0000a130: 00 00 00 03 63 02 00 00 - 00 00 02 63 00 00 00 00   ....c... ...c....
0000a140: 00 00 00 00#69 00 15 00 - 00 00 00 00 00 15 00 08   ....i... ........
0000a150: 00 00 00 00 08 00 6d 07 - 1d 12 27 2c 00 02 00 00   ......m. ........
0000a160: 01 00 00 01 03 41 52 43 - 50 58 24 01 ed 41 00 00   .....ARC PX...A..
0000a170: 00 00 41 ed 04 00 00 00 - 00 00 00 04 63 02 00 00   ..A..... ....c...
0000a180: 00 00 02 63 00 00 00 00 - 00 00 00 00 54 46 19 01   ...c.... ....TF..
0000a190: 07 6d 07 1d 12 28 27 00 - 6d 07 1d 12 27 2c 00 6d   .m...... m......m
0000a1a0: 07 1d 12 28 2b 4e 4d 08 - 01 00 61 72 63#6e 00 e2   .....NM. ..arcn..
0000a1b0: 2c 01 00 00 01 2c e2 b0 - da 00 00 00 00 da b0 6d   ........ .......m
0000a1c0: 07 1d 12 28 2b 00 00 00 - 00 01 00 00 01 07 42 4f   ........ ......BO
0000a1d0: 4f 54 2e 3b 31 50 58 24 - 01 24 81 00 00 00 00 81   OT..1PX. ........
0000a1e0: 24 01 00 00 00 00 00 00 - 01 63 02 00 00 00 00 02   ........ .c......
0000a1f0: 63 00 00 00 00 00 00 00 - 00 54 46 19 01 07 6d 07   c....... .TF...m.
0000a200: 1d 12 28 2b 00 6d 07 1d - 12 28 2b 00 6d 07 1d 12   .....m.. ....m...
0000a210: 28 2b 4e 4d 09 01 00 62 - 6f 6f 74#72 00 fe 2c 01   ..NM...b ootr....
0000a220: 00 00 01 2c fe df c9 22 - 00 00 22 c9 df 6d 07 1d   ........ .....m..
0000a230: 12 28 27 00 00 00 00 01 - 00 00 01 09 4e 45 54 42   ........ ....NETB
0000a240: 53 44 2e 3b 31 50 58 24 - 01 a4 81 00 00 00 00 81   SD..1PX. ........
0000a250: a4 01 00 00 00 00 00 00 - 01 63 02 00 00 00 00 02   ........ .c......
0000a260: 63 00 00 00 00 00 00 00 - 00 54 46 19 01 07 6d 07   c....... .TF...m.
0000a270: 1d 12 28 27 00 6d 07 1d - 12 28 27 00 6d 07 1d 12   .....m.. ....m...
0000a280: 28 27 4e 4d 0b 01 00 6e - 65 74 62 73 64#00 00 00   ..NM...n etbsd...

I've added '#' chars between each directory entry for clarity.

Standard ECMA-119 (aka ISO-9660) says:
Section 9.1.1 Length of Directory Record (LEN_DR) (BP 1)
        This Field shall specify as an 8-bit number the length in bytes of the 
Directory Record. 

Section 9.4.6 Padding Field [BP (9+LEN_DI)] 
        This field shall be present in the Path Table Record only if the number
        in the Length of Directory Identifier field is an odd number.
        If present, this field shall be set to (00).
        
Section 9.1.13 System Use [BP (LEN_DR-LEN_SU+1) to LEN_DR]
        This field shall be optional. If present, this field shall be reserved
        for system use. Its content is not specified by this International
        Standard. If necessary, so that the Directory Record comprises an even
        number of bytes, a (00) byte shall be added to terminate this field.

Section 9.1.13 explicitly states that directory record length must be even.

In arccd-5.0.1.iso root directory, they are 0xfe, 0x46, 0x69, 0x6e, 0x72.
Third one is incorrect. By manually fixing the iso file by changing the
directory record length to 0x70 and adding a padding byte, NetBSD 5.0.1
successfully starts.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index