Forum: Ruby-core __builtin_setjmp/longjmp causes SEGV with mingw

1a89a8ff89c39148448a228115925b29?d=identicon&s=25 unknown (Guest)
on 2014-04-13 09:56
(Received via mailing list)
Issue #9710 has been updated by _ wanabe.

Related to Bug #9692: __builtin_longjmp is called with a value greater
than 1 (GCC compilation error) added

Bug #9710: __builtin_setjmp/longjmp causes SEGV with mingw

* Author: Hiroshi Shirosaki
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-04-07 trunk 45529) [x64-mingw32]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
Now `__builtin_setjmp/__builtin_longjmp` are used with x64-mingw.

ruby 2.2.0dev (2014-04-07 trunk 45529) [x64-mingw32]
gcc version 4.8.2 20130712 (prerelease) (Built by MinGW-builds project)


#define RUBY_SETJMP(env) __builtin_setjmp((env))
#define RUBY_LONGJMP(env,val) __builtin_longjmp((env),val)

But this casues SEGV with callcc.

`ruby -rcontinuation -e "callcc{|c|}"`

Instead using `setjmpex/longjmp` seems to work fine.

#define RUBY_SETJMP(env) setjmpex((env))
#define RUBY_LONGJMP(env,val) longjmp((env),val)
This topic is locked and can not be replied to.