Project

General

Profile

Actions

Bug #9710

closed

__builtin_setjmp/longjmp causes SEGV with mingw

Added by h.shirosaki (Hiroshi Shirosaki) over 10 years ago. Updated about 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-04-07 trunk 45529) [x64-mingw32]
[ruby-core:61887]

Description

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)

.ext/include/x64-mingw32/ruby/config.h

#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|c.call}"

Instead using setjmpex/longjmp seems to work fine.

#define RUBY_SETJMP(env) setjmpex((env))
#define RUBY_LONGJMP(env,val) longjmp((env),val)

Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #9692: __builtin_longjmp is called with a value greater than 1 (GCC compilation error)Closed04/01/2014Actions
Related to Ruby master - Bug #14480: miniruby crashing when compiled with -O2 or -O1 on aarch64ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0