Re: Solaris 64bit mode: crash in longjmp()
Gene <[email protected]> Sun, 07 Dec 2003 01:32:25 -0800
| Newsgroups | gmane.comp.lib.state-threads.devel |
|---|---|
| Message-ID | <[email protected]> |
The fact is ST was never ported to 64-bit mode on Solaris. In 64-bit mode (LP64) jmp_buf structure is completely different, that's why you are getting crashes. Now, how do you compile 64-bit mode with gcc? Special compiler flags? Do you need special 64-bit gcc version? I have an access to Solaris 9 box on Sourceforge farm so I may try to port it if that box supports 64-bit mode: $ uname -a SunOS sparc-solaris1 5.9 Generic_112233-03 sun4u sparc SUNW,Ultra-60 $ gcc --version gcc (GCC) 3.3.1 Copyright (C) 2003 Free Software Foundation, Inc. Claus Assmann wrote: >[forwarded from st-users with more information] > >Has anyone succeeded compiling and using statethreads in 64bit mode >on Solaris (8 or 9, using gcc or Sun's C compiler)? A simple program >crashes in longjmp(): > >#0 0xffffffff7ec3b8e8 in longjmp () from /usr/lib/64/libc.so.1 >#1 0x00000001000035a0 in _st_vp_schedule () at sched.c:165 >#2 0x0000000100004e88 in st_usleep (usecs=4294987380) at sync.c:113 >#3 0x0000000100002b48 in main (argc=16777217, argv=0x100006e28) at thr-1.c:120 > >The program creates one thread and calls st_usleep(timeout); where >timeout is 1000, to force a context switch. Are there any required >changes to the stack context switch code in md.h for this combination? > >I've tried to use setcontext() etc instead, but didn't get anywhere >either, the way I used it is probably wrong: > >#define MD_SETJMP(env) getcontext(&(env)) >#define MD_LONGJMP(env, val) setcontext(&(env)) > >_ST_INIT_CONTEXT: > if (getcontext(&(thread->context)) != 0) > return NULL; > (thread)->context.uc_link = NULL; > (thread)->context.uc_stack.ss_sp = (void *) (stack->sp); > (thread)->context.uc_stack.ss_size = stk_size; > (thread)->context.uc_stack.ss_flags = 0; > makecontext(&(thread)->context, _st_thread_main, 1); > ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click