Here is the patch for kernel to save %gs, it works well on my machine. http://people.freebsd.org/~davidxu/i386_gs.diff Daniel, is this the reason in your libpthread patch that doesn't use getcontext syscall ? David Xu