Mercurial > hg > truffle
comparison src/os/bsd/vm/os_bsd.cpp @ 10387:f8c8cace25ad
Merge
author | dcubed |
---|---|
date | Thu, 06 Jun 2013 05:56:33 -0700 |
parents | e72f7eecc96d 6bf8b8bb7c19 |
children | ef1818846c22 |
comparison
equal
deleted
inserted
replaced
10384:04551f4dbdb9 | 10387:f8c8cace25ad |
---|---|
3028 sigAct.sa_flags = SA_SIGINFO|SA_RESTART; | 3028 sigAct.sa_flags = SA_SIGINFO|SA_RESTART; |
3029 } else { | 3029 } else { |
3030 sigAct.sa_sigaction = signalHandler; | 3030 sigAct.sa_sigaction = signalHandler; |
3031 sigAct.sa_flags = SA_SIGINFO|SA_RESTART; | 3031 sigAct.sa_flags = SA_SIGINFO|SA_RESTART; |
3032 } | 3032 } |
3033 #if __APPLE__ | |
3034 // Needed for main thread as XNU (Mac OS X kernel) will only deliver SIGSEGV | |
3035 // (which starts as SIGBUS) on main thread with faulting address inside "stack+guard pages" | |
3036 // if the signal handler declares it will handle it on alternate stack. | |
3037 // Notice we only declare we will handle it on alt stack, but we are not | |
3038 // actually going to use real alt stack - this is just a workaround. | |
3039 // Please see ux_exception.c, method catch_mach_exception_raise for details | |
3040 // link http://www.opensource.apple.com/source/xnu/xnu-2050.18.24/bsd/uxkern/ux_exception.c | |
3041 if (sig == SIGSEGV) { | |
3042 sigAct.sa_flags |= SA_ONSTACK; | |
3043 } | |
3044 #endif | |
3045 | |
3033 // Save flags, which are set by ours | 3046 // Save flags, which are set by ours |
3034 assert(sig > 0 && sig < MAXSIGNUM, "vm signal out of expected range"); | 3047 assert(sig > 0 && sig < MAXSIGNUM, "vm signal out of expected range"); |
3035 sigflags[sig] = sigAct.sa_flags; | 3048 sigflags[sig] = sigAct.sa_flags; |
3036 | 3049 |
3037 int ret = sigaction(sig, &sigAct, &oldAct); | 3050 int ret = sigaction(sig, &sigAct, &oldAct); |