On 14 February 2012 09:50, Paolo Bonzini <pbonz...@redhat.com> wrote: > On 02/14/2012 10:24 AM, Stefan Hajnoczi wrote: >> >> setjmp() followed by return is usually bad. We're relying on the fact >> that the return code path here does not clobber local variables 'self' >> and 'co'. Can't we longjmp out back to the coroutine_new() function >> instead? > > http://www.gnu.org/software/pth/rse-pmt.ps covers this. Basically, this > turned out to be more portable than longjmp from a signal handler.
...but still not as portable as you might like. See https://bugs.launchpad.net/ubuntu/+source/gnupg2/+bug/599862 -- if you compile with a newer glibc and FORTIFY_SOURCE (which is default in ubuntu IIRC) then it will complain about the longjump-down-the-stack that pth and this code both do. -- PMM