@xenic
Quote:
If IDOS is only NULL when the avilib is linked in, it seems like the problem is avilib.
No, as it turned out it was an obscure newlib bug which is why it didn't crash when I ran it on my beta install which has a fixed newlib.
The bug is only triggered when the startup code sets a higher minimum version than 52.39, and using ftruncate64() increases this from the default 52.20 to 53.24.
I'd already seen the buggy code in newlib and the trigger was staring me right in the face with the ftruncate()/ftruncate64() thing but I didn't connect the dots right away.
I guess no-one had used post-newlib 52.39 functions and IDOS both in the same binary linked with startup code before now, because if they had they would have run into the same problem.