Re: [hatari-devel] Relocation warning + program failing when run from GEMDOS HD |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Relocation warning + program failing when run from GEMDOS HD
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Fri, 30 Sep 2022 04:12:24 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1664511148; bh=iVg/ojwKKqA/RBNjOVuCrvAE+fUBxTwugQHSPy2xdb0=; h=Date:From:To:Subject:From; b=EESfw+dPxespYX+h80n6zkNtm/qJiD9DwICBnwIbOOyRLt9w/UagEVXpGYlGyYn1j Oe+lN+QFPt/MtvVbGdpf6NnI5o1SQFPwYoWDJsNLb+FrOcpKeHQyCwJRySbyJ4E5Ys 08b/XdF6EupmP/VW9wpeCsmDsHyuW1v6cKB5qZr9mke8/tVIPcGEk5rOnk91vv5Oiw utaqIncAcG8kdFiaalxyvI4rwWy/08u7t8CMb5ppZz10wckdHx9peioRgyhek9gbUv D3KBuUE6KKktlmN7skk47vCMNxxfjiqFuraZL4/8b9DpfY9SDG0H5qTzUj8rC/PXjR BQiKzow6FCIfg==
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