https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2016-02-27T12:07:02Z
Ruby Issue Tracking System
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57173
2016-02-27T12:07:02Z
glaubitz (John Paul Adrian Glaubitz)
<ul></ul><p>Update: It seems the suggested patch by Andreas Schwab does not help on ruby2.3 anymore. So, for ruby2.3, something different needs to be done.</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57175
2016-02-27T20:55:50Z
Anonymous
<ul><li><strong>File</strong> <i>111.jpg</i> added</li><li><strong>Subject</strong> changed from <i>ruby2.3: Segfaults on m68k due to improper stack allocation</i> to <i>http://www.proessaywriting.com/</i></li></ul>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57187
2016-02-28T10:52:28Z
hsbt (Hiroshi SHIBATA)
hsbt@ruby-lang.org
<ul><li><strong>Subject</strong> changed from <i>http://www.proessaywriting.com/</i> to <i>ruby2.3: Segfaults on m68k due to improper stack allocation</i></li></ul>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57653
2016-03-24T09:27:17Z
glaubitz (John Paul Adrian Glaubitz)
<ul></ul><p>Hi!</p>
<p>Since my first post was a bit confusing, here is for clarification:</p>
<p>The above patch helped with ruby2.2, but it does not help with ruby2.3, so this seems to be a different problem.</p>
<p>Trying to debug the issue now.</p>
<p>Adrian</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57654
2016-03-24T09:30:43Z
glaubitz (John Paul Adrian Glaubitz)
<ul></ul><p>Here's the complete backtrace:</p>
<pre><code>(sid-m68k-sbuild)root@z6:/build/ruby2.3-dCWwvL/ruby2.3-2.3.0# ./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems -r./m68k-linux-gnu-fake ./tool/rbinstall.rb --make="/usr/bin/make" --dest-dir="/<<PKGBUILDDIR>>/debian/tmp" --extout=".ext" --mflags="-w" --make-flags="w -- DESTDIR=/<<PKGBUILDDIR>>/debian/tmp" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc"
qemu: Unsupported syscall: 352
qemu: Unsupported syscall: 352
installing binary commands: /usr/bin
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:250: [BUG] Segmentation fault at 0x38000000
ruby 2.3.0p0 (2015-12-25) [m68k-linux-gnu]
-- Control frame information -----------------------------------------------
c:0013 p:---- s:0076 e:000075 CFUNC :initialize
c:0012 p:---- s:0074 e:000073 CFUNC :mkdir
c:0011 p:0034 s:0069 e:000068 METHOD /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:250
c:0010 p:0019 s:0064 e:000063 BLOCK /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:214 [FINISH]
c:0009 p:---- s:0060 e:000059 CFUNC :each
c:0008 p:0122 s:0057 e:000056 METHOD /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:211
c:0007 p:0046 s:0052 e:000051 METHOD ./tool/rbinstall.rb:191
c:0006 p:0158 s:0048 e:000047 METHOD ./tool/rbinstall.rb:304
c:0005 p:0012 s:0041 e:000040 BLOCK ./tool/rbinstall.rb:342 [FINISH]
c:0004 p:0025 s:0039 e:000038 BLOCK ./tool/rbinstall.rb:801 [FINISH]
c:0003 p:---- s:0035 e:000034 CFUNC :each
c:0002 p:1387 s:0032 E:ffffe4f8 EVAL ./tool/rbinstall.rb:798 [FINISH]
c:0001 p:0000 s:0002 E:ffffdee8 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
./tool/rbinstall.rb:798:in `<main>'
./tool/rbinstall.rb:798:in `each'
./tool/rbinstall.rb:801:in `block in <main>'
./tool/rbinstall.rb:342:in `block in <main>'
./tool/rbinstall.rb:304:in `prepare'
./tool/rbinstall.rb:191:in `makedirs'
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:211:in `mkdir_p'
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:211:in `each'
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:214:in `block in mkdir_p'
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:250:in `fu_mkdir'
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:250:in `mkdir'
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb:250:in `initialize'
-- C level backtrace information -------------------------------------------
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_print_backtrace+0x24) [0xf67380b4] vm_dump.c:987
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_vm_bugreport+0x7e) [0xf673814c] /usr/include/m68k-linux-gnu/bits/stdio2.h:97
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_bug_context+0x58) [0xf66094a6] error.c:435
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(sigsegv+0x46) [0xf66c4334] signal.c:890
[0x800414d8]
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(iv_index_tbl_make+0x10) [0xf66fed4a] variable.c:1308
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_ivar_set+0x86) [0xf6702428] variable.c:1340
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(syserr_initialize+0x152) [0xf660abb6] error.c:1525
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call0_body.constprop.112+0x1e6) [0xf673091e] vm_eval.c:119
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_call0+0xd4) [0xf67313ee] vm_eval.c:609
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_funcallv+0x3a) [0xf6731c14] /usr/include/m68k-linux-gnu/bits/string3.h:53
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_obj_call_init+0x48) [0xf661008a] eval.c:1310
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_class_new_instance+0x22) [0xf6660b3c] object.c:1856
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_syserr_fail_path_in+0x7a) [0xf660b1e4] error.c:2208
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_sys_fail_path_in+0x1e) [0xf660b23a] error.c:2191
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(dir_s_mkdir+0xb0) [0xf65f8028] dir.c:1132
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_cfunc+0xf8) [0xf6726f18] vm_args.c:761
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_method_each_type+0xd6) [0xf6733926] vm_insnhelper.c:2048
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_general+0xba) [0xf673493e] vm.c:952
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec_core+0xf8a) [0xf672b168] vm_insnhelper.c:210
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec+0x68) [0xf672ec74] vm_insnhelper.c:1280
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_yield+0x2b8) [0xf67350ce] vm_method.c:1905
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_ary_each+0x40) [0xf65ca4a6] array.c:1815
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_cfunc+0xf8) [0xf6726f18] vm_args.c:761
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_method_each_type+0xd6) [0xf6733926] vm_insnhelper.c:2048
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_general+0xba) [0xf673493e] vm.c:952
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec_core+0xeee) [0xf672b0cc] insns.def:1032
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec+0x68) [0xf672ec74] vm_insnhelper.c:1280
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(invoke_block_from_c_0+0x1d2) [0xf672f682] vm_args.c:762
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_invoke_proc+0x84) [0xf672f71e] vm_eval.c:1584
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_vm_invoke_proc+0x2a) [0xf672f7aa] vm_eval.c:1596
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_opt_call+0x8c) [0xf672f864] vm.c:983
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_method_each_type+0x390) [0xf6733be0] vm_insnhelper.c:2161
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_general+0xba) [0xf673493e] vm.c:952
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec_core+0xf8a) [0xf672b168] vm_insnhelper.c:210
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec+0x68) [0xf672ec74] vm_insnhelper.c:1280
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_yield+0x2b8) [0xf67350ce] vm_method.c:1905
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(rb_ary_each+0x60) [0xf65ca4c6] array.c:1815
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_cfunc+0xf8) [0xf6726f18] vm_args.c:761
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_method_each_type+0xd6) [0xf6733926] vm_insnhelper.c:2048
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_call_general+0xba) [0xf673493e] vm.c:952
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec_core+0xeee) [0xf672b0cc] insns.def:1032
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(vm_exec+0x68) [0xf672ec74] vm_insnhelper.c:1280
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(ruby_exec_internal+0x8c) [0xf660c3d2] eval.c:244
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(ruby_exec_node+0x18) [0xf660dc8a] eval.c:309
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/libruby-2.3.so.2.3.0(ruby_run_node+0x24) [0xf660fb8c] eval.c:977
/build/ruby2.3-dCWwvL/ruby2.3-2.3.0/ruby2.3(main+0x52) [0x80000736] main.c:36
-- Other runtime information -----------------------------------------------
* Loaded script: ./tool/rbinstall.rb
* Loaded features:
0 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/rbconfig.rb
1 enumerator.so
2 thread.rb
3 rational.so
4 complex.so
5 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/enc/encdb.so
6 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/enc/trans/transdb.so
7 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/unicode_normalize.rb
8 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/m68k-linux-gnu-fake.rb
9 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/etc.so
10 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/fileutils.rb
11 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/shellwords.rb
12 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/optparse.rb
13 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/optparse/shellwords.rb
14 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/ostruct.rb
15 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/compatibility.rb
16 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/defaults.rb
17 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/deprecate.rb
18 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/errors.rb
19 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/version.rb
20 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/requirement.rb
21 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/platform.rb
22 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/basic_specification.rb
23 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/stub_specification.rb
24 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/util/list.rb
25 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/stringio.so
26 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/specification.rb
27 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/exceptions.rb
28 /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
29 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/core_ext/kernel_gem.rb
30 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/monitor.rb
31 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/core_ext/kernel_require.rb
32 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems.rb
33 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/zlib.so
34 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/io/console.so
35 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/user_interaction.rb
36 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/command.rb
37 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/digest.so
38 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/digest.rb
39 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/openssl.so
40 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/bn.rb
41 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/pkey.rb
42 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/cipher.rb
43 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/config.rb
44 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/digest.rb
45 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/x509.rb
46 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/buffering.rb
47 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/m68k-linux-gnu/io/nonblock.so
48 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl/ssl.rb
49 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/.ext/common/openssl.rb
50 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/security/policy.rb
51 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/security/policies.rb
52 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/security/trust_dir.rb
53 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/security/signer.rb
54 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/security.rb
55 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/digest_io.rb
56 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/source.rb
57 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/file_source.rb
58 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/io_source.rb
59 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/old.rb
60 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/tar_header.rb
61 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/tar_reader/entry.rb
62 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/tar_reader.rb
63 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package/tar_writer.rb
64 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/package.rb
65 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext/build_error.rb
66 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext/builder.rb
67 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext/configure_builder.rb
68 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/delegate.rb
69 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/tmpdir.rb
70 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/tempfile.rb
71 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext/ext_conf_builder.rb
72 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext/rake_builder.rb
73 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext/cmake_builder.rb
74 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/ext.rb
75 /build/ruby2.3-dCWwvL/ruby2.3-2.3.0/lib/rubygems/installer.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
(sid-m68k-sbuild)root@z6:/build/ruby2.3-dCWwvL/ruby2.3-2.3.0#
</code></pre>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57659
2016-03-24T16:29:00Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>File</strong> deleted (<del><i>111.jpg</i></del>)</li></ul>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57660
2016-03-24T16:30:01Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/57660/diff?detail_id=40599">diff</a>)</li></ul>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57662
2016-03-24T16:42:44Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>Backport</strong> changed from <i>2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN</i> to <i>2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED</i></li></ul><p>As far as I understand, the fix should be following:</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git a/thread_pthread.c b/thread_pthread.c
index ef43b36..1fdf3f5 100644
</span><span class="gd">--- a/thread_pthread.c
</span><span class="gi">+++ b/thread_pthread.c
</span><span class="p">@@ -693,17 +693,31 @@</span> reserve_stack(volatile char *limit, size_t size)
const volatile char *end = buf + sizeof(buf);
limit += size;
if (limit > end) {
<span class="gd">- size = limit - end;
- limit = alloca(size);
- limit[stack_check_margin+size-1] = 0;
</span><span class="gi">+ /* |<-bottom (=limit(a)) top->|
+ * | .. |<-buf 256B |<-end | stack check |
+ * | 256B | =size= | margin (4KB)|
+ * | =size= limit(b)->| 256B | |
+ * | | alloca(sz) | | |
+ * | .. |<-buf |<-limit(c) [sz-1]->0> | |
+ */
+ size_t sz = limit - end;
+ limit = alloca(sz);
+ limit[sz-1] = 0;
</span> }
}
else {
limit -= size;
if (buf > limit) {
<span class="gd">- limit = alloca(buf - limit);
- limit[0] = 0; /* ensure alloca is called */
- limit -= stack_check_margin;
</span><span class="gi">+ /* |<-top (=limit(a)) bottom->|
+ * | .. | 256B buf->| | stack check |
+ * | 256B | =size= | margin (4KB)|
+ * | =size= limit(b)->| 256B | |
+ * | | alloca(sz) | | |
+ * | .. | buf->| limit(c)-><0> | |
+ */
+ size_t sz = buf - limit;
+ limit = alloca(sz);
+ limit[0] = 0;
</span> }
}
}
</code></pre>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57663
2016-03-24T16:51:34Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset r54256.</p>
<hr>
<ul>
<li>thread_pthread.c (reserve_stack): fix reserving position where<br>
the stack growing bottom to top. [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: ruby2.3: Segfaults on m68k due to improper stack allocation (Closed)" href="https://bugs.ruby-lang.org/issues/12118">#12118</a>]</li>
</ul>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57706
2016-03-25T21:14:17Z
glaubitz (John Paul Adrian Glaubitz)
<ul></ul><p>Hi!</p>
<p>Thank you very much for your input.</p>
<p>Andreas Schwab just provided a second patch which actually fixed the problem for me. After applying the patch, ruby-2.3 builds fine on m68k.</p>
<p>Here's the patch:</p>
<pre><code>Index: ruby-2.3.0/localeinit.c
===================================================================
--- ruby-2.3.0.orig/localeinit.c
+++ ruby-2.3.0/localeinit.c
@@ -89,7 +89,7 @@ enc_find_index(const char *name)
}
int
-rb_locale_charmap_index(VALUE klass)
+rb_locale_charmap_index(void)
{
return (int)locale_charmap(enc_find_index);
}
Index: ruby-2.3.0/thread_pthread.c
===================================================================
--- ruby-2.3.0.orig/thread_pthread.c
+++ ruby-2.3.0/thread_pthread.c
@@ -691,16 +691,15 @@ reserve_stack(volatile char *limit, size
limit += size;
if (limit > end) {
size = limit - end;
- limit = alloca(size);
+ limit = alloca(stack_check_margin+size);
limit[stack_check_margin+size-1] = 0;
}
}
else {
limit -= size;
if (buf > limit) {
- limit = alloca(buf - limit);
+ limit = alloca(buf - limit + stack_check_margin);
limit[0] = 0; /* ensure alloca is called */
- limit -= stack_check_margin;
}
}
}
</code></pre>
<p>As you can see, the patch corresponds almost the original patch, but includes an update to the function prototype for "rb_locale_charmap_index" in localeinit.c.</p>
<p>Adrian</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57707
2016-03-25T21:41:26Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul></ul><p>Thanks, I also merged the patch for rb_locale_charmap_index.</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57710
2016-03-25T21:43:40Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/12218">Bug #12218</a>: Undefined behaviour</i> added</li></ul>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57738
2016-03-27T17:35:12Z
glaubitz (John Paul Adrian Glaubitz)
<ul></ul><p>I just verified that ruby2.3 works fine on m68k with both the changes from ruby-core:74537 and in rb_locale_charmap_index applied!</p>
<p>Thanks for fixing this issue. And please make sure to backport the fixes to ruby2.3 so that the next updated Debian upload for ruby2.3 will be automatically fixed!</p>
<p>Again, thanks a lot!</p>
<p>Adrian</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57810
2016-03-29T12:07:55Z
usa (Usaku NAKAMURA)
usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED</i> to <i>2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED</i></li></ul><p>ruby_2_1 r54394 merged revision(s) 54256.</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57849
2016-03-29T17:22:29Z
naruse (Yui NARUSE)
naruse@airemix.jp
<ul><li><strong>Backport</strong> changed from <i>2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED</i> to <i>2.1: DONE, 2.2: REQUIRED, 2.3: DONE</i></li></ul><p>ruby_2_3 r54425 merged revision(s) 54256,54291,54292,54293.</p>
Ruby master - Bug #12118: ruby2.3: Segfaults on m68k due to improper stack allocation
https://bugs.ruby-lang.org/issues/12118?journal_id=57855
2016-03-29T21:20:03Z
nagachika (Tomoyuki Chikanaga)
nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.1: DONE, 2.2: REQUIRED, 2.3: DONE</i> to <i>2.1: DONE, 2.2: DONE, 2.3: DONE</i></li></ul><p>Backported into <code>ruby_2_2</code> branch at r54430.</p>