Bug #9710

__builtin_setjmp/longjmp causes SEGV with mingw

Added by Hiroshi Shirosaki about 1 year ago. Updated 10 months ago.

[ruby-core:61887]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 2.2.0dev (2014-04-07 trunk 45529) [x64-mingw32] Backport:2.0.0: REQUIRED, 2.1: DONE

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

Related to Ruby trunk - Bug #9692: __builtin_longjmp is called with a value greater than 1 (GCC compilation error) Closed 04/01/2014

Associated revisions

Revision 45537
Added by Nobuyoshi Nakada about 1 year ago

configure.in: no __builtin_setjmp on x64-mingw

  • configure.in: get rid of builtin_setjmp/builtin_longjmp on x64-mingw, which causes SEGV with callcc. [Bug #9710]

Revision 45537
Added by Nobuyoshi Nakada about 1 year ago

configure.in: no __builtin_setjmp on x64-mingw

  • configure.in: get rid of builtin_setjmp/builtin_longjmp on x64-mingw, which causes SEGV with callcc. [Bug #9710]

Revision 47278
Added by Tomoyuki Chikanaga 10 months ago

merge revision(s) r45537: [Backport #9710]

* configure.in: get rid of __builtin_setjmp/__builtin_longjmp on
  x64-mingw, which causes SEGV with callcc.
   [Bug #9710]

History

#1 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45537.


configure.in: no __builtin_setjmp on x64-mingw

  • configure.in: get rid of builtin_setjmp/builtin_longjmp on x64-mingw, which causes SEGV with callcc. [Bug #9710]

#2 Updated by _ wanabe about 1 year ago

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

#3 Updated by _ wanabe about 1 year ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED

I guess it should be backported with #9692.

#4 Updated by Tomoyuki Chikanaga 10 months ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into ruby_2_1 branch at r47278.

Also available in: Atom PDF