Re: [hatari-devel] Statistician app NULL pointer crash with GEMDOS HD emu?

[ Thread Index | Date Index | More Archives ]

Am Tue, 26 Aug 2014 00:05:16 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> On maanantai 25 elokuu 2014, Thomas Huth wrote:
> > Ok, I now had a look at this program, and indeed, it seems to lack
> > some proper error code checking. However, as far as I can see, the
> > problem is not Dfree, but the BIOS function GetBPB (BIOS #7). It
> > returns zero for our GEMDOS drive (and certainly also for empty
> > floppy drives). The stats program does not check for zero here and
> > simply assumes the pointer is valid --> crash.
> Thanks!
> So fixing this would require enabling BIOS interception whenever
> GEMDOS HD emulation is enabled, just to be able to reply something
> meaningful to this call:
> and faking most of the requested data:
> Looking at the rest of BIOS calls, this is only one that
> is related to HD drives and not already fixed in other ways
> (like drive map is).

There is also Rwabs:

.... but emulating this one would make even less sense than GetBPB, I

> Any comments on whether supporting this is worth the trouble,
> and are you going to look into that?

Implementation is not that straight forward since you've got to provide
a piece of memory in the ST memory range where you can put the BPB data
into. It might be possible by using a block in the cartridge memory...
but since this is clearly a bug in the program, and providing a BPB for
a non-block drive like our GEMDOS drive does not make too much sense,
I don't think it is worth the effort for just this buggy little
program. The program will likely also crash for other non-FAT-drives
(like network drives), so this is really just a bug in the program.

I'd suggest that we make an entry for this program in the compatibility
list, saying that it uses GetBPB without checking for a valid return
value -- and if we ever hit another program with this problem, we could
reconsider intercepting GetBPB again.


Mail converted by MHonArc 2.6.19+