libretro-mirrors / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us in #ppsspp on freenode (IRC) or just send pull requests / issues. For discussion use the forums on ppsspp.org.
https://www.ppsspp.org
Other
11 stars 3 forks source link

Segfault on startup #12

Open ghost opened 7 years ago

ghost commented 7 years ago

Using commit 37689d4 on latest RetroArch, arch linux x64 with ASAN/UBSAN enabled, trying to load Katamari from an ISO.

$ ./retroarch -L ../ppsspp/libretro/ppsspp_libretro.so ~/roms/psp/a-katama.iso
[INFO] Loading dynamic libretro core from: "/home/bp/RetroArch-bp/ppsspp/libretro/ppsspp_libretro.so"
[INFO] [overrides] no core-specific overrides found at /home/bp/.config/retroarch/config/PPSSPP/PPSSPP.cfg.
[INFO] [overrides] no game-specific overrides found at /home/bp/.config/retroarch/config/PPSSPP/a-katama.cfg.
[INFO] Shaders: preset directory: /home/bp/.config/retroarch/shaders/presets
[INFO] Shaders: no game-specific preset found at /home/bp/.config/retroarch/shaders/presets/PPSSPP/a-katama.cgp.
[INFO] Shaders: no game-specific preset found at /home/bp/.config/retroarch/shaders/presets/PPSSPP/a-katama.glslp.
[INFO] Shaders: no core-specific preset found at /home/bp/.config/retroarch/shaders/presets/PPSSPP/PPSSPP.cgp.
[INFO] Shaders: no core-specific preset found at /home/bp/.config/retroarch/shaders/presets/PPSSPP/PPSSPP.glslp.
[INFO] Environ SET_VARIABLES.
[INFO] Remaps: remap directory: /home/bp/.config/retroarch/config/remaps
[INFO] Remaps: no game-specific remap found at /home/bp/.config/retroarch/config/remaps/PPSSPP/a-katama.rmp.
[INFO] Remaps: no core-specific remap found at /home/bp/.config/retroarch/config/remaps/PPSSPP/PPSSPP.rmp.
[INFO] Redirecting save file to "/home/bp/saves/saves/PPSSPP/a-katama.srm".
[INFO] Redirecting savestate to "/home/bp/saves/states/a-katama.state".
[INFO] Environ GET_LOG_INTERFACE.
[WARN] SYSTEM DIR is empty, assume CONTENT DIR /home/bp/roms/psp/a-katama.iso
[INFO] Environ SYSTEM_DIRECTORY: "/home/bp/roms/psp/".
[INFO] Content loading skipped. Implementation will load it on its own.
[INFO] Environ SET_INPUT_DESCRIPTORS:
[INFO]  RetroPad, User 1, Button "B (bottom)" => "Cross"
[INFO]  RetroPad, User 1, Button "Y (left)" => "Square"
[INFO]  RetroPad, User 1, Button "Select" => "Select"
[INFO]  RetroPad, User 1, Button "Start" => "Start"
[INFO]  RetroPad, User 1, Button "D-Pad Up" => "D-Pad Up"
[INFO]  RetroPad, User 1, Button "D-Pad Down" => "D-Pad Down"
[INFO]  RetroPad, User 1, Button "D-Pad Left" => "D-Pad Left"
[INFO]  RetroPad, User 1, Button "D-Pad Right" => "D-Pad Right"
[INFO]  RetroPad, User 1, Button "A (right)" => "Circle"
[INFO]  RetroPad, User 1, Button "X (up)" => "Triangle"
[INFO]  RetroPad, User 1, Button "L" => "L"
[INFO]  RetroPad, User 1, Button "R" => "R"
[INFO] Environ SET_PIXEL_FORMAT: XRGB8888.
[INFO] Environ SET_HW_RENDER.
[INFO] Requesting OpenGL context.
[INFO] Environ GET_USERNAME: "bp".
[INFO] Environ GET_VARIABLE ppsspp_internal_resolution:
[INFO]  480x272
[INFO] Environ GET_VARIABLE ppsspp_output_resolution:
[INFO]  480x272
[INFO] Environ GET_VARIABLE ppsspp_button_preference:
[INFO]  cross
[INFO] Environ GET_VARIABLE ppsspp_fast_memory:
[INFO]  enabled
[INFO] Environ GET_VARIABLE ppsspp_vertex_cache:
[INFO]  enabled
[INFO] Environ GET_VARIABLE ppsspp_gpu_hardware_transform:
[INFO]  enabled
[INFO] Environ GET_VARIABLE ppsspp_frameskip:
[INFO]  0
[INFO] Environ GET_VARIABLE ppsspp_audio_latency:
[INFO]  0
[INFO] Environ GET_VARIABLE ppsspp_framerate_limit:
[INFO]  0
[INFO] Environ GET_VARIABLE ppsspp_language:
[INFO]  automatic
[INFO] Environ GET_LANGUAGE: "0".
[INFO] Environ GET_VARIABLE ppsspp_auto_frameskip:
[INFO]  disabled
[INFO] Environ GET_VARIABLE ppsspp_block_transfer_gpu:
[INFO]  enabled
[INFO] Environ GET_VARIABLE ppsspp_texture_scaling_type:
[INFO]  xbrz
[INFO] Environ GET_VARIABLE ppsspp_texture_scaling_level:
[INFO]  1
[INFO] Environ GET_VARIABLE ppsspp_internal_shader:
[INFO]  off
[INFO] Environ GET_VARIABLE ppsspp_texture_anisotropic_filtering:
[INFO]  off
[INFO] Environ GET_VARIABLE ppsspp_texture_deposterize:
[INFO]  disabled
[INFO] Environ GET_VARIABLE ppsspp_separate_io_thread:
[INFO]  disabled
[INFO] Environ GET_VARIABLE ppsspp_unsafe_func_replacements:
[INFO]  enabled
[INFO] Environ GET_VARIABLE ppsspp_sound_speedhack:
[INFO]  disabled
[INFO] Environ GET_VARIABLE ppsspp_cpu_core:
[INFO]  jit
[INFO] Environ GET_VARIABLE ppsspp_locked_cpu_speed:
[INFO]  off
[INFO] Environ GET_VARIABLE ppsspp_rendering_mode:
[INFO]  buffered
[INFO] Environ GET_VARIABLE ppsspp_force_max_fps:
[INFO]  disabled
[INFO] Environ GET_VARIABLE ppsspp_threaded_input:
[INFO]  disabled
[INFO] CHEEVOS system RAM: (nil) 0
[INFO] CHEEVOS save RAM:   (nil) 0
[INFO] CHEEVOS video RAM:  (nil) 0
[INFO] [INFO] Skipping SRAM load..
CHEEVOS RTC:        (nil) 0
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[INFO] [Audio]: Set audio input rate to: 44100.00 Hz.
[INFO] Found shader "/home/bp/.config/retroarch/shaders/retroarch.glslp"
[INFO] [Video]: Video @ fullscreen
[INFO] [Video]: Using HW render, OpenGL driver forced.
[ERROR] [Wayland]: Failed to connect to Wayland server.
[INFO] [GLX]: GLX_OML_sync_control and GLX_MESA_swap_control supported, using better swap control method...
[INFO] [GL]: Found GL context: x
[INFO] [GL]: Detecting screen resolution 2160x3840.
[INFO] [XINERAMA]: Xinerama version: 1.1.
[INFO] [XINERAMA]: Xinerama screens: 1.
[INFO] [GLX]: Using Xinerama on screen #0.
[INFO] [GLX]: X = 0, Y = 0, W = 2160, H = 3840.
[INFO] [GLX]: Using windowed fullscreen.
[INFO] [GLX]: Found swap function: glXSwapIntervalEXT.
[INFO] [GLX]: glXSwapIntervalEXT(1)
[INFO] [GL]: Vendor: Intel Open Source Technology Center, Renderer: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2) .
[INFO] [GL]: Version: 3.0 Mesa 17.1.8.
[INFO] [GL]: Using resolution 2160x3840
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[INFO] [GLSL]: Checking GLSL shader support ...
[INFO] Found #pragma parameter CRTCaligari Spot Width (SPOT_WIDTH) 0.900000 0.100000 1.500000 0.050000
[INFO] Found #pragma parameter CRTCaligari Spot Height (SPOT_HEIGHT) 0.650000 0.100000 1.500000 0.050000
[INFO] Found #pragma parameter CRTCaligari Color Boost (COLOR_BOOST) 1.450000 1.000000 2.000000 0.050000
[INFO] Found #pragma parameter CRTCaligari Input Gamma (InputGamma) 2.400000 0.000000 5.000000 0.100000
[INFO] Found #pragma parameter CRTCaligari Output Gamma (OutputGamma) 2.200000 0.000000 5.000000 0.100000
[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] [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] [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] [GL]: Using 1 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [GL]: Initializing HW render (512 x 512).
[INFO] [GL]: Max texture size: 16384 px, renderbuffer size: 16384 px.
[INFO] [GL]: Supports FBO (render-to-texture).
[INFO] [udev]: Plugged pad: Microsoft X-Box One S pad (1118:746) on port #0.
[INFO] [udev]: Pad #0 (/dev/input/event20) supports force feedback.
[INFO] [udev]: Pad #0 (/dev/input/event20) supports 16 force feedback effects.
[INFO] [Autoconf]: 229 profiles found.
[INFO] [Autoconf]: selected configuration: /home/bp/.config/retroarch/autoconfig/udev/Microsoft_X-Box_One_S_pad.cfg
[INFO] [Joypad]: Found joypad driver: "udev".
[INFO] [Font]: Using font rendering backend: freetype.
[ERROR] [DBus]: Failed to suspend screensaver via DBus.
[INFO] [X11]: Suspending screensaver (X11, xdg-screensaver).
[INFO] [PulseAudio]: Requested 24576 bytes buffer, got 18432.
[INFO] [Menu]: Found menu display driver: "menu_display_gl".
[INFO] Found #pragma parameter CRTCaligari Spot Width (SPOT_WIDTH) 0.900000 0.100000 1.500000 0.050000
[INFO] Found #pragma parameter CRTCaligari Spot Height (SPOT_HEIGHT) 0.650000 0.100000 1.500000 0.050000
[INFO] Found #pragma parameter CRTCaligari Color Boost (COLOR_BOOST) 1.450000 1.000000 2.000000 0.050000
[INFO] Found #pragma parameter CRTCaligari Input Gamma (InputGamma) 2.400000 0.000000 5.000000 0.100000
[INFO] Found #pragma parameter CRTCaligari Output Gamma (OutputGamma) 2.200000 0.000000 5.000000 0.100000
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Font]: Using font rendering backend: freetype.
[WARN] Input device ID 257 is unknown to this libretro implementation. Using RETRO_DEVICE_JOYPAD.
[INFO] Disconnecting device from port 3.
[INFO] Found #pragma parameter CRTCaligari Spot Width (SPOT_WIDTH) 0.900000 0.100000 1.500000 0.050000
[INFO] Found #pragma parameter CRTCaligari Spot Height (SPOT_HEIGHT) 0.650000 0.100000 1.500000 0.050000
[INFO] Found #pragma parameter CRTCaligari Color Boost (COLOR_BOOST) 1.450000 1.000000 2.000000 0.050000
[INFO] Found #pragma parameter CRTCaligari Input Gamma (InputGamma) 2.400000 0.000000 5.000000 0.100000
[INFO] Found #pragma parameter CRTCaligari Output Gamma (OutputGamma) 2.200000 0.000000 5.000000 0.100000
[INFO] Loading history file: [/home/bp/.config/retroarch/content_history.lpl].
[INFO] Loading history file: [/home/bp/.config/retroarch/content_favorites.lpl].
[INFO] Loading history file: [/home/bp/.config/retroarch/content_music_history.lpl].
[INFO] Loading history file: [/home/bp/.config/retroarch/content_image_history.lpl].
[INFO] [GL]: VSync => on
[INFO] [GLX]: glXSwapIntervalEXT(1)
[INFO] Trying to write to playlist file: /home/bp/.config/retroarch/content_history.lpl
I: gpu_features.cpp:136: GPU Vendor : Intel Open Source Technology Center ; renderer: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)  version str: 3.0 Mesa 17.1.8 ; GLSL version str: 1.30
I: thin3d_gl.cpp:282: Shader module created (0x607000486e40)
I: thin3d_gl.cpp:282: Shader module created (0x607000489060)
I: thin3d_gl.cpp:282: Shader module created (0x60700048b0c0)
I: thin3d_gl.cpp:282: Shader module created (0x60700048cbe0)
16:53:666 Core/System.cpp:407 I[BOOT]: PPSSPP v1.4.2-git
[libretro INFO] I PPSSPP v1.4.2-git
.
../Core/FileSystems/ISOFileSystem.cpp:65:8: runtime error: constructor call on misaligned address 0x7ffea08e1e72 for type 'struct u32_be', which requires 4 byte alignment
0x7ffea08e1e72: note: pointer points here
 00 00  15 00 00 00 00 00 00 00  50 1f 8e a0 fe 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^ 
../Common/Swap.h:121:2: runtime error: reference binding to misaligned address 0x7ffea08e1e72 for type 'struct <unknown>', which requires 4 byte alignment
0x7ffea08e1e72: note: pointer points here
 00 00  15 00 00 00 00 00 00 00  50 1f 8e a0 fe 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^ 
../Common/Swap.h:121:30: runtime error: member access within misaligned address 0x7ffea08e1e72 for type 'struct swap_struct_t', which requires 4 byte alignment
0x7ffea08e1e72: note: pointer points here
 00 00  15 00 00 00 00 00 00 00  50 1f 8e a0 fe 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00
              ^ 
../Core/FileSystems/ISOFileSystem.cpp:65:8: runtime error: constructor call on misaligned address 0x7ffea08e1e7a for type 'struct u32_be', which requires 4 byte alignment
0x7ffea08e1e7a: note: pointer points here
 00 00  50 1f 8e a0 fe 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  0d 36 a7 b5 d1 7f
              ^ 
16:53:668 Core/MemMap.cpp:291 I[MEMMAP]: Memory system initialized. Base at 0x2300000000 (RAM at @ 0x2308000000, uncached @ 0x2348000000)
[libretro INFO] I Memory system initialized. Base at 0x2300000000 (RAM at @ 0x2308000000, uncached @ 0x2348000000)
.
../Common/x64Emitter.h:364:46: runtime error: store to misaligned address 0x00004132b02f for type 'u32', which requires 4 byte alignment
0x00004132b02f: note: pointer points here
 0f 29 94 24 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00
             ^ 
../Common/x64Emitter.h:365:46: runtime error: store to misaligned address 0x000041e9508f for type 'u64', which requires 8 byte alignment
0x000041e9508f: note: pointer points here
 74 00 48 b8 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00
             ^ 
../Common/x64Emitter.cpp:511:26: runtime error: store to misaligned address 0x000041e950f5 for type 's32', which requires 4 byte alignment
0x000041e950f5: note: pointer points here
 eb 06 0f 88 00 00 00  00 41 8b 86 44 03 00 00  8b 44 03 00 8b d0 c1 ea  18 83 fa 68 75 0d 25 ff  ff
             ^ 
16:53:671 Core/PSPLoaders.cpp:193 I[LOADER]: ULUS10094 : Me & My Katamari
[libretro INFO] I ULUS10094 : Me & My Katamari
.
16:53:671 Core/Config.cpp:1350 I[LOADER]: Failed to read ULUS10094_ppsspp.ini. No game-specific settings found, using global defaults.
[libretro INFO] I Failed to read ULUS10094_ppsspp.ini. No game-specific settings found, using global defaults.
.
16:53:671 Core/PSPLoaders.cpp:251 I[LOADER]: Loading disc0:/PSP_GAME/SYSDIR/EBOOT.BIN...
[libretro INFO] I Loading disc0:/PSP_GAME/SYSDIR/EBOOT.BIN...
.
16:53:671 HLE/sceKernelMemory.cpp:434 I[SCEKERNEL]: Kernel and user memory pools initialized
[libretro INFO] I Kernel and user memory pools initialized
.
ASAN:DEADLYSIGNAL
=================================================================
==3230==ERROR: AddressSanitizer: SEGV on unknown address 0x0004e0ff8000 (pc 0x7fd1c8e5556c bp 0x7ffea08e1150 sp 0x7ffea08e08c0 T0)
==3230==The signal is caused by a READ memory access.
    #0 0x7fd1c8e5556b in AddressIsPoisoned /build/gcc/src/gcc/libsanitizer/asan/asan_mapping.h:320
    #1 0x7fd1c8e5556b in QuickCheckForUnpoisonedRegion /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:41
    #2 0x7fd1c8e5556b in __interceptor_memcpy /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:456
    #3 0x7fd1b529035c in Memory::Memcpy(unsigned int, void const*, unsigned int) ../Core/MemMapHelpers.h:35
    #4 0x7fd1b568c8d1 in __KernelThreadingInit() ../Core/HLE/sceKernelThread.cpp:928
    #5 0x7fd1b5530252 in __KernelInit() ../Core/HLE/sceKernel.cpp:110
    #6 0x7fd1b560888f in __KernelLoadReset() ../Core/HLE/sceKernelModule.cpp:1554
    #7 0x7fd1b5608c70 in __KernelLoadExec(char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) ../Core/HLE/sceKernelModule.cpp:1579
    #8 0x7fd1b5a32826 in Load_PSP_ISO(FileLoader*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) ../Core/PSPLoaders.cpp:252
    #9 0x7fd1b5880096 in LoadFile(FileLoader**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) ../Core/Loaders.cpp:287
    #10 0x7fd1b5a7143b in CPU_Init() ../Core/System.cpp:265
    #11 0x7fd1b5a73277 in PSP_InitStart(CoreParameter const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) ../Core/System.cpp:425
    #12 0x7fd1b5a7360c in PSP_Init(CoreParameter const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) ../Core/System.cpp:460
    #13 0x7fd1b5aaf5a3 in retro_run ../libretro/libretro.cpp:1195
    #14 0x5573c9415d31 in core_run /home/bp/RetroArch-bp/RetroArch/core_impl.c:415
    #15 0x5573c94224eb in runloop_iterate /home/bp/RetroArch-bp/RetroArch/retroarch.c:3093
    #16 0x5573c9411be6 in rarch_main frontend/frontend.c:131
    #17 0x5573c9411d3c in main frontend/frontend.c:151
    #18 0x7fd1c21734c9 in __libc_start_main (/usr/lib/libc.so.6+0x204c9)
    #19 0x5573c9406029 in _start (/home/bp/RetroArch-bp/RetroArch/retroarch+0x7b9029)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /build/gcc/src/gcc/libsanitizer/asan/asan_mapping.h:320 in AddressIsPoisoned
==3230==ABORTING
hrydgard commented 6 years ago

You should report this upstream, otherwise we'll never see it.

This case is curious, the struct is marked ``#pragma pack 1``` but contains things that ASAN apparently thinks must be aligned. However it works just fine without ASAN... or is supposed to, anyway - doesn't it?