Segfault when processing plugins

Help
kjirki
2009-04-03
2013-04-22
  • kjirki
    kjirki
    2009-04-03

    I have a problem with the newly released 1.10 version on AMD64-platform running Ubuntu 8.10 (64bit).

    I compiled the program as instructed and installed it to /usr/local. However, the program segfaults when starting to process the plugins (i.e. the last line output is 'Now processing plugin xxxx'). If the program cannot find the plugins (if I remove them or temporarily move to some place else before starting pcsx-df) it starts up just fine and i get the gui window. Then when I set the plugin path through the menus it crashes instantly with the same message before the segfault.

    I can post the whole output here later when I get home.

     
    • kjirki
      kjirki
      2009-04-04

      Below is the output when run through valgrind. The first problem seems to occur inside dlopen() (in SysLoadLibrary), but I have no idea why or how.

      kjirki@ubuntu:~$ valgrind /usr/local/bin/pcsx
      ==6745== Memcheck, a memory error detector.
      ==6745== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
      ==6745== Using LibVEX rev 1854, a library for dynamic binary translation.
      ==6745== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
      ==6745== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework.
      ==6745== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
      ==6745== For more details, rerun with: -v
      ==6745==
      pcsx_gui_prefs_init starting...
      Error retrieving integer UI option bios-loadcdbios - Key file does not have key 'loadcdbios'
      Error retrieving string UI option plugin-gpu - Key file does not have group 'plugin'
      Error retrieving string UI option plugin-spu - Key file does not have group 'plugin'
      Error retrieving string UI option plugin-pad1 - Key file does not have group 'plugin'
      Error retrieving string UI option plugin-pad2 - Key file does not have group 'plugin'
      Error retrieving string UI option plugin-cdr - Key file does not have group 'plugin'
      Error retrieving integer UI option cpu-xa - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-sio - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-mdec - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-psxauto - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-psxtype - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-cdda - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-cpu - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-dbg - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-psxout - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-spuirq - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-rcntfix - Key file does not have group 'cpu'
      Error retrieving integer UI option cpu-vsyncwa - Key file does not have group 'cpu'
      Error retrieving string UI option memcard-memcard1 - Key file does not have group 'memcard'
      Error retrieving string UI option memcard-memcard2 - Key file does not have group 'memcard'
      pcsx_gui_prefs_init finished
      Scanning /usr/local/lib/games/psemu for plugins
        Reading file libDFInput.so.0.0.1
        Reading file libDFInput.so.0
        Reading file libDFInput.so
        Symlinking file libDFInput.so
        Error - 17 File exists
        Reading file libDFInput.la
        Reading file cfgDFInput
        Symlinking file cfgDFInput
        Error - 17 File exists
        Reading file libDFInput.a
        Reading file libDFSound.so
        Symlinking file libDFSound.so
        Error - 17 File exists
        Reading file libDFSound.la
        Reading file cfgDFSound
        Symlinking file cfgDFSound
        Error - 17 File exists
        Reading file libDFSound.a
        Reading file libDFXVideo.so
        Symlinking file libDFXVideo.so
        Error - 17 File exists
        Reading file libDFXVideo.la
        Reading file cfgDFXVideo
        Symlinking file cfgDFXVideo
        Error - 17 File exists
        Reading file libDFXVideo.a
        Reading file libDFCdrom.so
        Symlinking file libDFCdrom.so
        Error - 17 File exists
        Reading file libDFCdrom.la
        Reading file cfgDFCdrom
        Symlinking file cfgDFCdrom
        Error - 17 File exists
        Reading file libDFCdrom.a
        Reading file libDFIso.so
        Symlinking file libDFIso.so
        Error - 17 File exists
        Reading file libDFIso.la
        Reading file cfgDFIso
        Symlinking file cfgDFIso
        Error - 17 File exists
        Reading file libDFIso.a
        Reading file libdfOpenGL.so.0.0.0
        Reading file libdfOpenGL.so.0
        Reading file libdfOpenGL.so
        Symlinking file libdfOpenGL.so
        Comparing target of existing symlink (/usr/local/lib/games/psemu/libdfOpenGL.so) to new target (/usr/local/lib/games/psemu/libdfOpenGL.so)
        Reading file libdfOpenGL.la
        Reading file cfgDFOpenGL
        Symlinking file cfgDFOpenGL
        Comparing target of existing symlink (/usr/local/lib/games/psemu/cfgDFOpenGL) to new target (/usr/local/lib/games/psemu/cfgDFOpenGL)
        Reading file libdfOpenGL.a
        Reading file libDFBinImage2.so
        Symlinking file libDFBinImage2.so
        Comparing target of existing symlink (/usr/local/lib/games/psemu/libDFBinImage2.so) to new target (/usr/local/lib/games/psemu/libDFBinImage2.so)
        Reading file libDFBinImage2.la
        Reading file libDFBinImage2.a
      Created memory cards
      Loading memory card /home/kjirki/.pcsx/memcards/card1.mcd
      Loading memory card /home/kjirki/.pcsx/memcards/card1.mcd
      Loaded memory cards
      Opening directory /usr/local/lib/games/psemu
      Now processing plugin file /usr/local/lib/games/psemu/libDFIso.so
      ==6745== Conditional jump or move depends on uninitialised value(s)
      ==6745==    at 0x800C523: __strcat_chk (in /lib/libc-2.8.90.so)
      ==6745==    by 0x40E68F: scan_plugins_dir (string3.h:145)
      ==6745==    by 0x408E71: main (LnxMain.c:171)
      Now processing plugin file /usr/local/lib/games/psemu/libdfOpenGL.so.0.0.0
      Now processing plugin file /usr/local/lib/games/psemu/libDFInput.so.0
      Now processing plugin file /usr/local/lib/games/psemu/libdfOpenGL.so.0
      Now processing plugin file /usr/local/lib/games/psemu/libDFBinImage2.so
      Now processing plugin file /usr/local/lib/games/psemu/libDFXVideo.so
      Now processing plugin file /usr/local/lib/games/psemu/libDFInput.so
      Now processing plugin file /usr/local/lib/games/psemu/libDFCdrom.so
      Now processing plugin file /usr/local/lib/games/psemu/libdfOpenGL.so
      Now processing plugin file /usr/local/lib/games/psemu/libDFInput.so.0.0.1
      Now processing plugin file /usr/local/lib/games/psemu/libDFSound.so
      ==6745==
      ==6745== Invalid write of size 1
      ==6745==    at 0x4C27BC8: memset (mc_replace_strmem.c:493)
      ==6745==    by 0x7C881CB: recInit (string3.h:85)
      ==6745==    by 0x408B0B: SysInit (LnxMain.c:234)
      ==6745==    by 0x408E7F: main (LnxMain.c:174)
      ==6745==  Address 0xffffffffffffffff is not stack'd, malloc'd or (recently) free'd
      ==6745==
      ==6745== Process terminating with default action of signal 11 (SIGSEGV)
      ==6745==  Access not within mapped region at address 0xFFFFFFFFFFFFFFFF
      ==6745==    at 0x4C27BC8: memset (mc_replace_strmem.c:493)
      ==6745==    by 0x7C881CB: recInit (string3.h:85)
      ==6745==    by 0x408B0B: SysInit (LnxMain.c:234)
      ==6745==    by 0x408E7F: main (LnxMain.c:174)
      ==6745==
      ==6745== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 306 from 2)
      ==6745== malloc/free: in use at exit: 2,660,060 bytes in 5,460 blocks.
      ==6745== malloc/free: 14,044 allocs, 8,584 frees, 3,780,899 bytes allocated.
      ==6745== For counts of detected errors, rerun with: -v
      ==6745== searching for pointers to 5,460 not-freed blocks.
      ==6745== checked 2,794,768 bytes.
      ==6745==
      ==6745== LEAK SUMMARY:
      ==6745==    definitely lost: 7,892 bytes in 76 blocks.
      ==6745==      possibly lost: 46,970 bytes in 65 blocks.
      ==6745==    still reachable: 2,605,198 bytes in 5,319 blocks.
      ==6745==         suppressed: 0 bytes in 0 blocks.
      ==6745== Rerun with --leak-check=full to see details of leaked memory.
      Segmentation fault

       
    • Andrew Burton
      Andrew Burton
      2009-04-14

      Have raised this as a bug (SF 2761380) so it doesn't get lost in the forums:

      https://sourceforge.net/tracker/?func=detail&aid=2761380&group_id=204268&atid=988931

       
    • Andrew Burton
      Andrew Burton
      2009-04-19

      Fixed in CVS - the LoadPlugins function returned a value which wasn't being checked prior to opening the CD/image, so as a result segfaulted.

      Also fixed an issue with the incorrect .so files being symlinked and available in the configuration window's combobox.