From: <ge...@co...> - 2004-09-03 05:28:25
|
Hmm, I looked into native FreeBSD implementation of threads in libc_r. It's pure user-land threads and thread context switching is implemented the same way as ST's (via setjmp/longjmp). You are right, MD_JB_SP should be 2 for amd64 as seen from pthread_private.h (http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc_r/uthread/pthread_private.h) #define SET_STACK_JB(jb, stk) (jb)[0]._jb[2] = (long)(stk) It seems that the only amd64-specific code is in uthread_init.c (http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc_r/uthread/uthread_init.c): #if defined(__amd64__) stackp &= ~0xFUL; #endif Which should be fine with ST, cause we make stack 64-byte aligned there. So I can't see any obvious differences between ST and libc_r threads for amd64. Am I missing something? --Gene > Hello, > I'm having a rather odd problem with the state threads library on my > FreeBSD 5.2.1 amd64 box. I have worked past the MD_JB_SP problem with the > following fix... > > #elif defined(__amd64__) > #define MD_JB_SP 2 > #else > ... > > added to the freebsd section of md.h. This is the same value as __i386__ and > is the only one that seems to work for me. Everything else results in a bus > error inside of st some where on start up. > > This is the only change I have made to st to get my app to work 99.9% of the > time. What doesn't work is *printf() calls with a double arguement. (I'm > using doubles to determine high precision timing values). There utlimately > ends up being a bus error in libc in any of the printf() calls. I've tracked > the problem down to a problem with va_start(). The va_*() calls manipulate > the stack and that seems to get out of whack when trying to print doubles. > Crazy. :) All other *printf() calls work fine as long as I don't try to do > anything with doubles. > > I'd like to know if anyone else is seeing this kind of problem or if anyone > has an idea of how to fix this. I'm surprised I was able to get ST to work > at all with such a small fix to md.h. Maybe I'm missing something else > important? Is someone working on an official port for FreeBS on amd64? > > cheers, > Ray > > _________________________________________________________________ > Is your PC infected? Get a FREE online computer virus scan from McAfee® > Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > State-threads-devel mailing list > Sta...@li... > https://lists.sourceforge.net/lists/listinfo/state-threads-devel |