using sigjmp_buf (works for me on OSX), will need a better strategy to choose between them