halpz / re3

2.12k stars 369 forks source link

Crash on CStream::Open(char const*, unsigned int) at string_fortified.h:79:33 #28

Open vaurelios opened 3 days ago

vaurelios commented 3 days ago

Describe the bug 5 secs after games open it crashes at CStream::Open(char const*, unsigned int) at string_fortified.h:79:33

To Reproduce Build and Launch

Log

Process 7482 launched: '/usr/bin/re3' (x86_64)
[DBG]: cdvd_stream: read info 0x555555e351f0
[DBG]: Using one streaming thread for all channels
[DBG]: Created cdstream thread
casepath couldn't find dir/file "neo", full path was neo/neo.txd
casepath couldn't find dir/file "polish.gxt", full path was text/polish.gxt
casepath couldn't find dir/file "russian.gxt", full path was text/russian.gxt
casepath couldn't find dir/file "fonts_j.txd", full path was models/fonts_j.txd
[DBG-2]: [../src/skel/glfw/glfw.cpp.psInitialize:484]: gGameState = GS_START_UP
casepath couldn't find dir/file "gta3.set", full path was gta3.set
[DBG-2]: Default skin set as no other skins are available OR saved skin not found!
[DBG]: Physical memory size 3814338560
[DBG]: Available physical memory 1111785472
OpenGL version: 4.6 (Core Profile) Mesa 24.1.1-arch1.1
casepath couldn't find dir/file "X360BTNS.TXD", full path was MODELS/X360BTNS.TXD
casepath couldn't find dir/file "neo", full path was neo/neo.txd
../vendor/librw/src/base.cpp:1004: Couldn't open file ./neo/neo.txd
Error: couldn't open 'neo/neo.txd'
casepath couldn't find dir/file "neo", full path was neo/carTweakingTable.dat
Error: couldn't open 'neo/carTweakingTable.dat'
casepath couldn't find dir/file "neo", full path was neo/worldTweakingTable.dat
Error: couldn't open 'neo/worldTweakingTable.dat'
casepath couldn't find dir/file "neo", full path was neo/rimTweakingTable.dat
Error: couldn't open 'neo/rimTweakingTable.dat'
You don't seem to have copied gamecontrollerdb.txt file from re3/gamefiles to GTA3 directory. Some gamepads may not be recognized.
casepath couldn't find dir/file "gta3.set", full path was gta3.set
[DBG-2]: [../src/skel/glfw/glfw.cpp.main:2108]: gGameState = GS_INIT_ONCE
[DBG]: Loadind audio cache (If game crashes around here, then your cache is corrupted, remove audio/sound.cache)
[DBG-2]: Finding MP3s...
[DBG-2]: /.../Grand Theft Auto III/mp3/
*** buffer overflow detected ***: terminated

BT

* thread #1, name = 're3', stop reason = signal SIGABRT
  * frame #0: 0x00007ffff77bde44 libc.so.6`___lldb_unnamed_symbol3665 + 276
    frame #1: 0x00007ffff7765a30 libc.so.6`raise + 32
    frame #2: 0x00007ffff774d4c3 libc.so.6`abort + 223
    frame #3: 0x00007ffff774e354 libc.so.6`___lldb_unnamed_symbol3212 + 5
    frame #4: 0x00007ffff784b259 libc.so.6`__fortify_fail + 25
    frame #5: 0x00007ffff784abe4 libc.so.6`__chk_fail + 20
    frame #6: 0x00007ffff784c646 libc.so.6`__strcpy_chk + 70
    frame #7: 0x0000555555770d2c re3`CStream::Open(char const*, unsigned int) at string_fortified.h:79:33
    frame #8: 0x0000555555769cf2 re3`_FindMP3s() (.lto_priv.0) at sampman_oal.cpp:525:39
    frame #9: 0x00005555555eb630 re3`CGame::InitialiseOnceAfterRW() at sampman_oal.cpp:972:12
    frame #10: 0x00005555555637f6 re3`main(argc=<unavailable>, argv=<unavailable>) at glfw.cpp:2193:41
    frame #11: 0x00007ffff774ec88 libc.so.6`___lldb_unnamed_symbol3256 + 120
    frame #12: 0x00007ffff774ed4c libc.so.6`__libc_start_main + 140
    frame #13: 0x000055555556acb5 re3`_start + 37
vaurelios commented 3 days ago

Found the problem. The mp3's paths gets too big. it overflows m_aFilename[128]

maybe change the size to 256?