Issue #12893 has been updated by Shugo Maeda.


Yui NARUSE wrote:
> NetBSD pkgsrc and FreeBSD ports were fixed by adding volatile.
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206111

It seems to be a different issue.

I tried adding volatile to `cont` in `cont_new()`, but it didn't work.


----------------------------------------
Bug #12893: trunk fails on linux with clang on test with callcc
https://bugs.ruby-lang.org/issues/12893#change-61281

* Author: Yura Sokolov
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-11-03 trunk 56550) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Test fails on linux with clang.
It doesn't fails with gcc.

OS: Ubuntu 16.04 x64_64
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
configure: `../configure  CC=clang CXX=clang++`
test:

$ make test-all TESTS='-n /callcc/'
....
Run options: "--ruby=./miniruby -I../lib -I. -I.ext/common  ../tool/runruby.rb --extout=.ext  -- --disable-gems" --excludes-dir=../test/excludes --name=!/memory_leak/ -n /callcc/

# Running tests:

[ 1/18] TestArray#test_combination_with_callcc/home/yura/Project/ruby-falcon/test/ruby/test_array.rb:948: [BUG] Segmentation fault at 0x00000000000012
ruby 2.4.0dev (2016-11-03 trunk 56550) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0027 p:---- s:0155 e:000154 CFUNC  :callcc
c:0026 p:0016 s:0151 E:001310 BLOCK  /home/yura/Project/ruby-falcon/test/ruby/test_array.rb:948 [FINISH]
c:0025 p:---- s:0148 e:000147 CFUNC  :combination
c:0024 p:0038 s:0143 E:0021a0 METHOD /home/yura/Project/ruby-falcon/test/ruby/test_array.rb:947
c:0023 p:0036 s:0135 E:000110 METHOD /home/yura/Project/ruby-falcon/test/lib/test/unit.rb:1029
....
-- Ruby level backtrace information ----------------------------------------
....
/home/yura/Project/ruby-falcon/test/lib/test/unit.rb:1029:in `run_test'
/home/yura/Project/ruby-falcon/test/ruby/test_array.rb:947:in `test_combination_with_callcc'
/home/yura/Project/ruby-falcon/test/ruby/test_array.rb:947:in `combination'
/home/yura/Project/ruby-falcon/test/ruby/test_array.rb:948:in `block in test_combination_with_callcc'
/home/yura/Project/ruby-falcon/test/ruby/test_array.rb:948:in `callcc'

-- Machine register context ------------------------------------------------
 RIP: 0x0000559aac7459b3 RBP: 0x00007ffd612aeb40 RSP: 0x00007ffd612aeaf0
 RAX: 0x0000000000000001 RBX: 0x0000559ab4745a50 RCX: 0x00007ffd612aeb3f
 RDX: 0x0000000000000002 RDI: 0x00007ffd612b1000 RSI: 0x0000559ab47765c0
  R8: 0x00007fee67cc4b00  R9: 0x0000559aac744b00 R10: 0x00007fee67cc4b00
 R11: 0x0000000000000020 R12: 0x0000000000000000 R13: 0x0000559ab4745a50
 R14: 0x0000000000000000 R15: 0x0000559aad43b5c0 EFL: 0x0000000000010202

-- C level backtrace information -------------------------------------------
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_vm_bugreport+0x1cd) [0x559aac76652d] ../vm_dump.c:679
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_bug_context+0x1e6) [0x559aac759466] ../error.c:426
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(sigsegv+0x4f) [0x559aac67717f] ../signal.c:897
/lib/x86_64-linux-gnu/libpthread.so.0 [0x7fee678b93e0]
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(cont_capture+0x303) [0x559aac7459b3] ../cont.c:514
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_callcc+0xe) [0x559aac744dbe] ../cont.c:949
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(vm_call_cfunc+0xf1) [0x559aac6e70c1] ../vm_insnhelper.c:1752
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(vm_exec_core+0x27fe) [0x559aac6d0fee] ../insns.def:967
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(vm_exec+0x9d) [0x559aac6e186d] ../vm.c:1711
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(invoke_block_from_c_splattable+0x158) [0x559aac6ef6d8] ../vm.c:1032
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_yield+0x8a) [0x559aac6dc62a] ../vm.c:1069
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(yield_indexed_values+0x197) [0x559aac708857] ../array.c:4970
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_ary_combination+0x3d7) [0x559aac704e47] ../array.c:5137
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(vm_call_cfunc+0xf1) [0x559aac6e70c1] ../vm_insnhelper.c:1752
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(vm_exec_core+0x27fe) [0x559aac6d0fee] ../insns.def:967
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(vm_exec+0x9d) [0x559aac6e186d] ../vm.c:1711
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(invoke_block_from_c_splattable+0x158) [0x559aac6ef6d8] ../vm.c:1032
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_yield+0x8a) [0x559aac6dc62a] ../vm.c:1069
/home/yura/Project/ruby-falcon/.bld-clang~/ruby(rb_ary_collect+0x229) [0x559aac6ff5c9] ../array.c:2732




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>