[Coco] strange bug in toolshed

Christopher R. Hawks chawks at dls.net
Sun Jan 26 08:36:37 EST 2014


On Sun, 26 Jan 2014 09:13:15 +0100
Tormod Volden <lists.tormod at gmail.com> wrote:

> 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
>

	I'm curious as to why the makefile is being included in the
bootfiles in both d64 and dalpha. The lines in dalpha are:

bootfile_covdg_ds80: 	$(BOOTFILE_COVDG_DS80) $(DEPENDS)
				$(MERGE) $^ > $@
($^ means everything or the right of the colon)

and coco1 bootfile sez:

bootfile_covdg_ds80: $(BOOTFILE_COVDG_DS80) $(DEPENDS)
	$(MERGE) $(BOOTFILE_COVDG_DS80)>$@



Christopher R. Hawks
HAWKSoft
-- 
I do not feel obliged to believe that the same God who has endowed us
with sense, reason, and intellect has intended us to forgo their use.
                -- Galileo Galilei



More information about the Coco mailing list