From: Shugo Maeda Date: 2011-09-07T13:02:22+09:00 Subject: [ruby-core:39322] Re: [Ruby 1.9 - Bug #5244] Continuation causes Bus Error on Debian sparc Hi, 2011/9/7 Jurij Smakov : > "If the function in which setjmp was called returns, it is no longer possible to safely use longjmp with the corresponding jmp_buf object. This is because the stack frame is invalidated when the function returns. Calling longjmp restores the stack pointer, which�because the function returned�would point to a non-existent and potentially overwritten/corrupted stack frame.[4][5]" > > I've verified that ruby_setjmp() translates to a simple _setjmp() in preprocessed code, and after calling it the function returns immediately. Ruby's callcc copies stack to heap, then calls setjmp(). Stack frames are restored from the copy before longjmp(). -- Shugo Maeda