Re: [hatari-devel] Relocation warning + program failing when run from GEMDOS HD

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Thu, 29 Sep 2022 00:16:51 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> 
> On 28.9.2022 20.42, Thomas Huth wrote:
> > Am Wed, 28 Sep 2022 11:16:23 +0300
> > schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:  
> >> Just waiting long time before starting the program is not enough, it
> >> actually needs to crash first.
> >>
> >> WTF???  
> > 
> > Well, the program has a corrupt relocation table, so if TOS is not checking
> > for the length of the relocation table and just looks for the terminating
> > NUL byte, the behavior of course depends on the contents of the memory that
> > were there right after the non-terminated table, so depending on whether
> > there was a NUL byte immediately following or not, the program might have
> > worked or the relocation process might have corrupted random other
> > locations of memory.  
> 
> This was with GEMDOS HD, i.e. where your gemdos.c code was doing the 
> relocation...

Ok ... no clue what's the reason then. You likely have to trace the
codeflow during runtime to see where it differs.

> > Anyway, the program is just corrupt. There is not much we could do from the
> > emulator side execpt to mention it as bad in the compatibility.html doc and
> > recommend a TOS version that might work by chance.  
> 
> Looking at GEMDOS HD relocation code, while it checks validity of 
> relocation table index offset, it does not check whether the actual 
> relocation offset is valid.
> 
> Shouldn't that be always within nTextLen + nDataLen?

Likely yes. Feel free to add that check ... we'll then see whether it
breaks some other programs or not :-)

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/