[Coco] strange bug in toolshed
Tormod Volden
lists.tormod at gmail.com
Sun Jan 26 03:13:15 EST 2014
Hi,
I noticed last night there is something weird in Toolshed but haven't
it figured out. So here is an incomplete debugging story:
After building the latest nitros9 "nightly" I counted as usual the
numbers of disk images in the "dsks" folder. The number has been
increasing the last months as we have been fixing builds, but have
been stable at 185 lately. After mkdskindex creates the index.htm
ls dsks | wc -l
usually returns 186. But yesterday it was only 183. So I compared my
new index.html with the old one still at www.nitros9.org/latest in two
browser windows and could see that the Dragon Alpha images were
missing. Strange, since I didn't change much Dragon stuff lately.
Retrying
make clean PORTS=dalpha
make PORTS=dalpha
showed that os9 gen was failing to link the bootfile (the
bootfiles/kernel file). So I rewound my tree to older commit revisions
using
hg update revision
in a iterative way, running the above make's for each time until I
found the "bad" commit. It surprisingly turned out to be commit
f3179a93 which at Darren's suggestion swapped the order of two
instructions in boot_d64.asm.
vbindiff kernel-file-before kernel-file-after
showed that indeed only 4 bytes were different, having changed order,
nothing else (other than the module CRC).
So running "os9 gen" on the command line alternating between
kernel-file-before and kernel-file-after I get either a successful
"Bootfile Linked!" or a failing "Error 214".
I have been chasing this in gdb, and have found so far that the
in-memory fd_sector is messed up. Breakpointing _os9_read() shows that
it is called way more times when trying to link the "bad" kernel file.
Which does not make sense at all.
So there is something rotten in Toolshed. Maybe it only affects the
reading of disk images (under some circumstances) but until someone
nails this we cannot be sure that writing of disk images is affected
too and can cause subtle, seemingly random failures.
I guess there must be a new Toolshed release before a new NitrOS-9 release...
Regards,
Tormod
More information about the Coco
mailing list