Segfault after making savestate. pcsxr-89840

Developer
Apr 9, 2014 at 11:23 PM
Edited Apr 9, 2014 at 11:29 PM
Hello Everyone,

After i make a savestate when using the GL plugin a few seconds after that the emulator segfaults.

Tested on Slackware 14 64bit pcsxr-89840 with scph1001. Nvidia Driver 33138.

BTW: I can't get the picture to show up for savestates with the Xvideo plugin does it work
with it?
Developer
Apr 10, 2014 at 6:55 PM
Hmm I cannot get it to crash. Try to debug it if you can.

And xvideo plugin does not have save state pic implemented.
Developer
Apr 10, 2014 at 9:33 PM
Edited Apr 10, 2014 at 9:38 PM
Hello Ckain,

I tried to debug it.

(gdb) run
Starting program: /usr/bin/pcsxr
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.3600.4-gdb.py", line 9, in <module>
from gobject import register
File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
import gdb.backtrace
ImportError: No module named backtrace
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
  • Running PCSXR Version 1.9.95 (Apr 9 2014).
  • Loading memory card /home/owner/.pcsxr/memcards/Card 1A.mcd
  • Loading memory card /home/owner/.pcsxr/memcards/Card 3M.mcd
    [New Thread 0x7fffe5e83700 (LWP 5351)]
    [New Thread 0x7fffe5682700 (LWP 5352)]
    [New Thread 0x7fffe4e81700 (LWP 5353)]
    [New Thread 0x7fffdffff700 (LWP 5354)]
    [New Thread 0x7fffdf7fe700 (LWP 5356)]
    [Thread 0x7fffe5682700 (LWP 5352) exited]
    [New Thread 0x7fffe5682700 (LWP 5360)]
    [Thread 0x7fffe5e83700 (LWP 5351) exited]
    [New Thread 0x7fffe5e83700 (LWP 5364)]
    [New Thread 0x7fffdeffd700 (LWP 5365)]
    [Thread 0x7fffe5e83700 (LWP 5364) exited]
    [Thread 0x7fffe5682700 (LWP 5360) exited]
[Thread 0x7fffe5682700 (LWP 5366) exited]
[New Thread 0x7fffc8ff1700 (LWP 5383)]
  • Saved state /home/owner/.pcsxr/sstates/PLAYSTATION-SLUS00553.000.
    [New Thread 0x7fffbbd98700 (LWP 5384)]
    [Thread 0x7fffdeffd700 (LWP 5365) exited]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffbbd98700 (LWP 5384)]
0x00007fffde7d5f29 in glDisable () from /usr/lib64/../lib64/libGL.so.1
(gdb)
Developer
Apr 10, 2014 at 9:47 PM
Edited Apr 10, 2014 at 9:49 PM
Hello Ckain,

Here is a backtrace.

(gdb) bt

0 #0 0x00007fffd6fd6f29 in glDisable () from /usr/lib64/../lib64/libGL.so.1
1 #1 0x00007fffbfdb6a6a in DestroyPic () at menu.c:1310
2 #2 0x00007fffbfdb3a89 in GPUshowScreenPic (pMem=0x0) at gpu.c:3570
3 #3 0x000000000040839a in gpuHidePic () at Plugin.c:53
4 #4 HidePicAfter (param=<optimized out>) at Plugin.c:70
5 #5 0x00007ffff1b5ace2 in start_thread () from /lib64/libpthread.so.0
6 #6 0x00007fffed65aabd in clone () from /lib64/libc.so.6
Developer
Apr 11, 2014 at 7:08 AM
Edited Apr 11, 2014 at 7:09 AM
Since pMem is null, try to move that if from gpu.c:3571 one line (before DestroyPic()) and see if it makes any difference...

And then remember to update libpeopsxgl.so via sudo make install
Developer
Apr 11, 2014 at 8:21 AM
Edited Apr 11, 2014 at 8:22 AM
Hello Ckain,

One problem. While doing that fixes the GL plugin, this also effects the gpuBladeSoft as well.
Developer
Apr 16, 2014 at 6:50 AM
Edited Apr 16, 2014 at 2:16 PM
Hello Everyone,

Here is a back trace from pcsxr-89981 with gpuBladeSoft after making a savestate.


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc6ffe700 (LWP 14990)]
0x00007fffd5f43169 in glDeleteTextures () from /usr/lib64/../lib64/libGL.so.1
(gdb) bt
0 #0 0x00007fffd5f43169 in glDeleteTextures ()
from /usr/lib64/../lib64/libGL.so.1
1 #1 0x00007fffd621cc62 in textureClose(int) ()
from /home/owner/.pcsxr/plugins//libgpuBladeSoft.so
2 #2 0x00007fffd6219b24 in gpuShowScreenPic(unsigned char*) ()
from /home/owner/.pcsxr/plugins//libgpuBladeSoft.so
3 #3 0x000000000040838a in gpuHidePic () at Plugin.c:53
4 #4 HidePicAfter (param=<optimized out>) at Plugin.c:70
5 #5 0x00007ffff1b5ace2 in start_thread () from /lib64/libpthread.so.0
6 #6 0x00007fffed65aabd in clone () from /lib64/libc.so.6
Developer
Apr 16, 2014 at 6:26 PM
My hunch is that since hiding is done from another thread it has a side effect. However I don't understand why I cannot get it to crash. Try to make the call from single thread and see how it behaves.
Developer
Apr 16, 2014 at 6:43 PM
Hello Ckain,

Well i don't know how to make a call from a single thread. Can you explain how to do this?
Developer
Apr 17, 2014 at 11:55 AM
Please try this patch: http://pastebin.com/8dcRdM36
Developer
Apr 17, 2014 at 2:37 PM
Hello Ckain,

Yeah that patch seems to fix the problem with both plugins.