From: s.wanabe@... Date: 2018-02-26T00:38:12+00:00 Subject: [ruby-core:85810] [Ruby trunk Bug#14480] miniruby crashing when compiled with -O2 or -O1 on aarch64 Issue #14480 has been updated by wanabe (_ wanabe). tl;dr: * `rb_ec_tag_jump()` causes SEGV on aarch64 when it is built with `-fomit-frame-pointer` optimization that is the default of `-O1` of gcc-8.0.1-0.13. * It is confirmed that `-fno-omit-frame-pointer` optflags can avoid the issue. * Also `--with-setjmp-type=setjmp` will do, but no one has yet confirmed. * Andrew Pinski, one of gcc maintainer, says "To me any use of __builtin_setjmp/__builtin_longjmp is almost always incorrect." vo.x (Vit Ondruch) wrote: > This appears to be longstanding GCC issue on aarch64, which was recently exposed by change in GCC defaults [1]. However, the GCC upstream is questioning usage of \_\_builtin_setjmp/\_\_builtin_longjmp. Can somebody provide answer to this question [2]: > > > > I notice that in our builds, RUBY_SETJMP is using "__builtin_setjmp", rather > > than "setjmp". > > > > This seems to come from the "configure" check; the rpm build log has: > > "checking for setjmp type... __builtin_setjmp" > > > > Is this the default for upstream Ruby? Yes, it is, as far as I know since r15871 [ruby-core:16086](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16086). Nakada-san, how do you think about this issue? ---------------------------------------- Bug #14480: miniruby crashing when compiled with -O2 or -O1 on aarch64 https://bugs.ruby-lang.org/issues/14480#change-70667 * Author: vo.x (Vit Ondruch) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.0p0 (2017-12-25 revision 61468) [aarch64-linux] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- Recently, it is not possible to build Ruby 2.5.0 on aarch64 on Fedora Rawhide, because miniruby fails during build: ~~~ ... snip ... ./miniruby -I./lib -I. -I.ext/common -n \ -e 'BEGIN{version=ARGV.shift;mis=ARGV.dup}' \ -e 'END{abort "UNICODE version mismatch: #{mis}" unless mis.empty?}' \ -e '(mis.delete(ARGF.path); ARGF.close) if /ONIG_UNICODE_VERSION_STRING +"#{Regexp.quote(version)}"/o' \ 10.0.0 ./enc/unicode/10.0.0/casefold.h ./enc/unicode/10.0.0/name2ctype.h generating encdb.h ./miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc generating prelude.c ./miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -I. -c -o prelude.c \ ./template/prelude.c.tmpl ./prelude.rb ./gem_prelude.rb ./abrt_prelude.rb *** stack smashing detected ***: terminated encdb.h updated ... snip ... ~~~ This might by Ruby or gcc issue. Not sure yet. However, there is already lengthy analysis available in Fedora's Bugzilla [1]. Would be anybody able to help to resolve this issue? [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1545239 ---Files-------------------------------- Dockerfile (573 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: