libretro / libretro-lutro

An experimental lua game framework for libretro following the LÖVE API
https://lutro.libretro.com
MIT License
156 stars 46 forks source link

Loading a second game doesn't work anymore #204

Open kivutar opened 3 years ago

kivutar commented 3 years ago

Open RetroArch Load Lutro Load a lutro game and play for a while Trigger the menu with F1 Load another lutro game You will notice that most of the time it does't work well.

kivutar commented 3 years ago

Trace in Ludo

vorbis info:
    num streams: 1
    num channels: 2
    sample rate: 44100
vorbis init success
2021/07/19 18:13:50 [OpenAL]: Using 4 buffers of 8192 bytes.
2021/07/19 18:13:50 [Core]: Game loaded: /Users/kivutar/lutro-sienna
/Users/kivutar/onion-kidd/main.lua:104: attempt to call global 'newSource' (a nil value)
stack traceback:
    /Users/kivutar/onion-kidd/main.lua:104: in function </Users/kivutar/onion-kidd/main.lua:29>
/Users/kivutar/onion-kidd/main.lua:104: attempt to call global 'newSource' (a nil value)
stack traceback:
    /Users/kivutar/onion-kidd/main.lua:104: in function </Users/kivutar/onion-kidd/main.lua:29>
2021/07/19 18:14:33 [OpenAL]: Using 4 buffers of 8192 bytes.
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x0]

runtime stack:
runtime.throw(0x44a0c8c, 0x2a)
    /usr/local/Cellar/go/1.16.5/libexec/src/runtime/panic.go:1117 +0x72
runtime.sigpanic()
    /usr/local/Cellar/go/1.16.5/libexec/src/runtime/signal_unix.go:718 +0x2ef
runtime.asmcgocall(0x10, 0x4416b60)
    /usr/local/Cellar/go/1.16.5/libexec/src/runtime/asm_amd64.s:671 +0x70

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x43bb390, 0xc000691ac8, 0x4)
    /usr/local/Cellar/go/1.16.5/libexec/src/runtime/cgocall.go:154 +0x5b fp=0xc000691a98 sp=0xc000691a60 pc=0x4005cfb
github.com/libretro/ludo/libretro._Cfunc_bridge_retro_audio_set_state(0x0, 0x4505701)
    _cgo_gotypes.go:402 +0x45 fp=0xc000691ac8 sp=0xc000691a98 pc=0x42a1d05
github.com/libretro/ludo/libretro.(*Core).SetAudioCallback.func2(0xac01)
    /Users/kivutar/ludo/libretro/libretro.go:839 +0x33 fp=0xc000691ae8 sp=0xc000691ac8 pc=0x42a62d3
github.com/libretro/ludo/core.LoadGame(0xc0034bbc80, 0x22, 0x1, 0x1a)
    /Users/kivutar/ludo/core/core.go:175 +0x437 fp=0xc000691c40 sp=0xc000691ae8 pc=0x43622d7
github.com/libretro/ludo/menu.gameExplorerCb(0xc0034bbc80, 0x22)
    /Users/kivutar/ludo/menu/scene_main.go:166 +0x4d fp=0xc000691cf0 sp=0xc000691c40 pc=0x439308d
github.com/libretro/ludo/menu.appendNode.func1()
    /Users/kivutar/ludo/menu/scene_explorer.go:104 +0x199 fp=0xc000691db8 sp=0xc000691cf0 pc=0x43a04d9
github.com/libretro/ludo/menu.genericInput(0xc0035ae5a0, 0x3c870c9a)
    /Users/kivutar/ludo/menu/input.go:92 +0x728 fp=0xc000691e10 sp=0xc000691db8 pc=0x43876a8
github.com/libretro/ludo/menu.(*sceneExplorer).update(0xc0035ae5a0, 0xa3c870c9a)
    /Users/kivutar/ludo/menu/scene_explorer.go:189 +0x39 fp=0xc000691e30 sp=0xc000691e10 pc=0x438e519
github.com/libretro/ludo/menu.(*Menu).Update(...)
    /Users/kivutar/ludo/menu/input.go:24
main.runLoop(0xc005e34000, 0xc0023e2140)
    /Users/kivutar/ludo/main.go:60 +0x40f fp=0xc000691eb8 sp=0xc000691e30 pc=0x43a54ef
main.main()
    /Users/kivutar/ludo/main.go:137 +0x5a5 fp=0xc000691f88 sp=0xc000691eb8 pc=0x43a5b05
runtime.main()
    /usr/local/Cellar/go/1.16.5/libexec/src/runtime/proc.go:225 +0x256 fp=0xc000691fe0 sp=0xc000691f88 pc=0x403a956
runtime.goexit()
    /usr/local/Cellar/go/1.16.5/libexec/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc000691fe8 sp=0xc000691fe0 pc=0x406dac1
kivutar commented 3 years ago

Doesn't happen in RetroArch