SuperSaiyanWolverine / mupen64plus

Automatically exported from code.google.com/p/mupen64plus
0 stars 0 forks source link

Crash from write permissions with no useful information #410

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe your system:
 - Arch Linux
 - 64 bit
 - Version 1.99.4
 - OpenGL and SDL

Describe the problem:
/home/username/.local/share/mupen64plus/ was owned by root. Rather than give 
any indication of the problem, the emulator would simply crash with a 
Segmentation Fault. Backtrace was as followed:

#0  0x00007ffff76dd5b2 in strlen () from /lib/libc.so.6
#1  0x00007ffff5111350 in dma_pi_write () at ../../src/memory/dma.c:126
#2  0x0000000003753d63 in ?? ()
#3  0x00007ffff79b9ea0 in ?? () from /lib/libc.so.6
#4  0x00007ffff5126360 in ?? () at ../../src/r4300/r4300.c:1457
   from /usr/local/lib/libmupen64plus.so.2.0.0
#5  0x0000000000000003 in ?? ()
#6  0x00007ffff516ae23 in dyna_start (code=0x7ffff5115de0 <write_pi>)
    at ../../src/r4300/x86_64/rjump.c:94
#7  0x0000000000000003 in ?? ()
#8  0x00007fffffffe9d0 in ?? ()
#9  0x00007fffffffe56c in ?? ()
#10 0x0000000002000000 in ?? ()
#11 0x00000000009e6200 in ?? ()
#12 0x0000000000978ff0 in ?? ()
#13 0x00007ffff512f6c9 in r4300_execute () at ../../src/r4300/r4300.c:1896
#14 0x00007ffff50fd116 in main_run () at ../../src/main/main.c:545
#15 0x00000000004040ea in main (argc=4, argv=<value optimized out>)
    at ../../src/main.c:668

The problem was fixed by changing line 93 in main.c to 
        {
        fprintf(stderr, "Cannot create directory '%s'\n", path);
        exit(1);
    }

Original issue reported on code.google.com by ferret4p...@gmail.com on 15 Jan 2011 at 3:45

GoogleCodeExporter commented 9 years ago
fixed in Hg.  Instead of exiting, I always return path pointer even if 
osal_mkdirp fails..  Then I just check and handle error for fopen() each time 
get_savespath() is used, in case path does not exist or is not writable.

Original comment by richard...@gmail.com on 15 Jan 2011 at 10:13