libretro / libretro/blastem

blastem is linking against the wrong debug_message function ?

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
77
Forks
38
Avg merge
36m
Merged PRs (30d)
6

Description

My setup is an up-to-date Gentoo Linux x86_64.

note : it might be a duplicate of https://github.com/libretro/blastem/issues/15 since i'm getting the same error message :

[INFO] Did not find a valid content patch.
Erreur de segmentation (core dumped)

Using gdb i get this :

(gdb) bt
#0  0x00007ffff35cf849 in debug_message () at /usr/lib64/libsmbconf.so.0
#1  0x00007fffef92da06 in configure_rom (rom_db=0x555556107a20, vrom=0x5555562668f0, rom_size=1048576, lock_on=0x0, lock_on_size=0, base_map=0x7fffef9b19a0 <base_map>, base_chunks=4) at romdb.c:910
#2  0x00007fffef8d8423 in alloc_config_genesis (rom=0x5555562668f0, rom_size=1048576, lock_on=0x0, lock_on_size=0, ym_opts=0, force_region=0 '\000') at genesis.c:2075
#3  0x00007fffef8d1486 in alloc_config_system (stype=SYSTEM_GENESIS, media=0x7fffef9b6c00 <current_media>, opts=0, force_region=0 '\000') at system.c:71
#4  0x00007fffef8d08bc in retro_load_game (game=0x555556109580) at libblastem.c:266

So apparently It is happening because debug_message calls aren't using the function in util.c, instead some function in /usr/lib64/libsmbconf.so.0 (some samba library i guess) is used.
I have no explanation for this, and it happens with both buildbot's core and self-built core.

Renaming debug_message fixes the crash.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the debug_message definition in util.c and the calls shown in romdb.c:910, then reproduce the crash with the Gentoo or self-built core and inspect the linked symbols. Done means the core no longer resolves debug_message to /usr/lib64/libsmbconf.so.0 and the reported ROM-loading path completes without the segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.