Sigsuspend() When Using Pthread


Creature XL

Active Member
Joined
Jun 12, 2004
Messages
563
Age
46
Location
Hannover.de
Website
Visit site
Hi,

I am using the SDL_Timer for the first time. As long as I tested my code on a LiNUX-PC it works alright.
On the gp2x I get a sigsuspend from libc, when I put the SDL_INIT_TIMER flag in the SDL_Init() call.
I can't copy gdb's backtrace here (stupid dox box of winXP :) ).

Here is an screenshot:

pic of back trace

I read somewhere in this forum that someone has used teh SDL_Timer, so maybe i am doin gsomething wrong? Or am I using the wrong libs (it shold be the ones from open2x as said above)

thanks in advanve,

creature
 
Creature XL said:
I read somewhere in this forum that someone has used teh SDL_Timer, so maybe i am doin gsomething wrong? Or am I using the wrong libs (it shold be the ones from open2x as said above)
I use the timers all the time, I've never had a problem. Maybe try INIT_ALL so that you're not missing anything?

I just extracted the Open2x toolchain, then the Open2x libs, then I just gcc and it all works with SDL_Timer's. I am using pthreads too.

For reference, here's a Makefile I'm using, which includes the version of open2x that I'm using:

http://code.google.com/p/stppc2x/source/br.../trunk/Makefile
 
Last edited by a moderator:
ledow said:
Creature XL said:
I read somewhere in this forum that someone has used teh SDL_Timer, so maybe i am doin gsomething wrong? Or am I using the wrong libs (it shold be the ones from open2x as said above)
I use the timers all the time, I've never had a problem. Maybe try INIT_ALL so that you're not missing anything?

I just extracted the Open2x toolchain, then the Open2x libs, then I just gcc and it all works with SDL_Timer's. I am using pthreads too.

For reference, here's a Makefile I'm using, which includes the version of open2x that I'm using:

http://code.google.com/p/stppc2x/source/br.../trunk/Makefile


I tried SDL_INIT_EVERYTHING but it doesn't help :(

I see that you link static, I may try this aswell. This brings up another idea: could it be that the libpthread-0.9.so on my gp2x in /lib/ is a different / wrong version?

In the mean time I try the static linking...
 
Last edited by a moderator:
Nope. static does not help :(

And it seems not to be related to SDL. I tried a pthread_create(..) and the same error. any ideas?


EDIT:

thats what happens when you pass a NULL instead of a function pointer. Sorry for the false alarm :(
 
Creature XL said:
Nope. static does not help :(

And it seems not to be related to SDL. I tried a pthread_create(..) and the same error. any ideas?
I've been creating threads with no problems, but I only use static linking. Are you sure you properly passed -static to the linker?
 
Last edited by a moderator:
OMG :)

I have found a work around. I put a SDL_Delay (3000) after the SDL_Init(..) and it works now. :eek:

Concerning the static linking, I tried to do it the same way as posted in the link above by ledow, but it is still dynamically linked :eek:

I am happy that my program works ATM, but I would like to link it statically anyways ( at least when i "release" it, if ever). Can anyone point me to an explaination or how-to how I can link statically?

thanks for listening to my problem(s) and trying to help.
 
I found the problem. And as always: it was MY fault!

i had a pointer holding the thread-callback function set to NULL and it was to be set to the desired address from another part of the application. Now guess what, sometimes the callback function got called before the main thread has set this pointer. A simple "if (ptr)" in the callback function solved it. Obiously.

I am sory to first blame the SDL/ thread port before double checking my onw code :(


This thread can be closed or even deleted :eek:

Thanks all for bothering (here and in #gp2xdev)
 
Back
Top