libretro / Dinothawr

Dinothawr is a block pushing puzzle game on slippery surfaces. Our hero is a dinosaur whose friends are trapped in ice. Through puzzles it is your task to free the dinos from their ice prison.
Other
11 stars 13 forks source link

Core segfaults when closed #12

Closed vanfanel closed 3 years ago

vanfanel commented 5 years ago

Hi there,

This core segfaults badly when closed. It can be either by closing the core, or trying to load another core from the RA menu.

Tatsuya79 commented 3 years ago

Problem probably lies within RA.

1.7.5 826c77d523 2018-10-02 GOOD 1.7.6 9750719074 2019-02-03 BAD

SimpleTease commented 3 years ago

I think this would work but haven't tested.

void retro_unload_game(void)
{
   // Workaround a crash on Windows & Android because the callbacks are invoked after the DLL/SO was unloaded
   struct retro_audio_callback cb = { nullptr, nullptr };
   use_audio_cb = environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK, &cb);

   game.reset();
}
inactive123 commented 3 years ago

@SimpleTease Would be worthwhile if you could find a fix on the RetroArch side. There are not that many cores yet implementing the audio callback so its possible this was overlooked.

Tatsuya79 commented 3 years ago

On win x64 with xaudio there's no audio at all and bringing the menu up with F1 corrupts everything and crash. with dsound it's just an exit crash.

It was fine around RA 1.7.5.

SimpleTease commented 3 years ago

DSound doesn't give me any problems. XAudio has no sound and generates heavy RA corruption (missing assets, depth problems, no playlist updates, bad hotkeys, exit crash). I haven't traced back to 1.7.5 but it'll be interesting to bisect the problem commit(s).

I did test the core without any callbacks and XAudio behaved okay. Having a non-multithreaded core option might be handy as a fallback. Still I'll see where my adventures take me.

SimpleTease commented 3 years ago

I've identified a list of problems.

Core:

Frontend:

inactive123 commented 3 years ago

OK, with this PR merged now, what's the current status of this issue?

Tatsuya79 commented 3 years ago

Should be fixed.

https://github.com/libretro/RetroArch/pull/11830 https://github.com/libretro/RetroArch/pull/11831