-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible memory corruption originating from libnix13 #84
Comments
sorry, that's not enough info to do anything |
writing at address 0x00000090 is not part of libnix. |
No, it most certainly is not part of libnix, but it should be safe to write there on Amiga. (68000 trap vector area) It is there to get memwatch breakpoint triggered in the limited UAE debugger, to verify that the memory stomping indeed happens before any "user code" is reached. I'm gonna investigate it further, and possibly find a workaround. Just wanted to know if you have any thoughts about it. |
adding void __nocommandline(){}; override to demo code seems to fix the wb startup! |
I guess you already disabled |
Yeah I tried - it gives "Software error - task held" error from both cli and wb |
You should only tinker with internal topics if you are familiar with them and know the consequences. __nocommandline requires a valid DOSBase and is called before your main is called. It relies on the fact that __initlibraries run before. This isn't a bug in libnix, it's rather a wrong use of libnix. |
Yeah I didn't try it [ what __initlibraries does ] very throughly, but I think the bug with cmd line parsing is real. Not sure what causes it though. |
An out of the box kick13 hello world runs without problems from CLI and Workbench. And it's calling __initlibraries plus __nocommandline. Please provide some source with make instructions to prove your claim. |
Okay. Sorry for the delay, I've been busy. But finally took some time to strip down one of my programs to somewhat minimal test case. I've only tested it on 512/512 A500. Compilation spell:
Precompiled testcase: nixtestcase.adf contains demopack.exe which should show green screen. It shows red screen if the memory has been stomped. There's startup-sequence on disk, or you can launch it manually from cli and it should show green screen. The included wbrig.adf can be also used. Insert wbrig.adf to df0 and nixtestcase.adf to df1. It should boot to green screen. As I said before, enabling void __nocommandline(){}; seems to fix it. |
@bebbo should this ticket be re-opened? |
not needed, it's fixed now: The lock is null, which wasn't checked. |
is it fixed in libnix13 too? |
yes, you need to run a |
A mystery blit corrupts chip memory before main() in binary compiled with bebbo-gcc. Investigation by a/b in this EAB thread suggests that there's DOS I/O calls happening when system is disabled.
The code in main() also disables system, but doesn't do any I/O afterwards. I've verified that the chip data is loaded into memory, but then gets stomped by the blit.
CFLAGS for compiling are -mcrt=nix13 -O2 -Wall -mtune=68000. I tried to look for obvious problem in libnix, but could find anything definitive. Stackswap seems to disable system for a short time, and command line parsing uses some Dos calls, and both are added to the libc init list, but not sure why the memory corruption happens.
The text was updated successfully, but these errors were encountered: