site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Thunderbird 2.0.0.9 (Windows/20071031) Hi Jim, I'm no thread guru, but moving the ctx off the local stack makes it not crash for me. Perhaps the stack (which is about to be freed) isn't the best place to save the thread info. The code runs fine on my linux machine, FWIW. Edd On Jan 31, 2008, at 5:52 PM, Edd Dawson wrote: Hello, I sincerely hope this is the correct list for this question. edd:guff developer$ gcc -dumpversion 4.0.1 edd:guff developer$ cat getcontext.c #include <ucontext.h> Why the bus error? What am I doing wrong? Kind regards, _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Jim Guyton wrote: I found that too, but the man page says nothing about where the ucontext_t should be allocated. In fact, all the examples I've seen on the web use automatic storage. I'm running leopard 10.5.1 on a MacBook with the standard apple developer tools. int main(void) { ucontext_t ctx; getcontext(&ctx); return 0; } edd:guff developer$ gcc getcontext.c -o getcontext -W -Wall -ansi -pedantic edd:guff developer$ ./getcontext Bus error edd:guff developer$ Edd This email sent to site_archiver@lists.apple.com