Thanks for open a post on libsdl mailing list, but i believe it has nothing to do with sdl.
I have installed the official gph sdk and compiled the thread sample. After executing on gp2x i got following debugger output:
Code:
Starting program: /mnt/sd/Test/fpc/fpc4gp2x/fpcthread.gpe
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) info stack
#0 0x00000000 in ?? ()
#1 0x00075ecc in ptmalloc_init () at malloc.c:1760
#2 0x00077630 in malloc_hook_ini (sz=792, caller=0x75b6c) at malloc.c:1856
#3 0x000774ac in __libc_malloc (bytes=989568) at malloc.c:2797
#4 0x0004da7c in SDL_CreateThread (fn=0x8118 <THREAD_FUNC>, data=0x0) at SDL_thread.c:228
#5 0x000081e4 in main () at fpcthread.dpr:26
As you can see, the gph sdk has more debug symbols insight, so we got a better error location.
I wrote a smaller sample, like this:
Code:
program fpcmalloc;
{$IFNDEF FPC}
{$APPTYPE CONSOLE}
{$ENDIF}
function malloc(aSize : Integer): Pointer; cdecl; external;
procedure free(aPtr : Pointer); cdecl; external;
var
MemPtr : Pointer;
begin
WriteLn('Alloc 792 Bytes');
MemPtr := Malloc(792);
WriteLn('Release 792 Bytes');
Free(MemPtr);
WriteLn('ByeBye');
end.
The output under gp2x is:
Code:
Starting program: /mnt/sd/Test/fpc/fpc4gp2x/fpcmalloc.gpe
Alloc 792 Bytes
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) info stack
#0 0x00000000 in ?? ()
#1 0x00034f70 in ptmalloc_init () at malloc.c:1756
#2 0x0003670c in malloc_hook_ini (sz=792, caller=0x0) at malloc.c:1856
#3 0x00036588 in __libc_malloc (bytes=230028) at malloc.c:2797
#4 0x00008168 in main () at fpcmalloc.dpr:13
I don't know if I'm right, but i look at ptmalloc_init ();
Cheers,
Thomas
Bookmarks