-
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
No longer works on Android #61
Comments
Could you please confirm that it was working before the last commit - i.e. that this not related to the recent buildbot/Android makefile changes? That would be very helpful for debugging purposes! Either way, I will investigate this as best I can. I can't see how my changes would harm anything, especially since the Linux and Windows versions are fine, but I'll check every avenue... |
It's working for me with the retail game content. |
I'm not exactly sure when it happened, and I cannot say for sure that it was anybody's commits, so I don't want to single anybody out here. What I do know, is that the shareware files on the content downloader work on Windows and Linux. I'd appreciate it if we could find out what the problem is together and figure out a solution somehow on Android. I do believe this worked before. |
@twinaphex - I wasn't complaining about being singled out ;) I want this core to be the best it can be - if I made a mistake, I'll gladly hold my hands up. It's just the more information there is, the easier it is to debug. I made a comment about the issue in the pull request thread. I realise now I should have copied it here for clarity. Here it is:
...and thatman84 kindly offered to check if he had the previous version of the core for testing. I'll try to get some logs and have a poke around tomorrow... |
Okay, I need some help here... I've discovered the nature of the bug and I've found a fix, but I'm not going to make a pull request until I understand why this bug is happening and why the 'fix' does anything at all... There is some very strange memory 'corruption' going on here. Take a look at the following code from the retro_load_game() function: Lines 920 to 956 in fdf566f
When loading 'unofficial' content, parms.argv[2] contains the game directory name. When running the Android version:
Sys_Init() does nothing other than call 'environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)'. If I move the Sys_Init() call from retro_load_game() to retro_init() then parms.argv remains uncorrupted and all content loads correctly. Please, can anyone shed any light on this? |
Yeah, that fixes it. Pushing that. |
It does seem to crash now when exiting the core - the only thing I see in the backtrace is this which is unfortunately not much - Thread 1 received signal SIGSEGV, Segmentation fault. |
It's crashing because you're calling Sys_Quit() after freeing the heap... i.e. you only needed to move Sys_Init()... 🙂 Do you want to fix this, or shall I make a pull request? |
Go ahead and make the PR. The reason why I moved Sys_Quit() is because I did notice suspicious behavior and I thought that would fix it, but I didn't know Sys_Quit() was contingent on that heap still being allocated. I think it's good form to have the equivalent function of Sys_Init that is ran in retro_init() also be deinited by its retro_uninit counterpart. |
I wasn't criticising (hence the smiley!) - it's completely unobvious that Sys_Quit() requires the heap (it goes down pretty deep in the code). I agree completely that retro_deinit() should mirror retro_init(), so I've left Sys_Quit() where it is and moved the 'free(heap)' - I'll make the pull request right now. |
@jdgleaver It now reports 'Failed to load content' when trying to load the shareware version on Android.
It has previously always worked on Android before. This is a regression.
The text was updated successfully, but these errors were encountered: