Retroarch: [cheevos] Knights of the Round achievements crashes FBNeo

Created on 4 Mar 2020  路  6Comments  路  Source: libretro/RetroArch

Description

When retroachievements are enabled, trying to load Knights of the Round with FBNeo core crashes immediately on load. No information (errors, segfault, etc.) is printed to the log. The game loads fine with the achievements option disabled. This problem does not occur with RetroArch v1.8.4 stable, so something has changed since then in the nightlies, it seems.

Expected behavior

The game should load and award achievements

Actual behavior

the game crashes out instantly

Steps to reproduce the bug

  1. Enable achievements
  2. Load FBNeo core
  3. Load Knights of the Round game

Bisect Results

No proper bisect yet, but it's since v1.8.4 stable release (stable git hash: f425d8dc8bdbda7f48f8170f027b0ff5ebde4492).

Version/Commit

You can find this information under Information/System Information

  • RetroArch: bdc159f0b4b6aca17f0bd7b187287a438c039d41 (bad)

Environment information

  • OS: Linux, but it seems to be all
  • Compiler: buildbot
cheevos

Most helpful comment

The problem was due to this line:

?0xha431=3?@@Multi(0xha4b3)Map screen for @Stage(0xha4c5)-@Digit(0xha4c4_v1)@Continue(0xhac9b)

The @@Multi should have just been @Multi. This resulted in the injection of an addition string "[Unknown macro]" that made the resulting data structure just slightly larger than the allocated space.

I've corrected the rich presence itself, so the game loads now, but am still working on the code to prevent the problem from occurring again in the future.

All 6 comments

Finish bisecting, looks like it's something in that commit: 05c1f9c9aace296f23c27b5030d4c72578a37df0

Just bisected as well, not realizing this issue was here, got the same commit: 05c1f9c9aace296f23c27b5030d4c72578a37df0

Core dump is preceded by one of two error messages:
free(): corrupted unsorted chunks
malloc(): memory corruption

I can confirm that it appears to be memory corruption parsing the rich presence for this game. Am investigating.

Same error occurs with rich presence disabled. I assume disabling rich presence only disables sending back to the server in that case.

The problem was due to this line:

?0xha431=3?@@Multi(0xha4b3)Map screen for @Stage(0xha4c5)-@Digit(0xha4c4_v1)@Continue(0xhac9b)

The @@Multi should have just been @Multi. This resulted in the injection of an addition string "[Unknown macro]" that made the resulting data structure just slightly larger than the allocated space.

I've corrected the rich presence itself, so the game loads now, but am still working on the code to prevent the problem from occurring again in the future.

Thanks for all of the attention on this guys. Great job :)

Was this page helpful?
0 / 5 - 0 ratings