libretro / parallel-n64

Optimized/rewritten Nintendo 64 emulator made specifically for Libretro. Originally based on Mupen64 Plus.
309 stars 128 forks source link

Immediate segfault when loading any ROM #704

Closed matoro closed 3 years ago

matoro commented 3 years ago

Hi, I can't seem to get this core to load without immediately segfaulting, regardless of what ROM I use or how I compile. Any tips on what I'm missing?

$ gdb --args retroarch -v -L /usr/lib64/libretro/parallel_n64_libretro.so downloads/main.z64
GNU gdb (Gentoo 10.1 vanilla) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from retroarch...
Reading symbols from /usr/lib/debug//usr/bin/retroarch.debug...
(No debugging symbols found in /usr/lib/debug//usr/bin/retroarch.debug)
(gdb) r
Starting program: /usr/bin/retroarch -v -L /usr/lib64/libretro/parallel_n64_libretro.so downloads/main.z64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[INFO] [Overrides]: Redirecting save file to "/home/matoro/.config/retroarch/saves/main.srm".
[INFO] [Overrides]: Redirecting save state to "/home/matoro/.config/retroarch/saves/main.state".
[INFO] === Build =======================================
[INFO] CPU Model Name: AMD Ryzen 9 3950X 16-Core Processor            
[INFO] Capabilities:  MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE4.2 AES AVX AVX2
[INFO] Built: Nov 16 2020
[INFO] Version: 1.9.0
[INFO] =================================================
[New Thread 0x7ffff6d0a640 (LWP 32624)]
[INFO] [CORE]: Loading dynamic libretro core from: "/usr/lib64/libretro/parallel_n64_libretro.so"
[INFO] [Overrides]: No core-specific overrides found at /home/matoro/.config/retroarch/config/ParaLLEl N64/ParaLLEl N64.cfg.
[INFO] [Overrides]: No content-dir-specific overrides found at /home/matoro/.config/retroarch/config/ParaLLEl N64/.cfg.
[INFO] [Overrides]: No game-specific overrides found at /home/matoro/.config/retroarch/config/ParaLLEl N64/main.cfg.
[INFO] [Environ]: SET_VARIABLES.
[INFO] [Environ]: SET_CONTROLLER_INFO.
[INFO] [Remaps]: remap directory: /home/matoro/.config/retroarch/config/remaps
[INFO] [Overrides]: Redirecting save file to "/home/matoro/.config/retroarch/saves/ParaLLEl N64/main.srm".
[INFO] [Overrides]: Redirecting save state to "/home/matoro/.config/retroarch/saves/ParaLLEl N64/main.state".
[INFO] [Environ]: GET_LOG_INTERFACE.
[INFO] [Environ]: GET_PERF_INTERFACE.
[INFO] [Environ]: SET_PIXEL_FORMAT: XRGB8888.
[INFO] [Environ]: GET_RUMBLE_INTERFACE.
[INFO] [Environ]: SET_SERIALIZATION_QUIRKS.
[INFO] [CONTENT LOAD]: Loading content file: downloads/main.z64.
[INFO] Did not find a valid content patch.
[INFO] [Environ]: SET_HW_RENDER.
[INFO] Requesting OpenGL context.
[libretro WARN] mupen64plus: No version number in 'Core' config section. Setting defaults.
[libretro INFO] EmuThread: M64CMD_ROM_OPEN
[libretro INFO] mupen64plus: Goodname: usb64 (unknown rom)
[libretro INFO] mupen64plus: Headername: usb64
[libretro INFO] mupen64plus: Name: usb64               
[libretro INFO] mupen64plus: MD5: BE34F046D33268ACEDE8F9CE549CB2DF
[libretro INFO] mupen64plus: CRC: fa6b70a4 66a891a8
[libretro INFO] mupen64plus: Imagetype: .z64 (native)
[libretro INFO] mupen64plus: Rom size: 2097152 bytes (or 2 Mb or 16 Megabits)
[libretro INFO] mupen64plus: Version: 1444
[libretro INFO] mupen64plus: Manufacturer: 0
[libretro INFO] mupen64plus: Country: Demo
[libretro INFO] EmuThread: M64CMD_ROM_GET_HEADER
[INFO] found_last_state_slot: #0
[INFO] [SRAM]: Skipping SRAM load..
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Cheats]: Load game-specific cheatfile: /home/matoro/.config/retroarch/cheats/ParaLLEl N64/main.cht
[INFO] [Audio]: Set audio input rate to: 44100.00 Hz.
[INFO] [Video]: Game FPS > Monitor FPS. Cannot rely on VSync.
[INFO] [Video]: Video @ 1920x1440
[INFO] [Video]: Using HW render, OpenGL driver forced.
[INFO] [Video]: "vulkan" saved as cached driver.
[INFO] [Video]: Forcing "gl" driver.
[New Thread 0x7fffa6207640 (LWP 32630)]
[New Thread 0x7fffa58c5640 (LWP 32631)]
[New Thread 0x7fffa50c4640 (LWP 32632)]
[New Thread 0x7fffa48c3640 (LWP 32633)]
[New Thread 0x7fff97fff640 (LWP 32634)]
[New Thread 0x7fff977fe640 (LWP 32635)]
[New Thread 0x7fff96ffd640 (LWP 32636)]
[New Thread 0x7fff967fc640 (LWP 32637)]
[New Thread 0x7fff95ffb640 (LWP 32638)]
[New Thread 0x7fff957fa640 (LWP 32639)]
[New Thread 0x7fff94ff9640 (LWP 32640)]
[New Thread 0x7fff73fff640 (LWP 32641)]
[New Thread 0x7fff737fe640 (LWP 32642)]
[New Thread 0x7fff72ffd640 (LWP 32643)]
[New Thread 0x7fff727fc640 (LWP 32644)]
[New Thread 0x7fff71ffb640 (LWP 32645)]
[New Thread 0x7fff717fa640 (LWP 32646)]
[New Thread 0x7fff70ff9640 (LWP 32647)]
[New Thread 0x7fff53fff640 (LWP 32648)]
[New Thread 0x7fff4bfff640 (LWP 32649)]
[New Thread 0x7fff537fe640 (LWP 32650)]
[New Thread 0x7fff52ffd640 (LWP 32651)]
[New Thread 0x7fff527fc640 (LWP 32652)]
[New Thread 0x7fff51ffb640 (LWP 32653)]
[New Thread 0x7fff517fa640 (LWP 32654)]
[New Thread 0x7fff50ff9640 (LWP 32655)]
[New Thread 0x7fff4b7fe640 (LWP 32656)]
[New Thread 0x7fff4affd640 (LWP 32657)]
[New Thread 0x7fff4a7fc640 (LWP 32658)]
[New Thread 0x7fff49ffb640 (LWP 32659)]
[New Thread 0x7fff497fa640 (LWP 32660)]
[New Thread 0x7fff48ff9640 (LWP 32661)]
[New Thread 0x7fff13fff640 (LWP 32662)]
[New Thread 0x7fff137fe640 (LWP 32663)]
[New Thread 0x7fff12ffd640 (LWP 32664)]
[New Thread 0x7fff127fc640 (LWP 32665)]
[New Thread 0x7fff11ffb640 (LWP 32666)]
[New Thread 0x7fff117fa640 (LWP 32667)]
[New Thread 0x7fff10ff9640 (LWP 32670)]
[INFO] [GL]: Found GL context: x
[INFO] [GL]: Detecting screen resolution 3440x1440.
[INFO] [GLX]: Window manager is i3.
[INFO] [GLX]: X = 0, Y = 0, W = 1920, H = 1440.
[New Thread 0x7ffef3fff640 (LWP 32671)]
[INFO] [GLX]: Creating shared HW context.
[New Thread 0x7ffef37fe640 (LWP 32672)]
[INFO] [GLX]: Found swap function: glXSwapIntervalEXT.
[INFO] [GLX]: glXSwapInterval(0)
[INFO] [GL]: Vendor: X.Org, Renderer: AMD Radeon RX 5700 XT (NAVI10, DRM 3.39.0, 5.9.7, LLVM 10.0.1).
[INFO] [GL]: Version: 4.6 (Compatibility Profile) Mesa 20.2.2.
[INFO] [GL]: Using resolution 2419x1380
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[INFO] [GLSL]: Checking GLSL shader support ...
[WARN] [GL]: Stock GLSL shaders will be used.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] Setting up menu pipeline shaders for XMB ... 
[INFO] [GLSL]: Compiling ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling simple ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling modern snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling bokeh shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snowflake shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 1 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [GL]: Initializing HW render (1024 x 1024).
[INFO] [GL]: Max texture size: 16384 px, renderbuffer size: 16384 px.
[INFO] [GL]: Supports FBO (render-to-texture).
[INFO] [udev]: Pad #0 (/dev/input/event2) supports force feedback.
[INFO] [udev]: Pad #0 (/dev/input/event2) supports 16 force feedback effects.
[INFO] [udev]: Pad #1 (/dev/input/event27) supports force feedback.
[INFO] [udev]: Pad #1 (/dev/input/event27) supports 16 force feedback effects.
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Font]: Using font rendering backend: bitmap.
[INFO] [X11]: Suspending screensaver (X11, xdg-screensaver).
[Detaching after vfork from child process 32673]
[INFO] [Video]: Found display server: x11
context_reset.
ReadSpecialSettings: DEFAULT
plugin_start_gfx success.
[INFO] [Environ]: SET_INPUT_DESCRIPTORS:
[libretro INFO] EmuThread: M64CMD_EXECUTE.
Gfx RomOpen.
ReadSpecialSettings: DEFAULT
ReadSpecialSettings: usb64
[libretro INFO] Detected RDRAM size: 007fffff
GL_ARB_texture_non_power_of_two supported.
GL_EXT_texture_format_BGRA8888 supported.
GL_ARB_texture_non_power_of_two supported.
GL_EXT_texture_format_BGRA8888 supported.
[New Thread 0x7ffef2ffd640 (LWP 32716)]
[INFO] [ALSA]: Using signed 16-bit format.
[INFO] [ALSA]: Period size: 6144 frames
[INFO] [ALSA]: Buffer size: 24576 frames
[INFO] [ALSA]: Can pause: yes.
[INFO] [Display]: Found display driver: "gl".
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[INFO] [Environ]: SET_SUBSYSTEM_INFO.
[INFO] [Display]: Found display driver: "gl".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/seq/seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: Permission denied
[ERROR] [MIDI]: snd_seq_open failed with error -13.
[ERROR] [MIDI]: Initialization failed (list of input devices unavailable).
[INFO] Disconnecting device from port 3.
[INFO] Disconnecting device from port 4.
[INFO] Disconnecting device from port 5.
[INFO] Disconnecting device from port 6.
[INFO] Disconnecting device from port 7.
[INFO] Disconnecting device from port 8.
[INFO] Disconnecting device from port 9.
[INFO] Disconnecting device from port 10.
[INFO] Disconnecting device from port 11.
[INFO] Disconnecting device from port 12.
[INFO] Disconnecting device from port 13.
[INFO] Disconnecting device from port 14.
[INFO] Disconnecting device from port 15.
[INFO] Disconnecting device from port 16.
[New Thread 0x7ffef23fc640 (LWP 32717)]
[INFO] [Playlist]: Loading history file: [/home/matoro/.config/retroarch/content_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/matoro/.config/retroarch/content_music_history.lpl].
[INFO] [Playlist]: Loading history file: [/home/matoro/.config/retroarch/content_image_history.lpl].
[INFO] [Playlist]: Loading favorites file: [/home/matoro/.config/retroarch/content_favorites.lpl].
[INFO] [GL]: VSync => off
[INFO] [GLX]: glXSwapInterval(0)
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] [Font]: Failed to create rendering backend: freetype.
[ERROR] [Font]: Failed to create rendering backend: stb-unicode.
[INFO] [Font]: Using font rendering backend: bitmap.
[libretro INFO] mupen64plus: Starting R4300 emulator: Dynamic Recompiler

Thread 1 "retroarch" received signal SIGSEGV, Segmentation fault.
0x00007fffec281cc5 in DrawFrameBufferToScreen (fb_info=0x7fffabfb60e0) at glide2gl/src/Glide64/Framebuffer_glide64.c:884
884 glide2gl/src/Glide64/Framebuffer_glide64.c: No such file or directory.
(gdb) bt full
#0  0x00007fffec281cc5 in DrawFrameBufferToScreen (fb_info=0x7fffabfb60e0) at glide2gl/src/Glide64/Framebuffer_glide64.c:884
        col = 114688
        idx = 0
        tex = 0x7ffff4c911e0 <tex1>
        dst = 0x7ffff4c911e0 <tex1>
        src = 0x80008d7dd680
        bound = 404715104
        x = 0
        y = 0
        width = 320
        height = 240
        texwidth = 512
        image = 0x80008d7dd680 <error: Cannot access memory at address 0x80008d7dd680>
        tmu = 32767
        scale = 0.5
        t_info = {smallLodLog2 = 9, largeLodLog2 = 9, aspectRatioLog2 = 1, format = 32767, width = -316062544, height = 32767, data = 0x43700000ed294480}
#1  0x00007fffec2831e4 in drawViRegBG () at glide2gl/src/Glide64/Framebuffer_glide64.c:1206
        drawn = false
        fb_info = {addr = 2684495488, size = 3, width = 320, height = 240, ul_x = 0, ul_y = 0, lr_x = 319, lr_y = 239, opaque = 1}
#2  0x00007fffec288740 in glide64UpdateScreen () at glide2gl/src/Glide64/glidemain.c:657
        forced_update = false
        width = 640
#3  0x00007fffec229471 in vi_vertical_interrupt_event (vi=0x7fffedfcde08 <g_dev+11784>) at mupen64plus-core/src/vi/vi_controller.c:149
No locals.
#4  0x00007fffec2130ba in gen_interrupt () at mupen64plus-core/src/r4300/interrupt.c:548
No locals.
#5  0x00007fff700edb0f in ?? ()
No symbol table info available.
#6  0x00007fffedfcb084 in g_dev () from /usr/lib64/libretro/parallel_n64_libretro.so
No symbol table info available.
#7  0x0000000000000000 in ?? ()
No symbol table info available
matoro commented 3 years ago

Actually scratch that, it only seems to be crashing on test ROMs. Running it on a real game worked.