maintainer-feedback requested: [Bug 206110] lang/ruby22: fix setjmp clobbered variables (using clang 3.8.0 and optimizing for 'high' CPUs)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jan 10 18:38:21 UTC 2016


Dimitry Andric <dim at FreeBSD.org> has reassigned Bugzilla Automation
<bugzilla at FreeBSD.org>'s request for maintainer-feedback to ruby at FreeBSD.org:
Bug 206110: lang/ruby22: fix setjmp clobbered variables (using clang 3.8.0 and
optimizing for 'high' CPUs)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206110



--- Description ---
Created attachment 165370
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=165370&action=edit
Mark several variables volatile so they won't have undefined state after
setjmp()

During my preparations for bug 206074 (exp-run for clang 3.8.0), I noticed that
lang/ruby22 would sometimes crash during the build.  Specifically, on i386,
with CPUTYPE=ivybridge, you would get segfaults in miniruby.

It turns out these are because there are several places in ruby where setjmp()
is used, and where not all variables accessed after setjmp() are marked
volatile.  This can cause them to have undefined state.

Fix this by marking several variables in different functions volatile.

These patches were obtained from NetBSD pkgsrc, thanks to Jörg Sonnenberger for
the hint.


More information about the freebsd-ruby mailing list