-
Notifications
You must be signed in to change notification settings - Fork 16
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
Illegal instruction on core load when compiled with any optimizations #18
Comments
FWIW I seem to be getting the exact same error when compiling Pinky with --release. https://github.com/koute/pinky/blob/master/pinky-libretro @koute I realize you might not be active on this project any more but if you have a second, I'd be curious if you can still get it to work in release mode however you were doing it before. I'm wondering if this is all related to something with my toolchain rather than with libretro-backend. |
Core dump from the Mac side https://gist.github.com/thieman/90f858299fe3c1502ef36300fc2057c0 |
More findings: if I comment out the body of |
Still digging but I think it might be this issue that was just fixed, I'm going to see if it's in nightly and try there. It seems like I'm getting different results for pointer equality comparisons in debug vs release, which is affecting both setting the environment callback and then later triggering all the assert_ne! asserts against LIBRETRO_INSTANCE. rust-lang/rust#54685 |
I think I've managed to hackily fix it in my fork https://github.com/thieman/exa-rs/blob/master/src/libretro/mod.rs I ended up doing what @HeroicKatora mentioned in #13 and changing the callbacks to use Options so that they're never null function pointers. This has seemed to stop the crashes in release mode. Will wait to get some feedback here before trying to contribute a patch as it seems like this repo might be inactive |
I ran into this as well, implementing a core for
@koute Is this repository being maintained still? |
@adam-becker my fork isn't pushed to crates.io but you're welcome to grab it, my changes are under MIT license https://github.com/thieman/exa-rs/blob/main/src/libretro/mod.rs |
I'm just starting to investigate this but I figured I'd post it now. I'm developing a core which loads and runs fine when compiled at opt-level=0 (debug level default). However, if I compile it with any other level of optimizations, whether speed- or size-based, I get an illegal instruction core dump as soon as I load the core in Retroarch. This is before actually attempting to load any content, this is when I select "Load Core" from the main menu. I'm seeing this both in a Linux->Windows GNU crosscompile, and in a Mac native compile.
If I don't make progress soon I'll try to come up with a minimal repro, but a larger repro is available now by cloning https://github.com/thieman/exa-rs at commit 6035360da4f74d72705d88c234d4328a7547a291.
I'm also wondering if this may be related to #13.
The text was updated successfully, but these errors were encountered: