Created attachment 165369 [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/ruby21 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.
Thanks Dimitry :) Should these also go upstream? Are later versions of ruby likely to be affected?
(In reply to Kubilay Kocak from comment #1) > Should these also go upstream? If upstream will accept them, yes please. :) > Are later versions of ruby likely to be affected? Yes, I submitted bug 206110 for lang/ruby22 and bug 206111 for lang/ruby23.
Also note that during the exp-run for bug 206074, problems are not likely to show up, since the i386 arch still defaults to the i486 CPU. But these fixes are nice to have anyway.
A commit references this bug: Author: julian Date: Mon Aug 1 12:09:05 UTC 2016 New revision: 303612 URL: https://svnweb.freebsd.org/changeset/base/303612 Log: netgraph module for reconstructing checksums PR: 206108 Submitted by: Dmitry Vagin daemon.hammer@ya.ru MFC after: 1 month Changes: head/sys/modules/netgraph/checksum/ head/sys/modules/netgraph/checksum/Makefile head/sys/netgraph/ng_checksum.c head/sys/netgraph/ng_checksum.h
A commit references this bug: Author: julian Date: Fri Dec 2 05:36:37 UTC 2016 New revision: 309385 URL: https://svnweb.freebsd.org/changeset/base/309385 Log: MFH: r303612 netgraph module for reconstructing checksums PR: 206108 Submitted by: Dmitry Vagin daemon.hammer@ya.ru Changes: _U stable/11/ stable/11/sys/modules/netgraph/checksum/ stable/11/sys/netgraph/ng_checksum.c stable/11/sys/netgraph/ng_checksum.h
A commit references this bug: Author: julian Date: Fri Dec 2 05:38:26 UTC 2016 New revision: 309387 URL: https://svnweb.freebsd.org/changeset/base/309387 Log: MFH: r303612 netgraph module for reconstructing checksums PR: 206108 Submitted by: Dmitry Vagin daemon.hammer@ya.ru Changes: _U stable/10/ stable/10/sys/modules/netgraph/checksum/ stable/10/sys/netgraph/ng_checksum.c stable/10/sys/netgraph/ng_checksum.h
A commit references this bug: Author: swills Date: Thu Dec 8 02:57:07 UTC 2016 New revision: 428094 URL: https://svnweb.freebsd.org/changeset/ports/428094 Log: lang/ruby21: fix setjmp clobbered variables PR: 206108 Submitted by: dim Changes: head/Mk/bsd.ruby.mk head/lang/ruby21/files/patch-eval.c head/lang/ruby21/files/patch-eval_error.c head/lang/ruby21/files/patch-thread.c head/lang/ruby21/files/patch-vm_eval.c head/lang/ruby21/files/patch-vm_trace.c
Committed, please see if you can get upstream to take these and Thanks!