|Summary:||lang/ruby21: fix setjmp clobbered variables (using clang 3.8.0 and optimizing for 'high' CPUs)|
|Product:||Ports & Packages||Reporter:||Dimitry Andric <dim>|
|Component:||Individual Port(s)||Assignee:||freebsd-ruby (Nobody) <ruby>|
|Severity:||Affects Some People||CC:||swills|
Description Dimitry Andric 2016-01-10 18:36:13 UTC
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.
Comment 1 Kubilay Kocak 2016-01-10 18:38:38 UTC
Thanks Dimitry :) Should these also go upstream? Are later versions of ruby likely to be affected?
Comment 2 Dimitry Andric 2016-01-10 18:40:40 UTC
(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.
Comment 3 Dimitry Andric 2016-01-10 18:43:47 UTC
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.
Comment 4 commit-hook 2016-08-01 12:09:50 UTC
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 firstname.lastname@example.org 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
Comment 5 commit-hook 2016-12-02 05:36:43 UTC
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 email@example.com Changes: _U stable/11/ stable/11/sys/modules/netgraph/checksum/ stable/11/sys/netgraph/ng_checksum.c stable/11/sys/netgraph/ng_checksum.h
Comment 6 commit-hook 2016-12-02 05:38:49 UTC
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 firstname.lastname@example.org Changes: _U stable/10/ stable/10/sys/modules/netgraph/checksum/ stable/10/sys/netgraph/ng_checksum.c stable/10/sys/netgraph/ng_checksum.h
Comment 7 commit-hook 2016-12-08 02:58:01 UTC
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
Comment 8 Steve Wills 2016-12-08 03:03:38 UTC
Committed, please see if you can get upstream to take these and Thanks!