Re: [hatari-devel] asm56000.ttp problem |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] asm56000.ttp problem
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Wed, 3 Oct 2018 14:41:17 +0200
- Autocrypt: addr=czietz@xxxxxxx; prefer-encrypt=mutual; keydata= xsDiBDdn2AURBADksdHVyN55nv0lx4qGx+GQMrbo7zs7lSkAfhkgmgqp84xUeUiWI/kj1on/ wxkmJ96Yzt0ktDbZYM0C9Z66M3rLfXE1vXALHhegeMuOy/tVWybcohRrhfB7tmANTESJOZke 0lZZ59DcIfFoqLYErb6qX8nLPYnOv6sFubxnhuF9QQCg/3GaIR1sVK9Xq+b4B9BtVxd7cHMD /i2hAEOX3WY3K7PNZJziYF54uBbGiVS88W41l1RARcaeogIZcAKpFH3on+Tf60fAC85MCp17 QIeP44hj4Cf46B+UTVhf3EFG4IOsLRxUonpt7dKO8txsKFN/OFsjlPOuDyg7XMpEWkTWZetm HC9/0pcApIXSDnggde4T8AX6nn/+A/4hBOhPxuvkV7Uw/ebLYwXrLo2vt9OvvC1VfeywNseq PIkFX/+n/+niBS+Cb2ess2SVQNKJ9vP5+vBxg5AMfQXqk1ONldGQ/ARHmL6+Iuo47mO51e7R i691hq13wHUvyKh1AN7fpKI2m3YW55XEQ+3iTMIZcqfjr6xYgG8GJTppdc0gQ2hyaXN0aWFu IFppZXR6IDxjemlldHpAZ214Lm5ldD7CYwQQEQIAIwIZAQIeAQIXgAUCVGD5IgcLCQgHAwIB BhUIAgkKCwQWAgMBAAoJEFLLl/ZtoCXKubQAoIHNaurSMQB8MHDoTk3B7WHk2ApoAJ0egA8q aNoVj0kU4+OjeGzFiSHMOs7BTQQ3Z9gFEAgA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlL OCDaAadWoxTpj0BV89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeS Wc39uK50T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknb zSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdXQ6MdGGze MyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbTCD1mpF1Bn5x8vYlL IhkmuquiXsNV6TILOwACAgf+JhucyZDzOWGht9e0U71kC2bxIOr4iz+ADd3sxS62okrocHXp B9zYDhmJ74BFfC7xMd9bwWNj7YR0yiUdOzY27OcXcEkVmhVBW6AqxuRAKfmYMvvnyR5z5OP6 vg2YSzgOmooc5vequa5YIjLmFkuRlglLiEgdW9gPBFtirNqxOtAqSxEcRrblSn8JBEU51Ii6 SVVuo1nXOP11g8rVO4YvEED89pHT4jgLZu4th1N+mDumNZlqyUIxZ4tQyw3X2OWvEbKWGn2j h0ZywaomUTpVA+wiwxndawP40oowFYT8LNeLtfZyq6xPpQmT2DaNhP4gdy3qkDfnmXkc2zFM YukXo8I/AwUYN2fYBVLLl/ZtoCXKEQKA3QCfTJstYzXurbt9ZnoTU3SFQQmG0/wAoNX91nWM nsS7JOepPAzOUoke4AIi
- Openpgp: preference=signencrypt
Thorsten Otto schrieb:
> Yes, there is an assert in that function, but if the library was compiled with
> NDEBUG it will just continue. Current mintlib seems to be safe in that regard.
>
> And if you look at _write: that function rejects handles >= __NHANDLES. That
> explains why the file is created, but nothing written to it. So my previous
> assumption was wrong: the bug is in the library.
In the meantime, I have come to the same conclusion. read() and close()
will more or less work with handles >= 40, while write() rejects them
and open() (without the assert) writes past the end of the array.
I have thus patched open() and write() with a hex-editor. With the
attached ASM56000.TTP the compilation process runs through without
errors or crashes on Hatari's GEMDOS HD. I'll let Miro judge whether the
output is as expected.
Note that this is a very dirty patch of ASM56000.TTP. After all,
__open_stat is used for a reason. E.g. my patched write() function will
fail with O_APPEND.
This also means that there will be more programs (using the same
standard library) with a similar problem.
Regards
Christian
--
Christian Zietz - CHZ-Soft - czietz@xxxxxxx
WWW: http://www.chzsoft.de/
PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA
Attachment:
asm56000.zip
Description: Zip compressed data