ducalex / retro-go

Retro emulation for the ODROID-GO and other ESP32 devices
GNU General Public License v2.0
516 stars 118 forks source link

Doom crashes on retro-go built with ESP-IDF 5.2.2 (fine on ESP-IDF 4.8.8) #134

Closed tomvanbraeckel closed 1 month ago

tomvanbraeckel commented 1 month ago

Describe the bug

Doom crashes (seems to be memory allocation issues) on retro-go built with ESP-IDF 5.2.2. retro-core (NES, GBC) works fine.

When building with ESP-IDF 4.8.8, everything works fine.

To Reproduce

  1. Build retro-go with ESP-IDF 5.2.2 (tested on ESP32 and ESP32-S3)
  2. Load a doom .wad
  3. "Application Crashed" appears on the display and serial port.

Expected behavior

Doom game plays

Additional context

The game seems to crash at different locations. I saw one stacktrace point to "to_upper()" but in a different build, it crashed in some argument parsing code of doom (see attached console log and stack trace).

I suspect this might have something to do with the memory changes in 5.x but not sure.

There might be some ESP-IDF configuration CONFIG_ options that fix this (revert back to the old memory behavior?) or that are not being set correctly (name changed?) but I haven't had time to investigate.

For now, I'm using 4.8.8 for the Fri3D Camp 2024 Badge as there's a deadline approaching. prboom_crashes_on_esp-idf_5.x.txt

ducalex commented 1 month ago

I've made some changes (089b5fd699a2914aa212b53848179e4ad7cd70ff and 829dae078f447429ce2b4fd535083a49f691679b) and now it works on 5.0 for me but I'm not able to test 5.1/5.2 right now.

tomvanbraeckel commented 1 month ago

Yes, that seems to have fixed it, no more crash on doom now with ESP-IDF 5.2.2! Thank you so much!