SDL locks on exit

Hey all…

I’m having pretty big trouble with SDL hanging when the program exits. This doesn’t seem to happen on my own little test programs, but on several larger SDL programs (notably: sarien (sarien.sourceforge.net) and zsnes (www.zsnes.com)).

I always get the last line on the console:

Fatal signal: Segmentation Fault (SDL Parachute Deployed)

then the program hangs, and the SDL window just sits there. I don’t get the command prompt back. The program doesn’t respond to Ctl+C.

My system:

  • Linux 2.4.18 (slackare 8, but lots of custom stuff added)
  • X 4.2.0
  • GNOME 2.0

Running strace on the sarien provides this at the end:

elect(0, NULL, NULL, NULL, {0, 5000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 5000}) = 0 (Timeout)
select(4, [3], NULL, NULL, {0, 0}) = 1 (in [3], left {0, 0})
ioctl(3, FIONREAD, [32]) = 0
read(3, “\2$V\0M’\214>G\0\0\0\3\0\300\1\r\0\300\1n\0021\1j\2\35”…, 32) = 32
select(4, [3], NULL, NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1027546556, 281493}, NULL) = 0
select(4, [3], NULL, NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1027546556, 281587}, NULL) = 0
select(4, [3], NULL, NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1027546556, 281674}, NULL) = 0
write(4, “\221\3\n\0\r\0\300\1\16\0\300\1\200\2\340\1H\0\243\0\360”…, 44) = 44read(4, 0xbffff868, 32) = -1 EAGAIN (Resource temporarily unavailable)
select(5, [4], NULL, NULL, NULL) = 1 (in [4])
read(4, “\1\1\370\1\0\0\0\0\3\0\300\1\0\0\0\0\0\0\0\0\0\0\0\0\0”…, 32) = 32
write(4, “\221\3\n\0\r\0\300\1\16\0\300\1\200\2\340\1\20\0009\0\234”…, 44) = 44
read(4, 0xbffff938, 32) = -1 EAGAIN (Resource temporarily unavailable)
select(5, [4], NULL, NULL, NULL) = 1 (in [4])
read(4, “\1\1\372\1\0\0\0\0\3\0\300\1\0\0\0\0\0\0\0\0\0\0\0\0\0”…, 32) = 32
rt_sigprocmask(SIG_SETMASK, NULL, [RT_0], 8) = 0
rt_sigsuspend([] <unfinished …>
— SIGRT_0 (Real-time signal 0) —
<… rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call)
sigreturn() = ? (mask now [])
write(6, " M\n@\1\0\0\0\3\10\0\0\254\371\377\277\240N\1@\220\324"…, 148) = 148— SIGSEGV (Segmentation fault) —
rt_sigaction(SIGSEGV, {SIG_DFL}, {0x4009bcc0, [SEGV], SA_RESTART|0x4000000}, 8) = 0
write(2, "Fatal signal: “, 14Fatal signal: ) = 14
write(2, “Segmentation Fault”, 18Segmentation Fault) = 18
write(2, " (SDL Parachute Deployed)\n”, 26 (SDL Parachute Deployed)
) = 26
rt_sigprocmask(SIG_SETMASK, NULL, [SEGV RT_0], 8) = 0
rt_sigsuspend([SEGV]

running strace on zsnes gets this at the end:

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40087000
write(8, “; ZSNES Configuration file\r\n\r\n; “…, 2517) = 2517
close(8) = 0
munmap(0x40087000, 4096) = 0
open(“zguicfgl.dat”, O_WRONLY|O_CREAT|O_TRUNC, 0666) = 8
fstat64(0x8, 0xbffff8d8) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40087000
write(8, “\17\n\37\0\1\0\1\0\0\0\0\0\5\0\0\0<\0\0\0\36\0\0\0007\0”…, 12288) = 12288
write(8, “\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0”…, 907) = 907close(8) = 0
munmap(0x40087000, 4096) = 0
chdir(”/home/matt/src/sarien-0.7.0/bin”) = 0
rt_sigprocmask(SIG_SETMASK, NULL, [RT_0], 8) = 0
rt_sigsuspend([] <unfinished …>
— SIGRT_0 (Real-time signal 0) —
<… rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call)
sigreturn() = ? (mask now [])
write(6, " M\n@\1\0\0\0\2\4\0\0\210\371\377\277\240N\1@\220\324\1"…, 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [RT_0], 8) = 0
rt_sigsuspend([] <unfinished …>
— SIGRT_0 (Real-time signal 0) —
<… rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call)
sigreturn() = ? (mask now [])
write(6, " M\n@\1\0\0\0\3\10\0\0009g\213\0019g\213\1\310\371\377"…, 148) = 148— SIGSEGV (Segmentation fault) —
rt_sigaction(SIGSEGV, {SIG_DFL}, {0x4009bcc0, [SEGV], SA_RESTART|0x4000000}, 8) = 0
write(2, "Fatal signal: “, 14Fatal signal: ) = 14
write(2, “Segmentation Fault”, 18Segmentation Fault) = 18
write(2, " (SDL Parachute Deployed)\n”, 26 (SDL Parachute Deployed)
) = 26
rt_sigprocmask(SIG_SETMASK, NULL, [SEGV RT_0], 8) = 0
rt_sigsuspend([SEGV]

let me know if there’s anything else I can do. thanks!