barbudreadmon / fbalpha-backup-dontuse-ty

Deprecated port of Final Burn Alpha to Libretro (v0.2.97.43).
61 stars 43 forks source link

Invalid pointer at Galaga and Ms. Pac-Man #58

Closed sergiobenrocha2 closed 8 years ago

sergiobenrocha2 commented 8 years ago

Load Galaga or Ms. Pac-Man, then load another game (any core), it'll get an error trying to free the memory

RetroArch [INFO] :: Saving RAM type #0 to "/home/sergio/Games/RetroArch/saves/galaga.srm".
RetroArch [INFO] :: Saving RAM type #1 to "/home/sergio/Games/RetroArch/saves/galaga.rtc".
*** Error in `retroarch': free(): invalid pointer: 0x00000000021ac7b0 ***
Aborted (core dumped)
RetroArch [INFO] :: Saving RAM type #0 to "/home/sergio/Games/RetroArch/saves/mspacman.srm".
RetroArch [INFO] :: Saving RAM type #1 to "/home/sergio/Games/RetroArch/saves/mspacman.rtc".
*** Error in `retroarch': free(): invalid pointer: 0x00000000024f7570 ***
Aborted (core dumped)

I can do a proper backtrace later.

sergiobenrocha2 commented 8 years ago
RetroArch [INFO] :: Saving config at path: "/home/sergio/.config/retroarch/retroarch.cfg"
RetroArch [INFO] :: Saving RAM type #0 to "/home/sergio/Games/RetroArch/saves/galaga.srm".
RetroArch [INFO] :: Saving RAM type #1 to "/home/sergio/Games/RetroArch/saves/galaga.rtc".
*** Error in `/usr/bin/retroarch': free(): invalid pointer: 0x00007fffe9071230 ***

Program received signal SIGABRT, Aborted.
0x00007ffff23f2cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  0x00007ffff23f2cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 1615
        selftid = 1615
#1  0x00007ffff23f60d8 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {1038094023, 30, 81, 8821712, 140737351927830, 0, 140737488345200, 
              140737257405736, 140737488345472, 140737257417448, 16220219, 140737488345456, 0, 0, 8803328, 140737352273920}}, sa_flags = -383958598, sa_restorer = 0x7ffff23ccd78}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007ffff242f394 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff253db28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
        ap = {{gp_offset = 40, fp_offset = 0, overflow_arg_area = 0x7fffffffdb20, reg_save_area = 0x7fffffffdab0}}
        fd = 11
        on_2 = <optimized out>
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
        written = <optimized out>
#3  0x00007ffff243b66e in malloc_printerr (ptr=<optimized out>, str=0x7ffff2539c19 "free(): invalid pointer", action=1) at malloc.c:4996
        buf = "00007fffe9071230"
        cp = <optimized out>
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3840
        size = <optimized out>
        fb = <optimized out>
        nextchunk = <optimized out>
        nextsize = <optimized out>
        nextinuse = <optimized out>
        prevsize = <optimized out>
        bck = <optimized out>
        fwd = <optimized out>
        errstr = <optimized out>
        locked = <optimized out>
#5  0x00007fffe98cb90b in NamcoSoundExit () at src/burn/snd/namco_snd.cpp:596
No locals.
#6  0x00007fffe9cd5514 in DrvExit () at src/burn/drv/pre90s/d_galaga.cpp:1333
No locals.
#7  0x00007fffe987c0f6 in BurnDrvExit () at src/burn/burn.cpp:663
        nRet = -1118112208
#8  0x00007fffea237eb7 in retro_deinit () at src/burner/libretro/libretro.cpp:875
        output = "/home/sergio/Games/ROMs/MAME roms/galaga.fs", '\000' <repeats 62 times>, "/8\320\060\366Z\275)\000\000\000\000\000\000\000\020\020V\354\377\177\000"
#9  0x00000000004165fb in event_deinit_core (reinit=true) at command_event.c:385
No locals.
#10 event_command (cmd=cmd@entry=EVENT_CMD_CORE_DEINIT) at command_event.c:1234
        cb = 0x7c5f40 <video_driver_state+16384>
        i = 0
        boolean = false
        global = 0x79f7e0 <g_extern>
        settings = 0x7fffec561010
        info = 0x79da00 <runloop_system>
#11 0x0000000000413280 in rarch_main_deinit () at retroarch.c:1510
        global = 0x79f7e0 <g_extern>
#12 0x0000000000411a21 in main_exit (args=0x0) at frontend/frontend.c:73
        settings = 0x7fffec561010
        global = 0x79f7e0 <g_extern>
#13 rarch_main (argc=<optimized out>, argv=<optimized out>, data=0x0) at frontend/frontend.c:317
        args = 0x0
        ret = <optimized out>
        settings = <optimized out>
#14 0x00007ffff23ddec5 in __libc_start_main (main=0x40e9d0 <main>, argc=4, argv=0x7fffffffdf08, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffdef8) at libc-start.c:287
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -5346791596291320055, 4254167, 140737488346880, 0, 0, 5346791595257829129, 5346763574901020425}, mask_was_saved = 0}}, 
          priv = {pad = {0x0, 0x0, 0x50e1e0 <__libc_csu_init>, 0x7fffffffdf08}, data = {prev = 0x0, cleanup = 0x0, canceltype = 5300704}}}
        not_first_call = <optimized out>
#15 0x000000000040ea00 in _start ()
No symbol table info available.
sergiobenrocha2 commented 8 years ago

Found something: http://neosource.1emulation.com/forums/index.php?topic=1731.msg20553#msg20553

Should be fixed in the next release?

Let's workaround it with PR #59.