[LLVMdev] setjmp, longjmp and unwind

Greg Pettyjohn gregp at ccs.neu.edu
Wed Apr 20 11:40:19 PDT 2005

I'm trying to get unwind to work.

I was unable to get an unwind example to work directly,
so I decided to compile a c program that uses setjmp
and longjmp and work backwards.

I keep running into a "Abort trap" problem, whatever "Abort trap" is.

Anyway, here's an example of a C program that compiles
and works properly under normal gcc, but that fails with
an "Abort trap" under LLVM:

#include <setjmp.h>

long (*g_pfunc) ();
jmp_buf g_jbuf;

long foo() {
     printf("Hello World!\n");
     longjmp(g_jbuf, 0);
     return 0;

main () {
     g_pfunc = foo;


I'm using Mac OS X version 10.3.8
I just installed and build LLVM yesterday from CVS.

More information about the llvm-dev mailing list