Created attachment 165370 [details]
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.
A commit references this bug:
Date: Wed Dec 7 12:47:31 UTC 2016
New revision: 428055
lang/ruby22: fix setjmp clobbered variables
Submitted by: dim
Committed, thanks. Could you try to submit this upstream?