Crash in SDL_WaitThread

Hi,

A user of the Nokia N800/N810 tried to compile our game OpenLieroX there
but went into multiple trouble related to threads (yeah, funny that I
just talked about how important threads are…).

Basically, very often in SDL_WaitThread(), the application crashed with
a segmentation fault.

    (gdb) 
    358      SDL_WaitThread(tThread, NULL);
    (gdb) 
    [New LWP 5306]
    
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 5306]
    0x404be748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    (gdb) thread apply all bt
    
    Thread 1 (LWP 5306):
    #0  0x404be748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    #1  0x404bf44c in ?? () from /lib/libgcc_s.so.1
    Cannot access memory at address 0x0

I made a simple thread demo application now which does nothing else than
create a few threads and waits for them to exit. And even this small
demo application also crashes in a similar way:

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 5860]
    0x401ce748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    (gdb) bt
    #0  0x401ce748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    #1  0x401cf44c in ?? () from /lib/libgcc_s.so.1
    Cannot access memory at address 0x0

You can download the source of the demo application here:
http://lxalliance.net/forum/index.php?topic=10802.msg129001#msg129001

You can also read all the other backtraces and tests there.

Can you take a look at the demo application, if I did something wrong
there? Where exactly do you expect the bug? What solutions/ workarounds
do I have?

Greetings,
Albert

Even the example

http://www.libsdl.org/intro.en/usingthreads.html

crashed for him, when he compiles it with g++. Strangely, it does not
crash when he use gcc.

The crash itself is probably ARM + GCC related.On Wed, 2008-08-06 at 19:57 +0200, Albert Zeyer wrote:

Hi,

A user of the Nokia N800/N810 tried to compile our game OpenLieroX there
but went into multiple trouble related to threads (yeah, funny that I
just talked about how important threads are…).

Basically, very often in SDL_WaitThread(), the application crashed with
a segmentation fault.

    (gdb) 
    358      SDL_WaitThread(tThread, NULL);
    (gdb) 
    [New LWP 5306]
    
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 5306]
    0x404be748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    (gdb) thread apply all bt
    
    Thread 1 (LWP 5306):
    #0  0x404be748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    #1  0x404bf44c in ?? () from /lib/libgcc_s.so.1
    Cannot access memory at address 0x0

I made a simple thread demo application now which does nothing else than
create a few threads and waits for them to exit. And even this small
demo application also crashes in a similar way:

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 5860]
    0x401ce748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    (gdb) bt
    #0  0x401ce748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    #1  0x401cf44c in ?? () from /lib/libgcc_s.so.1
    Cannot access memory at address 0x0

You can download the source of the demo application here:
http://lxalliance.net/forum/index.php?topic=10802.msg129001#msg129001

You can also read all the other backtraces and tests there.

Can you take a look at the demo application, if I did something wrong
there? Where exactly do you expect the bug? What solutions/ workarounds
do I have?

Greetings,
Albert


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I made a very similar thread demo application but with pthreads:

http://lxalliance.net/forum/index.php?topic=10802.msg129432#msg129432

This one does not crash.

Therefore I expect a bug in SDL somewhere. Can any ARM user confirm
this?

– AlbertOn Wed, 2008-08-06 at 19:57 +0200, Albert Zeyer wrote:

Hi,

A user of the Nokia N800/N810 tried to compile our game OpenLieroX there
but went into multiple trouble related to threads (yeah, funny that I
just talked about how important threads are…).

Basically, very often in SDL_WaitThread(), the application crashed with
a segmentation fault.

    (gdb) 
    358      SDL_WaitThread(tThread, NULL);
    (gdb) 
    [New LWP 5306]
    
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 5306]
    0x404be748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    (gdb) thread apply all bt
    
    Thread 1 (LWP 5306):
    #0  0x404be748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    #1  0x404bf44c in ?? () from /lib/libgcc_s.so.1
    Cannot access memory at address 0x0

I made a simple thread demo application now which does nothing else than
create a few threads and waits for them to exit. And even this small
demo application also crashes in a similar way:

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to LWP 5860]
    0x401ce748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    (gdb) bt
    #0  0x401ce748 in _Unwind_VRS_Pop () from /lib/libgcc_s.so.1
    #1  0x401cf44c in ?? () from /lib/libgcc_s.so.1
    Cannot access memory at address 0x0

You can download the source of the demo application here:
http://lxalliance.net/forum/index.php?topic=10802.msg129001#msg129001

You can also read all the other backtraces and tests there.

Can you take a look at the demo application, if I did something wrong
there? Where exactly do you expect the bug? What solutions/ workarounds
do I have?

Greetings,
Albert