-
Notifications
You must be signed in to change notification settings - Fork 48
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
-m68040 compiler option leads to crashes #38
Comments
(reported by @antscode) |
I get crashes on -march=68020 while running 68k under Mac OS 9 on qemu PPC, possibly the same issue? Unimplemented instruction error on a "DC.W". macsbug screenshot attached edit: and when compiled with -march=68040, same conditions, macsbug: edit 2: |
so I spent the night digging into this a little, compiling all my libraries and my main binary with "-march=68020 -O2", since without optimizations my program is not usable on 68k machines I'm using mbedtls and libssh2, which are both designed to be very portable, and use a somewhat complicated system of macros and function pointers to wrap free and malloc replacing all of the 'obfuscated' calls with actual simple free/malloc calls seems to fix all the crashes |
Cool! I've never really used those libs myself, can you provide some hints on what the minimal setup is to reproduce the problem? I've never really debugged this properly because setting up the whole thing didn't feel like it was my idea of fun :-) |
sure, I'll write up a minimal program that can call mbedtls and crash, and some build instructions |
so I haven't managed to get a simple reproduction without building my whole app with multiple libraries, but I've found some things:
edit: so after the malloc fails, I tried a NewPtr() and a MemError(), and I get a -113 memAZErr, no idea what that means... maybe I should actually read IM: Memory. |
OK memAZErr sounds like heap corruption... Apparenty, if a bus error happens in the Memory Manager during some operations, that is caught and reported as an error instead of just crashing. It does look like I'll have the time to play around with this in the next few days. |
I now managed to set everything up, compiled everything for 68000 and only mbedtls for 020, and got a crash when I type It looks like it is indeed a compiler problem, looks like some references to the standard libraries are resolved incorrectly for 68020 code, causing a call to |
I just enjoyed a crash-free ssheven session now :-) For the record: The instruction in question is the |
fantastic, it's working great for me this is so helpful, thanks a ton! |
I've heard that https://github.com/antscode/MacHTTP crashes when
-m68040
is added to the compiler flags.The text was updated successfully, but these errors were encountered: