1. Marianne Gagnon
  2. wxMupen64Plus
  3. Issues
Issue #97 resolved

Segmentation Fault on Linux When Opening Plugins Configuration

Anonymous created an issue

For whatever reason, wxMupen64Plus tries to use /usr/lib as my plugin director and complains about not finding any. Now, when I try to edit this in the GUI, trying to open the Plugins menu causes the program to segfault and crash without any terminal output.

Loading plugins from /usr/lib/ GFX <mupen64plus-video-rice.so> : /!\ Could not load Audio <mupen64plus-audio-sdl.so> : /!\ Could not load Input <mupen64plus-input-sdl.so> : /!\ Could not load RSP <mupen64plus-rsp-hle.so> : /!\ Could not load

[Config] Ignoring config section CoreEvents [Config] Ignoring config section UI-Console [1] 21712 segmentation fault wxmupen64plus

Changing the path in ~/.config/mupen64plus/mupen64plus.cfg does nothing.

Comments (10)

  1. ger_dumont

    The program also segfaults on me, but only if i hit the audio button. My os: Lubuntu 12.10 64 bit, here is my gdb output:

    (gdb) wxmupen64plus Undefined command: "wxmupen64plus". Try "help". (gdb) run Starting program: /usr/games/wxmupen64plus [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". _ _ _
    | \/ |
    _ _ __
    _
    / / | || | | _ \| | _ | |\/| | | | | ' \ / _ \ ' \| ' \| || || |) | | | | / |
    | | | | || | |) |
    / | | | (
    ) | _| /| | || _ \ || ||_,| ./ _|| ||___/ || || ||_,_|
    /
    |_| http://code.google.com/p/mupen64plus/

    [SDL_Helper_Start] 0 joysticks were found.

    [MupenfrontApp] Will look for resources in </usr/share/games/wxmupen64plus//> and librairies in </usr/lib/x86_64-linux-gnu/mupen64plus//> [MupenAPI] attached to core library 'Mupen64Plus Core' version 1.99.5 [MupenAPI] Includes support for Dynamic Recompiler. [MupenAPI] Includes support for MIPS r4300 Debugger. [New Thread 0x7fffe53a9700 (LWP 12268)] [MupenApiPP] Using video extension 'external' [Plugin] using Video plugin: 'Mupen64Plus OpenGL Video Plugin by Rice' v1.99.5 [Plugin] Video plugin library: /usr/lib/x86_64-linux-gnu/mupen64plus//mupen64plus-video-rice.so [Plugin] using Audio plugin: 'Mupen64Plus SDL Audio Plugin' v1.99.5 [Plugin] Audio plugin library: /usr/lib/x86_64-linux-gnu/mupen64plus//mupen64plus-audio-sdl.so [Core] Input: N64 Controller #1: Forcing default keyboard configuration [Core] Input: Using auto-configuration for device 'Keyboard' [Plugin] using Input plugin: 'Mupen64Plus SDL Input Plugin' v1.99.5 [Plugin] Input plugin library: /usr/lib/x86_64-linux-gnu/mupen64plus//mupen64plus-input-sdl.so [Plugin] using RSP plugin: 'Hacktarux/Azimer High-Level Emulation RSP Plugin' v1.99.5 [Plugin] RSP plugin library: /usr/lib/x86_64-linux-gnu/mupen64plus//mupen64plus-rsp-hle.so

    Loading plugins from /usr/lib/x86_64-linux-gnu/mupen64plus// GFX <mupen64plus-video-rice.so> : OK Audio <mupen64plus-audio-sdl.so> : OK Input <mupen64plus-input-sdl.so> : OK RSP <mupen64plus-rsp-hle.so> : OK

    [Config] Ignoring config section CoreEvents [New Thread 0x7fffdae15700 (LWP 12269)]

    Program received signal SIGSEGV, Segmentation fault. 0x00007ffff597383b in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (gdb)

    Hope this helps, Ger.

  2. C Krooß
    Program received signal SIGSEGV, Segmentation fault.
    0x000000000041906d in ?? ()
    (gdb) bt
    #0  0x000000000041906d in ?? ()
    #1  0x0000000000424770 in wxString::~wxString() ()
    #2  0x00007ffff53c31ef in __cxa_finalize () from /usr/lib/libc.so.6
    #3  0x00007fffc9b29113 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
    #4  0x00007fffffffb890 in ?? ()
    #5  0x00007ffff7dee68f in _dl_close_worker () from /lib64/ld-linux-x86-64.so.2
    Backtrace stopped: frame did not save the PC
    
  3. computerquip

    After about an hour of stepping through the code, I've found that it segfaults on the 75th iteration of the for loop on line 107 of parameterpanel.cpp. It then successfully calls PluginTryGetInfo, who realizes that the library passed is not a valid plugin. PluginTryGetInfo then calls osal_dynlib_close who then calls dlclose and crashes.

    I'm still unsure the reason for why it's crashing, the handle passed seems to be valid.

  4. computerquip

    So, I have a question for everyone that is having this issue. Look inside of /usr/lib and see if you have the following file: "libwx_gtk2u_svg-2.8.so"

    After removing this file, I can open the plugins menu. I suspect it has something to do with how dlopen is called to open this file.

  5. computerquip

    As a counter, I'd say iterating through every single library is a bad idea. I would standardize a location (specifically, "/usr/lib/mupen64plus" seems to be pretty standard) to put the plugins in and just browse through those. This would be plenty faster as well.

    This seems to be an error on wxWidget's end.

    EDIT: I'll add that you can change the plugins directory default by passing "--pluginsdir=" when you build it.

  6. computerquip

    I didn't really explain how this was an error on wxWidget's behalf.

    Well, here's one key: http://trac.wxwidgets.org/ticket/14378

    My guess is that when dlopen is called to open the library, dlopen also opens dependency libraries. Strangely enough, it doesn't initialize core but calls on finalization code (which is what __cxa_finalize does (http://refspecs.linux-foundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---cxa-finalize.html)). This finalization code is what crashes probably because some destructor of an object that doesn't exist is called or deletion of a non-existant item since initialization never occurred.

    It's unfortunately... confusing to say the least: https://blogs.oracle.com/rie/entry/init_and_fini_processing_who

  7. Log in to comment