Ruby Issue Tracking System: Issueshttps://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112024-03-28T04:51:22ZRuby Issue Tracking System
Redmine Ruby master - Bug #20398 (Open): heap-buffer-overflow in numeric literal parsinghttps://redmine.ruby-lang.org/issues/203982024-03-28T04:51:22Zkjtsanaktsidis (KJ Tsanaktsidis)kjtsanaktsidis@gmail.com
<p>I found the following ASAN error in <code>TestRubyLiteral#test_integer</code>. It appears that this code is calling strdup on a non-null terminated string.</p>
<pre><code>[1/1] TestRubyLiteral#test_integer=================================================================
==484771==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x5060001ab1fc at pc 0x5597fe21d8e1 bp 0x7ffdc6fb0a50 sp 0x7ffdc6fb0210
READ of size 61 at 0x5060001ab1fc thread T0
#0 0x5597fe21d8e0 in strlen.part.0 /home/kj/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:391:5
#1 0x5597fe6b2feb in ruby_strdup /home/kj/ruby/build/../util.c:538:18
#2 0x5597fe4cb1c5 in set_number_literal /home/kj/ruby/build/parse.y:9694:9
#3 0x5597fe4cab3d in no_digits /home/kj/ruby/build/parse.y:10409:12
#4 0x5597fe4b9de9 in parse_numeric /home/kj/ruby/build/parse.y
#5 0x5597fe4a8adf in parser_yylex /home/kj/ruby/build/parse.y
#6 0x5597fe45c5cd in yylex /home/kj/ruby/build/parse.y:11916:9
#7 0x5597fe45c5cd in ruby_yyparse /home/kj/ruby/build/parse.c:11200:16
#8 0x5597fe49dc00 in yycompile0 /home/kj/ruby/build/parse.y:8121:9
#9 0x5597fe76db1b in rb_suppress_tracing /home/kj/ruby/build/../vm_trace.c:487:18
#10 0x5597fe494416 in yycompile /home/kj/ruby/build/parse.y:8177:5
#11 0x5597fe494416 in parser_compile_string /home/kj/ruby/build/parse.y:8240:12
#12 0x5597fe494416 in rb_ruby_parser_compile_string_path /home/kj/ruby/build/parse.y:8247:12
#13 0x5597fe498858 in rb_parser_compile_string_path /home/kj/ruby/build/parse.y:16663:12
#14 0x5597fe75688c in eval_make_iseq /home/kj/ruby/build/../vm_eval.c:1799:11
#15 0x5597fe70c8fa in eval_string_with_cref /home/kj/ruby/build/../vm_eval.c:1837:12
#16 0x5597fe70c396 in rb_f_eval /home/kj/ruby/build/../vm_eval.c:1912:16
#17 0x5597fe73f5e2 in vm_call_cfunc_with_frame_ /home/kj/ruby/build/../vm_insnhelper.c:3492:11
#18 0x5597fe6dca64 in vm_sendish /home/kj/ruby/build/../vm_callinfo.h
#19 0x5597fe6e64fa in vm_exec_core /home/kj/ruby/build/../insns.def:867:11
#20 0x5597fe6dde00 in vm_exec_loop /home/kj/ruby/build/../vm.c:2578:22
#21 0x5597fe6dde00 in rb_vm_exec /home/kj/ruby/build/../vm.c:2557:18
#22 0x5597fe758bc4 in invoke_block /home/kj/ruby/build/../vm.c:1515:12
#23 0x5597fe758bc4 in invoke_iseq_block_from_c /home/kj/ruby/build/../vm.c:1585:16
#24 0x5597fe758bc4 in invoke_block_from_c_bh /home/kj/ruby/build/../vm.c:1603:20
#25 0x5597fe70e4b7 in vm_yield_with_cref /home/kj/ruby/build/../vm.c:1640:12
#26 0x5597fe709861 in vm_yield /home/kj/ruby/build/../vm.c:1648:12
#27 0x5597fe709861 in rb_yield_0 /home/kj/ruby/build/../vm_eval.c:1366:12
#28 0x5597fe709861 in rb_yield /home/kj/ruby/build/../vm_eval.c
#29 0x5597fec0eff9 in rb_ary_collect /home/kj/ruby/build/../array.c:3601:30
#30 0x5597fe73f5e2 in vm_call_cfunc_with_frame_ /home/kj/ruby/build/../vm_insnhelper.c:3492:11
#31 0x5597fe6dca64 in vm_sendish /home/kj/ruby/build/../vm_callinfo.h
#32 0x5597fe6e2d8f in vm_exec_core /home/kj/ruby/build/../insns.def:847:11
#33 0x5597fe6dde00 in vm_exec_loop /home/kj/ruby/build/../vm.c:2578:22
#34 0x5597fe6dde00 in rb_vm_exec /home/kj/ruby/build/../vm.c:2557:18
#35 0x5597fe3ffe9e in load_iseq_eval /home/kj/ruby/build/../load.c:778:5
#36 0x5597fe3fb498 in require_internal /home/kj/ruby/build/../load.c:1284:21
#37 0x5597fe3f9bf3 in rb_require_string_internal /home/kj/ruby/build/../load.c:1383:18
#38 0x5597fe73f5e2 in vm_call_cfunc_with_frame_ /home/kj/ruby/build/../vm_insnhelper.c:3492:11
#39 0x5597fe6dca64 in vm_sendish /home/kj/ruby/build/../vm_callinfo.h
#40 0x5597fe6e64fa in vm_exec_core /home/kj/ruby/build/../insns.def:867:11
#41 0x5597fe6dda82 in rb_vm_exec /home/kj/ruby/build/../vm.c:2551:22
#42 0x5597fe30a753 in rb_ec_exec_node /home/kj/ruby/build/../eval.c:283:9
#43 0x5597fe30a43d in ruby_run_node /home/kj/ruby/build/../eval.c:323:30
#44 0x5597fe3059b0 in rb_main /home/kj/ruby/build/../main.c:40:12
#45 0x5597fe3059b0 in main /home/kj/ruby/build/../main.c:59:12
#46 0x7f1a93141149 in __libc_start_call_main /usr/src/debug/glibc-2.38-16.fc39.x86_64/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#47 0x7f1a9314120a in __libc_start_main@GLIBC_2.2.5 /usr/src/debug/glibc-2.38-16.fc39.x86_64/csu/../csu/libc-start.c:360:3
#48 0x5597fe1d3e34 in _start (/home/kj/ruby/build/ruby+0x38ae34)
0x5060001ab1fc is located 0 bytes after 60-byte region [0x5060001ab1c0,0x5060001ab1fc)
allocated by thread T0 here:
#0 0x5597fe2bde4f in malloc /home/kj/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:68:3
#1 0x5597fe3491a9 in objspace_xmalloc0 /home/kj/ruby/build/../gc.c:12605:5
#2 0x5597fe4a8adf in parser_yylex /home/kj/ruby/build/parse.y
#3 0x5597fe45c5cd in yylex /home/kj/ruby/build/parse.y:11916:9
#4 0x5597fe45c5cd in ruby_yyparse /home/kj/ruby/build/parse.c:11200:16
#5 0x5597fe49dc00 in yycompile0 /home/kj/ruby/build/parse.y:8121:9
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/kj/ruby/build/../util.c:538:18 in ruby_strdup
Shadow bytes around the buggy address:
0x5060001aaf00: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
0x5060001aaf80: 00 00 00 00 00 00 00 04 fa fa fa fa 00 00 00 00
0x5060001ab000: 00 00 00 fa fa fa fa fa 00 00 00 00 00 00 00 fa
0x5060001ab080: fa fa fa fa 00 00 00 00 00 00 00 00 fa fa fa fa
0x5060001ab100: 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 00 00
=>0x5060001ab180: 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 00[04]
0x5060001ab200: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
0x5060001ab280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x5060001ab300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x5060001ab380: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x5060001ab400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==484771==ABORTING
</code></pre> Ruby master - Bug #20397 (Open): The nkf license in LEGAL file seems to be obsoletehttps://redmine.ruby-lang.org/issues/203972024-03-27T17:22:36Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>The LEGAL file seems to contain <a href="https://github.com/ruby/ruby/blob/a69f0047cb489c136001937442c1d2ffd8ea1dd7/LEGAL?plain=1#L730-L746" class="external">obsolete information</a> about nkf license.</p>
<p>It seems that nkf indeed use such license, but in upstream, it was first changed to <a href="https://github.com/nurse/nkf/commit/c12280757bfb275d6f9e6b0bf6293a28b060e77b" class="external">MIT</a> and then immediately to <a href="https://github.com/nurse/nkf/commit/2ed3e1c270f1deb9487f7bc7d7586030fe7dabc5" class="external">zlib</a> license.</p>
<p>Ruby has picked up that change with <a class="changeset" title="* ext/nkf/nkf-utf8/nkf.c: Update nkf to 2.0.9. revert -s meaning as Shift_JIS, etc. git-svn-id..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/13313688b243882aff7815598ddd9fcbae69bc17">git|13313688b243882aff7815598ddd9fcbae69bc17</a></p>
<p>Maybe <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/5">@naruse (Yui NARUSE)</a> can comment about this.</p> Ruby master - Bug #20395 (Open): Invalid license note in vsnprintf.chttps://redmine.ruby-lang.org/issues/203952024-03-26T11:19:39Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>I am looking into Ruby licenses and I stumble upon vsnprintf.c, namely about these lines:</p>
<pre><code>/*
* IMPORTANT NOTE:
* --------------
* From ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
* paragraph 3 above is now null and void.
*/
</code></pre>
<p>I doubt the note is valid since <a class="changeset" title="* missing/crypt.c: replaced with 4.4BSD version. * missing/erf.c: ditto. * missing/vsnprintf.c:..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/626f1ee196fe06514d66771ff0e3f82d7686af25">git|626f1ee196fe06514d66771ff0e3f82d7686af25</a>, which actually removes the 3rd clause, while the (broken) URL refers to "4bsd". Can somebody please review? The note from the URL can be likely viewed e.g. <a href="https://www.freebsd.org/copyright/license/" class="external">here</a></p> Ruby master - Bug #20346 (Open): FiberScheduler.unblock not called by Thread#join when Thread bod...https://redmine.ruby-lang.org/issues/203462024-03-18T19:06:21Zforthoney (Seong-Heon Jung)castlehoneyjung@gmail.com
<p>When using a <code>Ractor.take</code> inside a different thread, <code>Thread#join</code> on the thread running <code>Ractor.take</code> fails to call <code>FiberScheduler.unblock</code>. The below code can replicate this behavior</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s2">"async"</span>
<span class="k">class</span> <span class="nc">RactorWrapper</span>
<span class="k">def</span> <span class="nf">initialize</span>
<span class="vi">@ractor</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">recv</span> <span class="c1"># Ractor doesn't start until explicitly told to</span>
<span class="c1"># Do some calculations</span>
<span class="n">fib</span> <span class="o">=</span> <span class="o">-></span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="p">{</span> <span class="n">x</span> <span class="o"><</span> <span class="mi">2</span> <span class="p">?</span> <span class="mi">1</span> <span class="p">:</span> <span class="n">fib</span><span class="p">.</span><span class="nf">call</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="n">fib</span><span class="p">.</span><span class="nf">call</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span> <span class="p">}</span>
<span class="n">fib</span><span class="p">.</span><span class="nf">call</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">take_async</span>
<span class="vi">@ractor</span><span class="p">.</span><span class="nf">send</span><span class="p">(</span><span class="kp">nil</span><span class="p">)</span>
<span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="vi">@ractor</span><span class="p">.</span><span class="nf">take</span> <span class="p">}.</span><span class="nf">join</span><span class="p">.</span><span class="nf">value</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="no">Async</span> <span class="k">do</span> <span class="o">|</span><span class="n">task</span><span class="o">|</span>
<span class="mi">10000</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">i</span><span class="o">|</span>
<span class="n">task</span><span class="p">.</span><span class="nf">async</span> <span class="k">do</span>
<span class="no">RactorWrapper</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">take_async</span>
<span class="nb">puts</span> <span class="n">i</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
</code></pre>
<p>The above code deadlocks, and when we leave a debugging print statement inside of <code>Async</code>'s scheduler's <code>block</code> and <code>unblock</code> method, we can confirm that we only call <code>Scheduler.block</code>, and never <code>Scheduler.unblock</code></p> Ruby master - Bug #20344 (Open): argument stack underflow (-1)https://redmine.ruby-lang.org/issues/203442024-03-18T15:37:22Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<p>This file produces argument stack underflow, since ruby 2.5.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">proc</span> <span class="k">do</span>
<span class="k">next</span> <span class="k">if</span> <span class="kp">true</span>
<span class="k">case</span> <span class="kp">nil</span>
<span class="k">when</span> <span class="s2">"a"</span>
<span class="k">next</span>
<span class="k">when</span> <span class="s2">"b"</span>
<span class="k">when</span> <span class="s2">"c"</span>
<span class="nb">proc</span> <span class="p">{}</span>
<span class="k">end</span>
<span class="k">next</span> <span class="k">unless</span> <span class="kp">true</span>
<span class="k">end</span>
</code></pre>
<pre><code>-- raw disasm--------
trace: 100
0000 nop ( 1)
<L000> [sp: 0, unremovable: 1, refcnt: 5]
trace: 1
<L004> [sp: 0, unremovable: 0, refcnt: 1]
adjust: [label: 0]
0001 putnil ( 2)
0002 leave ( 13)
<L008> [sp: 1, unremovable: 0, refcnt: 1]
adjust: [label: 0]
0003 putnil ( 6)
0004 leave ( 13)
adjust: [label: 8]
0005 jump <L005> ( 5)
0007 pop ( 7)
0008 jump <L005> ( 7)
* 0010 pop ( 8)
trace: 1
<L011> [sp: -1, unremovable: 1, refcnt: 1]
0011 putself ( 9)
0012 send <calldata:proc, 0>, nil ( 9)
<L012> [sp: -1, unremovable: 0, refcnt: 2]
0015 pop ( 9)
<L005> [sp: 1, unremovable: 0, refcnt: 2]
trace: 1
0016 putnil ( 12)
<L001> [sp: -1, unremovable: 0, refcnt: 3]
trace: 200
0017 leave ( 13)
---------------------
</code></pre> Ruby master - Bug #20342 (Open): Top level `public`, `private` and `ruby2_keywords` do not work i...https://redmine.ruby-lang.org/issues/203422024-03-16T10:21:57Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<p>With this file:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1"># load.rb</span>
<span class="kp">public</span> <span class="k">def</span> <span class="nf">f</span> <span class="o">=</span> <span class="ss">:ok</span>
</code></pre>
<p>It is OK when <code>require</code>d.</p>
<pre><code data-language="sh-session">$ ruby -r ./load.rb -e 'p f'
:ok
</code></pre>
<p>Simple <code>load</code> is OK too.</p>
<pre><code data-language="sh-session">$ ruby -e 'load ARGV[0]; p f' load.rb
:ok
</code></pre>
<p>Wrapped <code>load</code> fails.</p>
<pre><code data-language="sh-session">$ ruby -e 'load ARGV[0], true' load.rb
load.rb:1:in 'public': undefined method 'f' for class 'Object' (NameError)
public def f = :ok
^^^^^^
from load.rb:1:in '<top (required)>'
from -e:1:in 'Kernel#load'
from -e:1:in '<main>'
</code></pre> Ruby master - Bug #20330 (Open): [BUG] Segmentation fault at 0xffffffffffffffffhttps://redmine.ruby-lang.org/issues/203302024-03-09T10:33:11Zl33tname (Sir l33tname)sirl33tname@gmail.com
<p>I get a segfault from ruby on fly.io (a platform to run full stack apps).<br>
As you can see from the stacktracke im using a jemalloc version but im getting the same crash with the<br>
ruby:3.3.0-slim docker image. (Thats the docker file: <a href="https://github.com/Binaergewitter/serious-bg/blob/be890bf6af110b02f22f359d395bedb0659f4243/Dockerfile.fly" class="external">https://github.com/Binaergewitter/serious-bg/blob/be890bf6af110b02f22f359d395bedb0659f4243/Dockerfile.fly</a> based on quay.io/evl.ms/fullstaq-ruby:3.3.0-jemalloc-slim)</p>
<p>Reverting back to ruby 3.2.3 solved the issue for now: <a href="https://github.com/Binaergewitter/serious-bg/commit/4eed4119706303383ce5994c796bc5a8a1813afc" class="external">https://github.com/Binaergewitter/serious-bg/commit/4eed4119706303383ce5994c796bc5a8a1813afc</a></p>
<p>I was not able to reproduce it locally.<br>
But the application is open source -> <a href="https://github.com/Binaergewitter/serious-bg" class="external">https://github.com/Binaergewitter/serious-bg</a></p>
<pre><code>2024-03-09T09:31:07Z app[3d8d7d99f40128] iad [info][ 0.037737] Spectre V2 : WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!
2024-03-09T09:31:07Z app[3d8d7d99f40128] iad [info][ 0.041193] PCI: Fatal: No config space access function found
2024-03-09T09:31:07Z app[3d8d7d99f40128] iad [info] INFO Starting init (commit: 913ad9c)...
2024-03-09T09:31:07Z app[3d8d7d99f40128] iad [info] INFO Preparing to run: `bundle exec puma -e production -b tcp://0.0.0.0:8080 -t 0:5` as root
2024-03-09T09:31:07Z app[3d8d7d99f40128] iad [info] INFO [fly api proxy] listening at /.fly/api
2024-03-09T09:31:07Z app[3d8d7d99f40128] iad [info]2024/03/09 09:31:07 listening on [fdaa:0:182f:a7b:22c:a04d:ac4:2]:22 (DNS: [fdaa::3]:53)
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems.rb:165: [BUG] Segmentation fault at 0xffffffffffffffff
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +jemalloc [x86_64-linux]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]-- Control frame information -----------------------------------------------
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]c:0005 p:0074 s:0023 e:000021 CLASS /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems.rb:165
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]c:0004 p:0045 s:0019 e:000018 TOP /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems.rb:115 [FINISH]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]c:0003 p:---- s:0012 e:000011 CFUNC :require
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]c:0002 p:0012 s:0007 e:000006 TOP <internal:gem_prelude>:2 [FINISH]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]c:0001 p:0000 s:0003 E:0001c0 DUMMY [FINISH]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]-- Ruby level backtrace information ----------------------------------------
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]<internal:gem_prelude>:2:in `<internal:gem_prelude>'
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]<internal:gem_prelude>:2:in `require'
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems.rb:115:in `<top (required)>'
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems.rb:165:in `<module:Gem>'
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]-- Threading information ---------------------------------------------------
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]Total ractor count: 1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]Ruby thread count for this ractor: 1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]-- Machine register context ------------------------------------------------
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] RIP: 0x00007fc80e6c51b4 RBP: 0x00007fc80c400050 RSP: 0x00007ffee5a36a98
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] RAX: 0xffffffffffffffff RBX: 0x00007fc80c4003e8 RCX: 0x00007fc80c4003e9
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] RDX: 0xffffffffffffffff RDI: 0x00007fc80d8170d0 RSI: 0x000000000000c2d3
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] R8: 0x0000000000000000 R9: 0x00007fc80da36340 R10: 0x0000000000000001
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] R11: 0x00007fc80e026880 R12: 0x00007fc80ea4b860 R13: 0x0000000000000001
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] R14: 0x00007fc80c400550 R15: 0x00007fc80e026880 EFL: 0x0000000000010202
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]-- C level backtrace information -------------------------------------------
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_vm_bugreport+0x96b) [0x7fc80e77adab]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_bug_for_fatal_signal+0x100) [0x7fc80e576720]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(sigsegv+0x4b) [0x7fc80e6c74db]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/lib/x86_64-linux-gnu/libc.so.6(0x7fc80e13a050) [0x7fc80e13a050]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_insert_aux+0x364) [0x7fc80e6c51b4]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_cache_ancestors+0x8f) [0x7fc80e6c552f]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_cache_ancestors+0x6d) [0x7fc80e6c550d]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_cache_ancestors+0x6d) [0x7fc80e6c550d]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_cache_ancestors+0x6d) [0x7fc80e6c550d]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_cache_ancestors+0x6d) [0x7fc80e6c550d]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(redblack_cache_ancestors+0x6d) [0x7fc80e6c550d]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_shape_get_next+0x2a8) [0x7fc80e6c6458]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_class_ivar_set+0xb0) [0x7fc80e742560]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_ivar_set+0x83) [0x7fc80e742743]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(vm_exec_core+0x8ca) [0x7fc80e75ea1a]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_vm_exec+0x179) [0x7fc80e7640f9]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(require_internal+0xd2f) [0x7fc80e5e84bf]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_require_string+0x66) [0x7fc80e5e9156]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(vm_call_cfunc_other+0x169) [0x7fc80e74cf29]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(vm_exec_core+0x129) [0x7fc80e75e279]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_vm_exec+0x179) [0x7fc80e7640f9]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(ruby_opt_init.part.0+0xbf) [0x7fc80e6c185f]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(load_file_internal+0x47e) [0x7fc80e6c1e7e]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(rb_ensure+0x110) [0x7fc80e580190]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(process_options+0x15fb) [0x7fc80e6c38ab]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(ruby_process_options+0x145) [0x7fc80e6c3ff5]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3(ruby_options+0xc9) [0x7fc80e581249]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby(0x56225c24510a) [0x56225c24510a]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/lib/x86_64-linux-gnu/libc.so.6(0x7fc80e12524a) [0x7fc80e12524a]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7fc80e125305]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]/usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby(_start+0x21) [0x56225c245151]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]-- Other runtime information -----------------------------------------------
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]* Loaded script: /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]* Loaded features:
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 0 enumerator.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 1 thread.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 2 fiber.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 3 rational.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 4 complex.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 5 ruby2_keywords.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 6 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/encdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 7 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/trans/transdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 8 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/rbconfig.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 9 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems/compatibility.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 10 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems/defaults.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 11 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems/deprecate.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info] 12 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/rubygems/errors.rb
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]* Process memory map:
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]56225c244000-56225c245000 r--p 00000000 fe:00 134645 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]56225c245000-56225c246000 r-xp 00001000 fe:00 134645 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]56225c246000-56225c247000 r--p 00002000 fe:00 134645 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]56225c247000-56225c248000 r--p 00002000 fe:00 134645 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]56225c248000-56225c249000 rw-p 00003000 fe:00 134645 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80994f000-7fc80a000000 r--s 00000000 fe:00 134864 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a000000-7fc80a400000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a54a000-7fc80a720000 r--s 00000000 fe:00 131782 /usr/lib/x86_64-linux-gnu/libc.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a720000-7fc80a7b0000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a7bf000-7fc80a7c0000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a7c0000-7fc80a861000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a861000-7fc80a862000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a862000-7fc80a903000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a903000-7fc80a904000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a904000-7fc80a9a5000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a9a5000-7fc80a9a6000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80a9a6000-7fc80aa47000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aa47000-7fc80aa48000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aa48000-7fc80aae9000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aae9000-7fc80aaea000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aaea000-7fc80ab8b000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ab8b000-7fc80ab8c000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ab8c000-7fc80ac2d000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ac2d000-7fc80ac2e000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ac2e000-7fc80accf000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80accf000-7fc80acd0000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80acd0000-7fc80ad71000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ad71000-7fc80ad72000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ad72000-7fc80ae13000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ae13000-7fc80ae14000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ae14000-7fc80aeb5000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aeb5000-7fc80aeb6000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aeb6000-7fc80af57000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80af57000-7fc80af58000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80af58000-7fc80aff9000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80aff9000-7fc80affa000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80affa000-7fc80b09b000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b09b000-7fc80b09c000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b09c000-7fc80b13d000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b13d000-7fc80b13e000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b13e000-7fc80b1df000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b1df000-7fc80b1e0000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b1e0000-7fc80b281000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b281000-7fc80b282000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b282000-7fc80b323000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b323000-7fc80b324000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b324000-7fc80b3c5000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b3c5000-7fc80b3c6000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b3c6000-7fc80b467000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b467000-7fc80b468000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b468000-7fc80b509000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b509000-7fc80b50a000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b50a000-7fc80b5ab000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b5ab000-7fc80b5ac000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b5ac000-7fc80b64d000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b64d000-7fc80b64e000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b64e000-7fc80b6ef000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b6ef000-7fc80b6f0000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b6f0000-7fc80b791000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b791000-7fc80b792000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b792000-7fc80b833000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b833000-7fc80b834000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b834000-7fc80b8d5000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b8d5000-7fc80b8d6000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b8d6000-7fc80b977000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b977000-7fc80b978000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80b978000-7fc80ba19000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ba19000-7fc80ba1a000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ba1a000-7fc80babb000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80babb000-7fc80babc000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80babc000-7fc80bb5d000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80bb5d000-7fc80bb5e000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80bb5e000-7fc80bbff000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80bbff000-7fc80bc00000 ---p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80bc00000-7fc80e000000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e010000-7fc80e020000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e020000-7fc80e070000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e074000-7fc80e075000 r--p 00000000 fe:00 136223 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/trans/transdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e075000-7fc80e076000 r-xp 00001000 fe:00 136223 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/trans/transdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e076000-7fc80e077000 r--p 00002000 fe:00 136223 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/trans/transdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e077000-7fc80e078000 r--p 00002000 fe:00 136223 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/trans/transdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e078000-7fc80e079000 rw-p 00003000 fe:00 136223 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/trans/transdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e079000-7fc80e07a000 r--p 00000000 fe:00 136179 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/encdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e07a000-7fc80e07b000 r-xp 00001000 fe:00 136179 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/encdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e07b000-7fc80e07c000 r--p 00002000 fe:00 136179 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/encdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e07c000-7fc80e07d000 r--p 00002000 fe:00 136179 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/encdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e07d000-7fc80e07e000 rw-p 00003000 fe:00 136179 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/ruby/3.3.0/x86_64-linux/enc/encdb.so
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e07e000-7fc80e085000 r--s 00000000 fe:00 131755 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e085000-7fc80e0dc000 r--p 00000000 fe:00 131399 /usr/lib/locale/C.utf8/LC_CTYPE
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0dc000-7fc80e0de000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0de000-7fc80e0e1000 r--p 00000000 fe:00 131804 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0e1000-7fc80e0f8000 r-xp 00003000 fe:00 131804 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0f8000-7fc80e0fc000 r--p 0001a000 fe:00 131804 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0fc000-7fc80e0fd000 r--p 0001d000 fe:00 131804 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0fd000-7fc80e0fe000 rw-p 0001e000 fe:00 131804 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e0fe000-7fc80e124000 r--p 00000000 fe:00 131782 /usr/lib/x86_64-linux-gnu/libc.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e124000-7fc80e279000 r-xp 00026000 fe:00 131782 /usr/lib/x86_64-linux-gnu/libc.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e279000-7fc80e2cc000 r--p 0017b000 fe:00 131782 /usr/lib/x86_64-linux-gnu/libc.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e2cc000-7fc80e2d0000 r--p 001ce000 fe:00 131782 /usr/lib/x86_64-linux-gnu/libc.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e2d0000-7fc80e2d2000 rw-p 001d2000 fe:00 131782 /usr/lib/x86_64-linux-gnu/libc.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e2d2000-7fc80e2e1000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e2e1000-7fc80e2f1000 r--p 00000000 fe:00 131821 /usr/lib/x86_64-linux-gnu/libm.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e2f1000-7fc80e364000 r-xp 00010000 fe:00 131821 /usr/lib/x86_64-linux-gnu/libm.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e364000-7fc80e3be000 r--p 00083000 fe:00 131821 /usr/lib/x86_64-linux-gnu/libm.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3be000-7fc80e3bf000 r--p 000dc000 fe:00 131821 /usr/lib/x86_64-linux-gnu/libm.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3bf000-7fc80e3c0000 rw-p 000dd000 fe:00 131821 /usr/lib/x86_64-linux-gnu/libm.so.6
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3c0000-7fc80e3c2000 r--p 00000000 fe:00 131791 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3c2000-7fc80e3d8000 r-xp 00002000 fe:00 131791 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3d8000-7fc80e3f2000 r--p 00018000 fe:00 131791 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3f2000-7fc80e3f3000 r--p 00031000 fe:00 131791 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3f3000-7fc80e3f4000 rw-p 00032000 fe:00 131791 /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3f4000-7fc80e3fc000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3fc000-7fc80e3ff000 r--p 00000000 fe:00 134861 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libjemalloc.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e3ff000-7fc80e436000 r-xp 00003000 fe:00 134861 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libjemalloc.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e436000-7fc80e43e000 r--p 0003a000 fe:00 134861 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libjemalloc.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e43e000-7fc80e440000 r--p 00042000 fe:00 134861 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libjemalloc.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e440000-7fc80e441000 rw-p 00044000 fe:00 134861 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libjemalloc.so.1
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e441000-7fc80e442000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e442000-7fc80e445000 r--p 00000000 fe:00 131881 /usr/lib/x86_64-linux-gnu/libz.so.1.2.13
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e445000-7fc80e458000 r-xp 00003000 fe:00 131881 /usr/lib/x86_64-linux-gnu/libz.so.1.2.13
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e458000-7fc80e45f000 r--p 00016000 fe:00 131881 /usr/lib/x86_64-linux-gnu/libz.so.1.2.13
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e45f000-7fc80e460000 r--p 0001c000 fe:00 131881 /usr/lib/x86_64-linux-gnu/libz.so.1.2.13
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e460000-7fc80e461000 rw-p 0001d000 fe:00 131881 /usr/lib/x86_64-linux-gnu/libz.so.1.2.13
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e461000-7fc80e465000 r--s 00000000 fe:00 134645 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/bin/ruby
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e465000-7fc80e4b0000 r--p 00000000 fe:00 134864 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e4b0000-7fc80e89a000 r-xp 0004b000 fe:00 134864 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80e89a000-7fc80ea21000 r--p 00435000 fe:00 134864 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea21000-7fc80ea38000 r--p 005bb000 fe:00 134864 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea38000-7fc80ea3c000 rw-p 005d2000 fe:00 134864 /usr/lib/fullstaq-ruby/versions/3.3.0-jemalloc/lib/libruby.so.3.3.0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea3c000-7fc80ea53000 rw-p 00000000 00:00 0
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea53000-7fc80ea54000 r--p 00000000 fe:00 131764 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea54000-7fc80ea79000 r-xp 00001000 fe:00 131764 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea79000-7fc80ea83000 r--p 00026000 fe:00 131764 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea83000-7fc80ea85000 r--p 00030000 fe:00 131764 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7fc80ea85000-7fc80ea87000 rw-p 00032000 fe:00 131764 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7ffee523b000-7ffee5a3a000 rw-p 00000000 00:00 0 [stack]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7ffee5ba8000-7ffee5bac000 r--p 00000000 00:00 0 [vvar]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]7ffee5bac000-7ffee5bae000 r-xp 00000000 00:00 0 [vdso]
2024-03-09T09:31:08Z app[3d8d7d99f40128] iad [info]ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
</code></pre> Ruby master - Bug #20285 (Assigned): Stale inline method caches when refinement modules are reopenedhttps://redmine.ruby-lang.org/issues/202852024-02-21T02:44:55Zjhawthorn (John Hawthorn)
<p>This is essentially the same issue as <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: refinement (Closed)" href="https://redmine.ruby-lang.org/issues/11672">#11672</a>, but for inline method caches rather than class caches.</p>
<p>In Ruby 3.3 we started using inline caches for refinements. However, we weren't clearing inline caches when defined on a reopened refinement module.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">C</span>
<span class="k">end</span>
<span class="k">module</span> <span class="nn">R</span>
<span class="n">refine</span> <span class="no">C</span> <span class="k">do</span>
<span class="k">def</span> <span class="nf">m</span>
<span class="ss">:foo</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">using</span> <span class="no">R</span>
<span class="k">def</span> <span class="nf">m</span>
<span class="no">C</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">m</span>
<span class="k">end</span>
<span class="k">raise</span> <span class="k">unless</span> <span class="ss">:foo</span> <span class="o">==</span> <span class="n">m</span><span class="p">()</span>
<span class="k">module</span> <span class="nn">R</span>
<span class="n">refine</span> <span class="no">C</span> <span class="k">do</span>
<span class="k">alias</span> <span class="n">m</span> <span class="n">m</span>
<span class="k">def</span> <span class="nf">m</span>
<span class="ss">:bar</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">v</span> <span class="o">=</span> <span class="n">m</span><span class="p">()</span>
<span class="k">raise</span> <span class="s2">"expected :bar, got </span><span class="si">#{</span><span class="n">v</span><span class="p">.</span><span class="nf">inspect</span><span class="si">}</span><span class="s2">"</span> <span class="k">unless</span> <span class="ss">:bar</span> <span class="o">==</span> <span class="n">v</span>
</code></pre>
<p>This will raise in Ruby 3.3 as the inline cache finds a stale refinement, but passes in previous versions.</p> Ruby master - Bug #20255 (Open): Embedded arrays aren't moved correctly across ractorshttps://redmine.ruby-lang.org/issues/202552024-02-10T17:31:30Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p><code>ractor.send(ary, move: true)</code> works incorrectly because if <code>ary</code> is embedded, the new moved object doesn't populate its own embedded space, it uses the MovedObject's embedded space.</p>
<p>example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span>
<span class="n">inner_ary</span> <span class="o">=</span> <span class="n">receive</span>
<span class="n">values</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">values</span><span class="p">[</span><span class="ss">:equal</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">inner_ary</span> <span class="o">==</span> <span class="p">[</span><span class="s2">""</span><span class="p">,{},</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">])</span>
<span class="n">values</span><span class="p">[</span><span class="ss">:string</span><span class="p">]</span> <span class="o">=</span> <span class="n">inner_ary</span><span class="p">.</span><span class="nf">to_s</span>
<span class="n">values</span>
<span class="p">}</span>
<span class="n">ary</span> <span class="o">=</span> <span class="p">[</span><span class="no">String</span><span class="p">.</span><span class="nf">new</span><span class="p">,</span><span class="no">Hash</span><span class="p">.</span><span class="nf">new</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">]</span>
<span class="n">r</span><span class="p">.</span><span class="nf">send</span><span class="p">(</span><span class="n">ary</span><span class="p">,</span> <span class="ss">move: </span><span class="kp">true</span><span class="p">)</span>
<span class="n">r_values</span> <span class="o">=</span> <span class="n">r</span><span class="p">.</span><span class="nf">take</span>
<span class="nb">p</span> <span class="n">r_values</span><span class="p">[</span><span class="ss">:equal</span><span class="p">]</span>
<span class="nb">p</span> <span class="n">r_values</span><span class="p">[</span><span class="ss">:string</span><span class="p">]</span>
<span class="c1"># => false</span>
<span class="c1"># => "[\"\", {}, 2, 2.0, 21747991570, String, 3]"</span>
</code></pre> Ruby master - Bug #20237 (Assigned): Unable to unshare(CLONE_NEWUSER) in Linux because of timer t...https://redmine.ruby-lang.org/issues/202372024-02-05T04:59:20Zhanazuki (Kasumi Hanazuki)
<a name="Backgrounds"></a>
<h2 >Backgrounds<a href="#Backgrounds" class="wiki-anchor">¶</a></h2>
<p><a href="https://man7.org/linux/man-pages/man2/unshare.2.html" class="external">unshare(2)</a> is a syscall in Linux to move the calling process into a fresh execution context. With <code>unshare(CLONE_NEWUSER)</code> you can move a process into a new <a href="https://man7.org/linux/man-pages/man7/user_namespaces.7.html" class="external">user_namespace(7)</a>, where the process gains the full capability on the resources within the namespace. This is fundamental for Linux containers to achieve privilege separation. <code>unshare(CLONE_NEWUSER)</code> requires the calling process to be single-threaded (or no background threads are running). So, it is often invoked after <code>fork(2)</code> as forking propagates only the calling thread to the child process.</p>
<a name="Problem"></a>
<h2 >Problem<a href="#Problem" class="wiki-anchor">¶</a></h2>
<p>It becomes a problem that Ruby 3.3 on Linux uses timer threads even for a single-<code>Thread</code>ed application. Because <code>Kernel#fork</code> spawns a thread in the child process before the control returns to the user code, there is no chance to call <code>unshare(CLONE_NEWUSER)</code> in Ruby.</p>
<p>The following snippet is a reproducer of this problem. This program first forks and then shows the user namespace to which the process belongs before and after calling unshare(2). It also shows the threads of the child process after forking.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">p</span><span class="p">(</span><span class="no">RUBY_DESCRIPTION</span><span class="p">:)</span>
<span class="nb">require</span> <span class="s1">'fiddle/import'</span>
<span class="k">module</span> <span class="nn">C</span>
<span class="kp">extend</span> <span class="no">Fiddle</span><span class="o">::</span><span class="no">Importer</span>
<span class="n">dlload</span> <span class="s1">'libc.so.6'</span>
<span class="n">extern</span> <span class="s1">'int unshare(int flags)'</span>
<span class="no">CLONE_NEWUSER</span> <span class="o">=</span> <span class="mh">0x10000000</span>
<span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">raise_system_call_error</span>
<span class="k">raise</span> <span class="no">SystemCallError</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="no">Fiddle</span><span class="p">.</span><span class="nf">last_error</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">pid</span> <span class="o">=</span> <span class="nb">fork</span> <span class="k">do</span>
<span class="nb">system</span><span class="p">(</span><span class="s2">"ps -O tid -T -p #$$"</span><span class="p">)</span>
<span class="nb">system</span><span class="p">(</span><span class="s2">"ls -l /proc/self/ns/user"</span><span class="p">)</span>
<span class="k">if</span> <span class="no">C</span><span class="p">.</span><span class="nf">unshare</span><span class="p">(</span><span class="no">C</span><span class="o">::</span><span class="no">CLONE_NEWUSER</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span>
<span class="no">C</span><span class="p">.</span><span class="nf">raise_system_call_error</span> <span class="c1"># => EINVAL with Ruby 3.3</span>
<span class="k">end</span>
<span class="nb">system</span><span class="p">(</span><span class="s2">"ls -l /proc/self/ns/user"</span><span class="p">)</span>
<span class="k">end</span>
<span class="nb">p</span> <span class="no">Process</span><span class="p">.</span><span class="nf">wait2</span><span class="p">(</span><span class="n">pid</span><span class="p">)</span>
</code></pre>
<p>The program successfully changes the user namespace with Ruby 3.2, but it raises EINVAL with Ruby 3.3. You can see Ruby 3.3 has two threads running after forking.</p>
<pre><code>% rbenv shell 3.2 && ruby ./test.rb
{:RUBY_DESCRIPTION=>"ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x86_64-linux]"}
PID TID S TTY TIME COMMAND
1585787 1585787 S pts/12 00:00:00 ruby ./test.rb
lrwxrwxrwx 1 kasumi kasumi 0 Feb 5 02:25 /proc/self/ns/user -> 'user:[4026531837]'
lrwxrwxrwx 1 nobody nogroup 0 Feb 5 02:25 /proc/self/ns/user -> 'user:[4026532675]'
[1585787, #<Process::Status: pid 1585787 exit 0>]
% rbenv shell 3.3 && ruby ./test.rb
{:RUBY_DESCRIPTION=>"ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]"}
PID TID S TTY TIME COMMAND
1585849 1585849 S pts/12 00:00:00 ruby ./test.rb
1585849 1585851 S pts/12 00:00:00 ruby ./test.rb
lrwxrwxrwx 1 kasumi kasumi 0 Feb 5 02:25 /proc/self/ns/user -> 'user:[4026531837]'
./test.rb:10:in `raise_system_call_error': Invalid argument (Errno::EINVAL)
from ./test.rb:24:in `block in <main>'
from ./test.rb:19:in `fork'
from ./test.rb:19:in `<main>'
[1585849, #<Process::Status: pid 1585849 exit 1>]
% rbenv shell master && ruby ./test.rb
{:RUBY_DESCRIPTION=>"ruby 3.4.0dev (2024-02-04T16:05:02Z master 8bc6fff322) [x86_64-linux]"}
PID TID S TTY TIME COMMAND
1585965 1585965 S pts/12 00:00:00 ruby ./test.rb
1585965 1585967 S pts/12 00:00:00 ruby ./test.rb
lrwxrwxrwx 1 kasumi kasumi 0 Feb 5 02:25 /proc/self/ns/user -> 'user:[4026531837]'
./test.rb:10:in `raise_system_call_error': Invalid argument (Errno::EINVAL)
from ./test.rb:24:in `block in <main>'
from ./test.rb:19:in `fork'
from ./test.rb:19:in `<main>'
[1585965, #<Process::Status: pid 1585965 exit 1>]
</code></pre>
<a name="Workaround"></a>
<h2 >Workaround<a href="#Workaround" class="wiki-anchor">¶</a></h2>
<p>My workaround is to rebuild ruby with <code>rb_thread_stop_timer_thread</code> and <code>rb_thread_start_timer_thread</code> exported, and use a C-ext that stops the timer thread before calling <code>unshare</code>. This seems not robust because the process cannot know when the terminated thread is reclaimed by the kernel, after which the process is considered single-threaded.</p>
<pre><code class="c syntaxhl" data-language="c"><span class="cp">#define _GNU_SOURCE 1
#include</span> <span class="cpf"><sched.h></span><span class="cp">
#include</span> <span class="cpf"><ruby/ruby.h></span><span class="cp">
</span>
<span class="k">static</span> <span class="n">VALUE</span> <span class="nf">Unshare_s_unshare</span><span class="p">(</span><span class="n">VALUE</span> <span class="n">_self</span><span class="p">,</span> <span class="n">VALUE</span> <span class="n">rflags</span><span class="p">)</span> <span class="p">{</span>
<span class="kt">int</span> <span class="k">const</span> <span class="n">flags</span> <span class="o">=</span> <span class="n">NUM2INT</span><span class="p">(</span><span class="n">rflags</span><span class="p">);</span>
<span class="n">rb_thread_stop_timer_thread</span><span class="p">();</span>
<span class="n">usleep</span><span class="p">(</span><span class="mi">1000</span><span class="p">);</span> <span class="c1">// FIXME: It takes some time for the kernel to remove the stopped thread?</span>
<span class="kt">int</span> <span class="k">const</span> <span class="n">ret</span> <span class="o">=</span> <span class="n">unshare</span><span class="p">(</span><span class="n">flags</span><span class="p">);</span>
<span class="n">rb_thread_start_timer_thread</span><span class="p">();</span>
<span class="k">if</span><span class="p">(</span><span class="n">ret</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="n">rb_sys_fail_str</span><span class="p">(</span><span class="n">rb_sprintf</span><span class="p">(</span><span class="s">"unshare(%#x)"</span><span class="p">,</span> <span class="n">flags</span><span class="p">));</span>
<span class="k">return</span> <span class="n">Qnil</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">RUBY_FUNC_EXPORTED</span> <span class="kt">void</span>
<span class="nf">Init_unshare</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
<span class="n">VALUE</span> <span class="n">rb_mUnshare</span> <span class="o">=</span> <span class="n">rb_define_module</span><span class="p">(</span><span class="s">"Unshare"</span><span class="p">);</span>
<span class="n">rb_define_singleton_method</span><span class="p">(</span><span class="n">rb_mUnshare</span><span class="p">,</span> <span class="s">"unshare"</span><span class="p">,</span> <span class="n">Unshare_s_unshare</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
<span class="n">rb_define_const</span><span class="p">(</span><span class="n">rb_mUnshare</span><span class="p">,</span> <span class="s">"CLONE_NEWUSER"</span><span class="p">,</span> <span class="n">INT2FIX</span><span class="p">(</span><span class="n">CLONE_NEWUSER</span><span class="p">));</span>
<span class="p">}</span>
</code></pre>
<a name="Questions"></a>
<h2 >Questions<a href="#Questions" class="wiki-anchor">¶</a></h2>
<ul>
<li>Is this a limitation of Ruby?</li>
<li>Is it safe (or even possible) to stop the timer thread during execution?
<ul>
<li>If so, can we export it as the public API?</li>
<li>But it may not so useful for this problem as explained in the workaround.</li>
</ul>
</li>
<li>Is it guaranteed that no other threads are running after forks?</li>
<li>Are there any better ways to solve this issue?
<ul>
<li>Can we somehow delay the start of the timer thread after forking, or hook into <code>fork</code> to run some code in the child process immediately after it spawns.</li>
<li>Can they be Ruby API instead of C API?</li>
</ul>
</li>
</ul> Ruby master - Bug #20225 (Open): Inconsistent behavior of regex matching for a regex has a null loophttps://redmine.ruby-lang.org/issues/202252024-01-30T02:53:03Zmake_now_just (Hiroya Fujinami)make.just.on@gmail.com
<p>Usually, in Ruby (Onigmo), when a null loop (a loop consuming no characters) occurs on regex matching, this loop is terminated. But, if a loop has a capture and some complex condition is satisfied, this causes backtracking. This behavior invokes unexpected results, for example,</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">p</span> <span class="sr">/(?:.B.(?<a>(?:[C-Z]|.)*)+){2}/</span> <span class="o">=~</span> <span class="s2">"ABCABC"</span> <span class="c1"># => nil</span>
<span class="nb">p</span> <span class="sr">/(?:.B.(?:(?:[C-Z]|.)*)+){2}/</span> <span class="o">=~</span> <span class="s2">"ABCABC"</span> <span class="c1"># => 0</span>
</code></pre>
<p>Because the above regex has a capture and the below does not, different matching results are returned. It is not very intuitive that the presence of a capture changes the matching result.</p>
<p>The detailed condition for changing the null-loop behavior is 1) a previous capture in this loop holds the empty string, and 2) this capture's position is different from the current matching position. This condition is checked in <code>STACK_NULL_CHECK_MEMST</code> (<a href="https://github.com/ruby/ruby/blob/bbb7ab906ec64b963bd4b5d37e47b14796d64371/regexec.c#L1766-L1778" class="external">https://github.com/ruby/ruby/blob/bbb7ab906ec64b963bd4b5d37e47b14796d64371/regexec.c#L1766-L1778</a>).</p>
<p>Perhaps, you cannot understand what this condition means. Don't worry, I also cannot understand. This condition has been introduced for at least 20 years, and no one may remember the reason for this necessity. (If you know, please tell me!) Even if there is a reason, I believe that there is no reasonable authority for allowing counter-intuitive behavior, such as the above example.</p>
<p>This behavior can also cause memoization to be buggy. Memoization relies on the fact that backtracking only depends on positions and states (byte-code offsets of a regex). However, this condition additionally refers to captures, and the memoization is broken.</p>
<p>My proposal is to <strong>correct this inconsistent behavior</strong>. Specifically, a null loop should be determined solely on the basis of whether the matching position has changed, without referring to captures.</p>
<p>This fix changes the behavior of regex matching, but I believe that the probability that this will actually cause backward compatibility problems is remarkably low. This is because I have never seen any mention of this puzzling behavior before.</p> Ruby master - Bug #20203 (Open): `TestEnumerable` test failures with GCC 14https://redmine.ruby-lang.org/issues/202032024-01-22T17:10:42Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>There is ongoing mass rebuild in Fedora and that is first time GCC 14 is used and we observe test failures in <code>TestEnumerable</code>. Here are a few examples:</p>
<pre><code>[ 3000/26419] TestEnumerable#test_transient_heap_sort_bymalloc_consolidate(): unaligned fastbin chunk detected
</code></pre>
<pre><code>[ 2455/26535] TestEnumerable#test_transient_heap_sort_bycorrupted size vs. prev_size in fastbins
</code></pre>
<pre><code>[ 9716/26532] TestEnumerable#test_any_with_unused_blockdouble free or corruption (fasttop)
</code></pre>
<p>The full logs are accessible <a href="https://koji.fedoraproject.org/koji/taskinfo?taskID=112176941" class="external">here</a>. Please drill through <code>Descendants</code> and <code>build.log</code></p> Ruby master - Bug #20168 (Open): Process won't exit when Ractor.select waiting a Ractorhttps://redmine.ruby-lang.org/issues/201682024-01-09T09:29:43Zshia (Sangyong Sim)
<a name="Reproduction-code"></a>
<h2 >Reproduction code<a href="#Reproduction-code" class="wiki-anchor">¶</a></h2>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">trap</span><span class="p">(</span><span class="ss">:INT</span><span class="p">)</span> <span class="k">do</span>
<span class="nb">puts</span> <span class="s2">"SIGINT"</span>
<span class="nb">exit</span>
<span class="k">end</span>
<span class="nb">trap</span><span class="p">(</span><span class="ss">:TERM</span><span class="p">)</span> <span class="k">do</span>
<span class="nb">puts</span> <span class="s2">"SIGTERM"</span>
<span class="nb">exit</span>
<span class="k">end</span>
<span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="kp">loop</span> <span class="k">do</span>
<span class="nb">sleep</span> <span class="mi">1</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">select</span><span class="p">(</span><span class="n">r</span><span class="p">)</span> <span class="c1"># stucked.</span>
<span class="c1"># SIGINT/SIGTERM sent to Ruby process(confirmed by trap),</span>
<span class="c1"># but process won't exit.</span>
</code></pre>
<a name="Expected-behavior"></a>
<h2 >Expected behavior<a href="#Expected-behavior" class="wiki-anchor">¶</a></h2>
<p>Process killed successfully with exit code 0.</p>
<a name="Affected-Ruby-version"></a>
<h2 >Affected Ruby version<a href="#Affected-Ruby-version" class="wiki-anchor">¶</a></h2>
<p>3.3.0<br>
3.2.x works as expected.</p> Ruby master - Bug #20158 (Assigned): Ractor affects Coverage resultshttps://redmine.ruby-lang.org/issues/201582024-01-07T15:12:34Zjanosch-x (Janosch Müller)
<p>I have a large rspec test suite. I found that if I call a Ractor, the Coverage results are strongly affected, i.e. almost all files appear to be uncovered. This happens even if I only ever call a Ractor before the library or rspec are required.</p>
<p>Unfortunately, I was not able to build a simple repro yet.</p>
<p>I assume it is a timing thing and only affects larger suites, or it only happens if there are multiple files, and maybe if the library lazily requires its sub-modules?</p>
<p>However, I guess this should produce the same results when added to the spec_helper.rb of other large suites:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1"># Ractor.new { nil } # uncomment this to affect coverage results</span>
<span class="nb">require</span> <span class="s1">'coverage'</span>
<span class="no">Coverage</span><span class="p">.</span><span class="nf">start</span>
<span class="c1"># require library, set up rspec etc. </span>
<span class="no">RSpec</span><span class="p">.</span><span class="nf">configuration</span><span class="p">.</span><span class="nf">after</span><span class="p">(</span><span class="ss">:suite</span><span class="p">)</span> <span class="k">do</span>
<span class="c1"># this number is greatly reduced and unstable when calling Ractor above</span>
<span class="nb">p</span> <span class="no">Coverage</span><span class="p">.</span><span class="nf">result</span><span class="p">.</span><span class="nf">values</span><span class="p">.</span><span class="nf">sum</span> <span class="p">{</span> <span class="o">|</span><span class="n">arr</span><span class="o">|</span> <span class="n">arr</span><span class="p">.</span><span class="nf">sum</span><span class="p">(</span><span class="o">&</span><span class="ss">:to_i</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>
</code></pre>
<p>I had this problem in <a href="https://github.com/jaynetics/character_set/" class="external">this library</a>. The problem affects simplecov users as well, as described <a href="https://github.com/simplecov-ruby/simplecov/issues/1058" class="external">here</a>.</p> Ruby master - Bug #20155 (Assigned): Using value of rb_fiber_scheduler_current() crashes Rubyhttps://redmine.ruby-lang.org/issues/201552024-01-05T22:14:24Zpaddor (Patrik Wenger)paddor@gmail.com
<p>While trying to manually block/unblock fibers from an extension using the Fiber Scheduler,<br>
I noticed that using the return value of <code>rb_fiber_scheduler_current()</code> crashes Ruby.</p>
<p>I've created a minimal extension gem called "fiber_blocker". Its test suite shows the behavior. See <a href="https://github.com/paddor/fiber_blocker" class="external">https://github.com/paddor/fiber_blocker</a>, especially the lines containing <code>FIXME</code>.</p>
<p>Passing <code>Fiber.scheduler</code> to the extension functions works. But letting it get the current scheduler itself does not seem to work.</p>
<p>Is <code>rb_fiber_scheduler_current()</code>(within a non-blocking Fiber) not the equivalent to <code>Fiber.scheduler</code>?<br>
Even just printing the its return value with <code>#p</code> will crash Ruby.</p>
<p>Ruby either crashes like this:</p>
<pre><code># Running:
T1 BEGIN
T2 BEGIN
T1 END
..T1 BEGIN
ext: blocking fiber
passed scheduler = #<Scheduler:0x00007fc5f22d39e8 @readable={}, @writable={}, @waiting={}, @closed=false, @lock=#<Thread::Mutex:0x00007fc5f22ec8d0>, @blocking={}, @ready=[], @urgent=[#<IO:fd 5>, #<IO:fd 6>]>
T2 BEGIN
ext: unblocking fiber
T1 END
.E
Finished in 1.007014s, 3.9721 runs/s, 2.9791 assertions/s.
1) Error:
TestFiberBlocker#test_fiber_blocker_current_fiber:
fatal: machine stack overflow in critical region
No backtrace
</code></pre>
<p>Or with a segfault:</p>
<pre><code># Running:
FiberBlocker.test works.
.T1 BEGIN
T2 BEGIN
T1 END
.T1 BEGIN
ext: blocking fiber
/home/user/dev/oss/async_ruby_test/rbnng/fiber_blocker/test/test_fiber_blocker.rb:40: [BUG] Segmentation fault at 0x00000000390d8f98
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0012 e:000011 CFUNC :block_fiber
c:0002 p:0014 s:0006 e:000005 BLOCK /home/user/dev/oss/async_ruby_test/rbnng/fiber_blocker/test/test_fiber_blocker.rb:40 [FINISH]
c:0001 p:---- s:0003 e:000002 DUMMY [FINISH]
-- Ruby level backtrace information ----------------------------------------
/home/user/dev/oss/async_ruby_test/rbnng/fiber_blocker/test/test_fiber_blocker.rb:40:in `block in test_fiber_blocking_in_ext'
/home/user/dev/oss/async_ruby_test/rbnng/fiber_blocker/test/test_fiber_blocker.rb:40:in `block_fiber'
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 4
-- Machine register context ------------------------------------------------
RIP: 0x00007f1554f17ad8 RBP: 0x00000000390d8f90 RSP: 0x00007f153a79e280
RAX: 0x00007f1554addba8 RBX: 0x00007f153a79eab0 RCX: 0x0000000000000000
RDX: 0x00007f1554ade600 RDI: 0x00007f15551e8788 RSI: 0x0000000000000ae1
R8: 0x000000000000002b R9: 0x00007f153a79f038 R10: 0x00007f1554c0b9b0
R11: 0x00007f153a79e490 R12: 0x0000000000000ae1 R13: 0x0000000000000000
R14: 0x0000000000000000 R15: 0x000055ab732d7df0 EFL: 0x0000000000010206
-- C level backtrace information -------------------------------------------
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_print_backtrace+0x14) [0x7f1554f24961] /home/user/src/ruby-3.3.0/vm_dump.c:820
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_vm_bugreport) /home/user/src/ruby-3.3.0/vm_dump.c:1151
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_bug_for_fatal_signal+0x104) [0x7f1554d1c214] /home/user/src/ruby-3.3.0/error.c:1065
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(sigsegv+0x4f) [0x7f1554e700df] /home/user/src/ruby-3.3.0/signal.c:926
/lib/x86_64-linux-gnu/libc.so.6(0x7f1554842520) [0x7f1554842520]
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(RBASIC_CLASS+0x0) [0x7f1554f17ad8] ./include/ruby/internal/globals.h:178
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(gccct_method_search) /home/user/src/ruby-3.3.0/vm_eval.c:475
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_funcallv_scope) /home/user/src/ruby-3.3.0/vm_eval.c:1063
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_funcallv) /home/user/src/ruby-3.3.0/vm_eval.c:1084
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_inspect+0x19) [0x7f1554dc1569] /home/user/src/ruby-3.3.0/object.c:697
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(ruby__sfvextra+0x11a) [0x7f1554e7223a] /home/user/src/ruby-3.3.0/sprintf.c:1119
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(BSD_vfprintf+0xa69) [0x7f1554e73059] /home/user/src/ruby-3.3.0/vsnprintf.c:830
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(RBASIC_SET_CLASS_RAW+0x0) [0x7f1554e75b56] /home/user/src/ruby-3.3.0/sprintf.c:1168
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(ruby_vsprintf0) /home/user/src/ruby-3.3.0/sprintf.c:1169
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_enc_vsprintf+0x5d) [0x7f1554e75ecd] /home/user/src/ruby-3.3.0/sprintf.c:1195
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_sprintf+0x9d) [0x7f1554e7607d] /home/user/src/ruby-3.3.0/sprintf.c:1225
/home/user/dev/oss/async_ruby_test/rbnng/fiber_blocker/lib/fiber_blocker/fiber_blocker.so(block_fiber+0x4a) [0x7f1554ad430a] ../../../../ext/fiber_blocker/fiber_blocker.c:29
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(vm_cfp_consistent_p+0x0) [0x7f1554ef64b4] /home/user/src/ruby-3.3.0/vm_insnhelper.c:3490
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(vm_call_cfunc_with_frame_) /home/user/src/ruby-3.3.0/vm_insnhelper.c:3492
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(vm_call_cfunc_with_frame) /home/user/src/ruby-3.3.0/vm_insnhelper.c:3518
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(vm_call_cfunc_other) /home/user/src/ruby-3.3.0/vm_insnhelper.c:3544
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(vm_sendish+0x9e) [0x7f1554f06f87] /home/user/src/ruby-3.3.0/vm_insnhelper.c:5581
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(vm_exec_core) /home/user/src/ruby-3.3.0/insns.def:834
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_vm_exec+0x19a) [0x7f1554f0d1fa] /home/user/src/ruby-3.3.0/vm.c:2486
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_vm_invoke_proc+0x5f) [0x7f1554f12e0f] /home/user/src/ruby-3.3.0/vm.c:1728
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_fiber_start+0x1ba) [0x7f1554cf098a] /home/user/src/ruby-3.3.0/cont.c:2536
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(fiber_entry+0x20) [0x7f1554cf0d00] /home/user/src/ruby-3.3.0/cont.c:847
/home/user/.rubies/ruby-3.3.0/lib/libruby.so.3.3(rb_threadptr_root_fiber_setup) (null):0
</code></pre>
<p>This happens with the Async scheduler as well as with Ruby’s test scheduler. My minimal extension uses Ruby’s.</p>
<p>I hope I'm not missing something obvious. My C isn't very good.</p> Ruby master - Bug #20146 (Assigned): Code using Ractor with env `RUBY_MAX_CPU=1` ends with unreac...https://redmine.ruby-lang.org/issues/201462024-01-04T02:17:54Zshia (Sangyong Sim)
<a name="Reproducible-code"></a>
<h2 >Reproducible code<a href="#Reproducible-code" class="wiki-anchor">¶</a></h2>
<pre><code class="rb syntaxhl" data-language="rb"><span class="c1"># sample-code.rb</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="mi">1</span> <span class="p">}</span>
</code></pre>
<pre><code class="bash syntaxhl" data-language="bash"><span class="nv">RUBY_MAX_CPU</span><span class="o">=</span>1 ruby sample-code.rb <span class="c"># This will not end with exit code 0</span>
<span class="nv">RUBY_MAX_CPU</span><span class="o">=</span>2 ruby sample-code.rb <span class="c"># This ends with exit code 0 as expected</span>
</code></pre>
<a name="Expected"></a>
<h2 >Expected<a href="#Expected" class="wiki-anchor">¶</a></h2>
<p>process with RUBY_MAX_CPU=1 exits successfully as same as RUBY_MAX_CPU more than 1.</p> Ruby master - Bug #20112 (Assigned): Ractors not working properly in ruby 3.3.0https://redmine.ruby-lang.org/issues/201122024-01-03T15:51:14Zariasdiniz (Aria Diniz)
<p>I recently installed Ruby 3.3.0, and noticed that some of my scripts that use Ractors started to struggle with performance. After doing some benchmarks, I noticed that, while Ractors seem to be working well on Ruby 3.2.2, they're not working properly on 3.3.0.</p>
<p>I'm using Ubuntu 22.04.3 LTS</p>
<p>Here is the benchmark code:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1"># frozen_string_literal: true</span>
<span class="nb">require</span> <span class="s1">'benchmark'</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="ss">:warmup</span> <span class="p">}</span> <span class="k">if</span> <span class="k">defined?</span><span class="p">(</span><span class="no">Ractor</span><span class="p">)</span>
<span class="no">Benchmark</span><span class="p">.</span><span class="nf">bmbm</span> <span class="k">do</span> <span class="o">|</span><span class="n">x</span><span class="o">|</span>
<span class="n">x</span><span class="p">.</span><span class="nf">report</span><span class="p">(</span><span class="s2">"Thread: "</span><span class="p">)</span> <span class="k">do</span>
<span class="n">threads</span> <span class="o">=</span> <span class="p">[]</span>
<span class="mi">8</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">i</span><span class="o">|</span>
<span class="n">threads</span> <span class="o"><<</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="mi">20000000</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">j</span><span class="o">|</span>
<span class="p">((</span><span class="n">i</span> <span class="o">*</span> <span class="mi">20000000</span><span class="p">)</span> <span class="o">+</span> <span class="n">j</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">threads</span><span class="p">.</span><span class="nf">each</span><span class="p">(</span><span class="o">&</span><span class="ss">:join</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">x</span><span class="p">.</span><span class="nf">report</span><span class="p">(</span><span class="s2">"Ractor: "</span><span class="p">)</span> <span class="k">do</span>
<span class="n">ractors</span> <span class="o">=</span> <span class="p">[]</span>
<span class="mi">0</span><span class="o">..</span><span class="mi">8</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">i</span><span class="o">|</span>
<span class="n">ractors</span> <span class="o"><<</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">k</span><span class="o">|</span>
<span class="mi">20000000</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">j</span><span class="o">|</span>
<span class="p">((</span><span class="n">k</span> <span class="o">*</span> <span class="mi">20000000</span><span class="p">)</span> <span class="o">+</span> <span class="n">j</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">ractors</span><span class="p">.</span><span class="nf">map</span><span class="p">(</span><span class="o">&</span><span class="ss">:take</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
</code></pre>
<p>Here is the results for Ruby 3.2.2:</p>
<p>Rehearsal --------------------------------------------<br>
Thread: 7.666909 0.001091 7.668000 ( 7.675266)<br>
Ractor: 19.318528 0.012017 19.330545 ( 2.505888)<br>
---------------------------------- total: 26.998545sec</p>
<pre><code> user system total real
</code></pre>
<p>Thread: 7.918141 0.004011 7.922152 ( 7.928772)<br>
Ractor: 19.366414 0.003954 19.370368 ( 2.517993)</p>
<p>Here is the results for Ruby 3.3.0:</p>
<p>Rehearsal --------------------------------------------<br>
Thread: 8.634152 0.010895 8.645047 ( 8.645104)<br>
Ractor: 100.172179 0.035985 100.208164 ( 15.213245)<br>
--------------------------------- total: 108.853211sec</p>
<pre><code> user system total real
</code></pre>
<p>Thread: 9.451236 0.004002 9.455238 ( 9.460132)<br>
Ractor: 118.463294 0.119942 118.583236 ( 18.462157)</p> Ruby master - Bug #20082 (Open): Killing fibers across threads: unexpected exceptionhttps://redmine.ruby-lang.org/issues/200822023-12-23T21:15:27Zzverok (Victor Shepelev)zverok.offline@gmail.com
<p>For providing the example in a changelog, I tried to imitate killing fibers belonging to other threads.<br>
Documentation <a href="https://docs.ruby-lang.org/en/master/Fiber.html#method-i-kill" class="external">claims</a></p>
<blockquote>
<p>Raises FiberError if called on a fiber belonging to another thread.</p>
</blockquote>
<p>So, I created this artificial example to check how it works:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">fibers</span> <span class="o">=</span> <span class="p">[]</span>
<span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span>
<span class="n">f</span> <span class="o">=</span> <span class="no">Fiber</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="p">(</span><span class="mi">1</span><span class="o">..</span><span class="p">).</span><span class="nf">each</span> <span class="p">{</span> <span class="nb">sleep</span><span class="p">(</span><span class="mf">0.1</span><span class="p">)</span> <span class="p">}</span> <span class="p">}</span>
<span class="n">fibers</span> <span class="o"><<</span> <span class="n">f</span>
<span class="n">f</span><span class="p">.</span><span class="nf">resume</span>
<span class="p">}</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mf">0.1</span><span class="p">)</span> <span class="c1"># to make sure the thread has started</span>
<span class="n">fibers</span><span class="p">.</span><span class="nf">last</span><span class="p">.</span><span class="nf">kill</span>
</code></pre>
<p>The example indeed fails with <code>FiberError</code>, but the error message is confusing:</p>
<pre><code>in `kill': attempt to resume a resumed fiber (double resume) (FiberError)
</code></pre>
<p>Is this an expected message for such case? Or am I misunderstanding something?</p> Ruby master - Bug #20045 (Assigned): `TestDir#test_home` fails on i686https://redmine.ruby-lang.org/issues/200452023-12-07T09:28:07Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>This is followup to <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: `TestFileExhaustive#test_expand_path_for_existent_username` and `TestDir#test_home` fails on i686 (Closed)" href="https://redmine.ruby-lang.org/issues/19147">#19147</a>. Testing on Fedora 38 and Fedora Rawhide, we are facing this test failure:</p>
<pre><code>$ tar xf build/SOURCES/ruby-3.2.2.tar.xz
$ cd ruby-3.2.2/
$ ./configure && make
... snip ...
---
Configuration summary for ruby version 3.2.2
* Installation prefix: /usr/local
* exec prefix: ${prefix}
* arch: i686-linux
* site arch: ${arch}
* RUBY_BASE_NAME: ruby
* ruby lib prefix: ${libdir}/${RUBY_BASE_NAME}
* site libraries path: ${rubylibprefix}/${sitearch}
* vendor path: ${rubylibprefix}/vendor_ruby
* target OS: linux
* compiler: gcc
* with thread: pthread
* with coroutine: x86
* enable shared libs: no
* dynamic library ext: so
* CFLAGS: ${optflags} ${debugflags} ${warnflags}
* LDFLAGS: -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic
* DLDFLAGS: -Wl,--compress-debug-sections=zlib
* optflags: -O3 -fno-fast-math
* debugflags: -ggdb3
* warnflags: -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wold-style-definition \
-Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat \
-Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef
* strip command: strip -S -x
* install doc: rdoc
* MJIT support: yes
* YJIT support: no
* man page type: doc
---
... snip ...
$ LANG=C make test-all 'TESTS=-v -n /TestDir#test_home/'
config.status: creating ruby-runner.h
making mjit_build_dir.so
generating i686-linux-fake.rb
i686-linux-fake.rb updated
Run options:
--seed=10517
"--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=./test/excludes
--name=!/memory_leak/
-v
-n
/TestDir#test_home/
# Running tests:
[1/0] TestDir#test_home = 0.00 s
1) Error:
TestDir#test_home:
RuntimeError: can't set length of shared string
/builddir/ruby-3.2.2/test/ruby/test_dir.rb:557:in `expand_path'
/builddir/ruby-3.2.2/test/ruby/test_dir.rb:557:in `block in test_home'
Finished tests in 4.164691s, 0.2401 tests/s, 1.6808 assertions/s.
1 tests, 7 assertions, 0 failures, 1 errors, 0 skips
ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [i686-linux]
make: *** [uncommon.mk:855: yes-test-all] Error 1
</code></pre>
<p>Please note that having the <code>C</code> locale is essential. The test passes just fine with e.g. <code>C.UTF-8</code> locale.</p>
<p>We were able to reduce the test case to the following:</p>
<pre><code>$ whoami
mockbuild
$ echo 'File.expand_path("~mockbuild")' > test.rb
$ LANG=C RUBYLIB=/builddir/ruby-3.2.2/.ext/i686-linux LD_LIBRARY_PATH=. ./ruby --disable-gems test.rb
test.rb:1:in `expand_path': can't set length of shared string (RuntimeError)
from test.rb:1:in `<main>'
</code></pre>
<p>As I said earlier, the <code>LANG=C</code> is essential as well as the <code>RUBYLIB=/builddir/ruby-3.2.2/.ext/i386-linux</code>. Adding the path to <code>RUBYLIB</code> enables Ruby to load the following libraries:</p>
<pre><code>/builddir/ruby-3.2.2/.ext/i686-linux/enc/encdb.so
/builddir/ruby-3.2.2/.ext/i686-linux/enc/trans/transdb.so
</code></pre>
<p>And that makes the difference. Also, the <code>File.expand_path("~mockbuild")</code> must be in some file, replacing this by <code>-e 'File.expand_path("~mockbuild")'</code> does not reproduce the issue.</p>
<p>We also believe that this was introduced by <a href="https://github.com/ruby/ruby/pull/6699" class="external">https://github.com/ruby/ruby/pull/6699</a>, specifically by <a class="changeset" title="Transition shape when object's capacity changes This commit adds a `capacity` field to shapes, a..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/5246f4027ec574e77809845e1b1f7822cc2a5cef">git|5246f4027ec574e77809845e1b1f7822cc2a5cef</a> and fixed in master by <a class="changeset" title="Enable 5 size pools on 32 bit systems This commit will allow 32 bit systems to take advantage of..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/b4571097df4a6bd848f1195026d82a92f3a7f9d8">git|b4571097df4a6bd848f1195026d82a92f3a7f9d8</a>.</p>
<p>Unfortunately, we were not able to discover what is the mechanism behind this, why this depends on locale, why the test must be in file, why the string is shared etc. But I hope we have provided enough details for someone else more knowledgeable.</p>
<p>Some background for this issue is also available here:</p>
<p><a href="https://src.fedoraproject.org/rpms/ruby/pull-request/164" class="external">https://src.fedoraproject.org/rpms/ruby/pull-request/164</a></p> Ruby master - Bug #20041 (Open): Array destructuring and default values in parametershttps://redmine.ruby-lang.org/issues/200412023-12-05T19:52:32Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<p>It's possible to set the default value of a parameter to a previous parameter. For example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span> <span class="o">=</span> <span class="n">a</span><span class="p">)</span>
<span class="n">b</span>
<span class="k">end</span>
<span class="n">foo</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span> <span class="c1"># => [1, 2]</span>
</code></pre>
<p>However, if the parameters are destructured, the destructring happens <em>after</em> default parameter assignment. For example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">foo</span><span class="p">((</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">b</span> <span class="o">=</span> <span class="n">x</span><span class="p">)</span>
<span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">b</span><span class="p">]</span>
<span class="k">end</span>
<span class="n">foo</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span> <span class="c1"># => [1, 2, nil]</span>
</code></pre>
<p>Is this expected behavior? I would have expected the parameters to be "evaluated" from left to right, and the array destructuring to happen <em>before</em> the default parameter assignment.</p>
<p>Thanks!</p> Ruby master - Bug #19996 (Assigned): `RUBY_MN_THREADS=1` triggers Action Cable unit test failureshttps://redmine.ruby-lang.org/issues/199962023-11-10T04:16:56Zyahonda (Yasuo Honda)yasuo.honda@gmail.com
<a name="Steps-to-reproduce"></a>
<h3 >Steps to reproduce<a href="#Steps-to-reproduce" class="wiki-anchor">¶</a></h3>
<ol>
<li>Install <code>ruby 3.3.0dev</code>
</li>
<li>Set <code>RUBY_MN_THREADS=1</code> environment variable</li>
<li>Follow these steps</li>
</ol>
<pre><code>git clone https://github.com/rails/rails
cd rails
rm Gemfile.lock
bundle install
cd actioncable
bin/test test/channel/base_test.rb test/subscription_adapter/redis_test.rb test/channel/test_case_test.rb test/subscription_adapter/redis_test.rb test/client_test.rb --seed 14800
</code></pre>
<a name="Expected-behavior"></a>
<h3 >Expected behavior<a href="#Expected-behavior" class="wiki-anchor">¶</a></h3>
<p>It should pass as not setting <code>RUBY_MN_THREADS</code>.</p>
<pre><code>$ unset RUBY_MN_THREADS
$ bin/test test/channel/base_test.rb test/subscription_adapter/redis_test.rb test/channel/test_case_test.rb test/subscription_adapter/redis_test.rb test/client_test.rb --seed 14800
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/minitest-5.20.0/lib/minitest.rb:3: warning: mutex_m which will no longer be part of the default gems since Ruby 3.4.0. Add mutex_m to your Gemfile or gemspec.
Run options: --seed 14800
# Running:
.........................................................................
Finished in 12.031310s, 6.0675 runs/s, 46.7115 assertions/s.
73 runs, 562 assertions, 0 failures, 0 errors, 0 skips
$
</code></pre>
<a name="Actual-behavior"></a>
<h3 >Actual behavior<a href="#Actual-behavior" class="wiki-anchor">¶</a></h3>
<p>It usually fails as follows.</p>
<pre><code>$ bin/test test/channel/base_test.rb test/subscription_adapter/redis_test.rb test/channel/test_case_test.rb test/subscription_adapter/redis_test.rb test/client_test.rb --seed 14800
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/minitest-5.20.0/lib/minitest.rb:3: warning: mutex_m which will no longer be part of the default gems since Ruby 3.4.0. Add mutex_m to your Gemfile or gemspec.
Run options: --seed 14800
# Running:
..................................................F
Failure:
RedisAdapterTest::AlternateConfiguration#test_channel_prefix [/home/yahonda/src/github.com/rails/rails/actioncable/test/subscription_adapter/common.rb:35]:
Expected #<Concurrent::Event:0x00007f0b2698d4f0 @__Lock__=#<Thread::Mutex:0x00007f0b26f8cab8>, @__Condition__=#<Thread::ConditionVariable:0x00007f0b26f8ca90>, @set=false, @iteration=0> to be set?.
bin/test test/subscription_adapter/channel_prefix.rb:6
.F
Failure:
RedisAdapterTest::AlternateConfiguration#test_multiple_broadcast [/home/yahonda/src/github.com/rails/rails/actioncable/test/subscription_adapter/common.rb:35]:
Expected #<Concurrent::Event:0x00007f0b2698a4d0 @__Lock__=#<Thread::Mutex:0x00007f0b26fac688>, @__Condition__=#<Thread::ConditionVariable:0x00007f0b26fac4f8>, @set=false, @iteration=0> to be set?.
bin/test test/subscription_adapter/common.rb:74
E
Error:
ClientTest#test_interacting_clients:
ThreadError: queue empty
<internal:thread_sync>:18:in `pop'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:168:in `read_message'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:241:in `block (2 levels) in test_interacting_clients'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:218:in `block (2 levels) in concurrently'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/promises.rb:1583:in `evaluate_to'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/promises.rb:1766:in `block in on_resolvable'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:in `run_task'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:343:in `block (3 levels) in create_worker'
<internal:kernel>:187:in `loop'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `block (2 levels) in create_worker'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `catch'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `block in create_worker'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/promises.rb:1258:in `raise'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/promises.rb:1258:in `wait_until_resolved!'
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/promises.rb:988:in `value!'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:218:in `map'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:218:in `concurrently'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:240:in `block in test_interacting_clients'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:90:in `with_puma_server'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:234:in `test_interacting_clients'
bin/test test/client_test.rb:233
E
Error:
ClientTest#test_disappearing_client:
ThreadError: queue empty
<internal:thread_sync>:18:in `pop'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:168:in `read_message'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:275:in `block in test_disappearing_client'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:90:in `with_puma_server'
/home/yahonda/src/github.com/rails/rails/actioncable/test/client_test.rb:273:in `test_disappearing_client'
bin/test test/client_test.rb:272
..................
Finished in 1323.812615s, 0.0551 runs/s, 0.3830 assertions/s.
73 runs, 507 assertions, 2 failures, 2 errors, 0 skips
$
</code></pre> Ruby master - Bug #19794 (Assigned): Ruby 3.2.2 fails to build on macOS Sonoma betashttps://redmine.ruby-lang.org/issues/197942023-08-02T05:08:15Zjhaungs (Jim Haungs)
<p>With Big Sur, Apple deprecated putting dylibs in /usr/local/lib. In Sonoma (beta 4), this directory has disappeared completely. However, ruby's configure script depends on its existence. So, virtually every ruby installer (RVM, rbenv, asdf, ruby-build, and even building from source tarball) fails.</p>
<p>When building ruby 3.2.2 from source, the configure step outputs the irritatingly useless "something wrong with LDFLAGS" error message and fails to build.</p>
<p>The solution was to <code>cd /usr/local; sudo mkdir lib</code> to create the missing lib directory under /usr/local.</p>
<p>It would be nice to remove this dependency from the configure script.</p> Ruby master - Bug #19765 (Open): Ractor.make_shareable ignores self of a proc created from a Methodhttps://redmine.ruby-lang.org/issues/197652023-07-13T03:05:31ZEthan (Ethan -)notethan@gmail.com
<p>An unshareable receiver of a Proc or a Method will cause make_shareable to error, but this does not happen with a proc from Method#to_proc:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">str</span> <span class="o">=</span> <span class="s2">""</span>
<span class="n">a</span> <span class="o">=</span> <span class="n">str</span><span class="p">.</span><span class="nf">instance_exec</span> <span class="p">{</span> <span class="nb">proc</span> <span class="p">{</span> <span class="nb">to_s</span> <span class="p">}</span> <span class="p">}</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">make_shareable</span> <span class="n">a</span>
<span class="c1"># => <internal:ractor>:820:in `make_shareable': Proc's self is not shareable: #<Proc:0x00000001064b62c8 (irb):1> (Ractor::IsolationError)</span>
<span class="n">b</span> <span class="o">=</span> <span class="n">str</span><span class="p">.</span><span class="nf">instance_exec</span> <span class="p">{</span> <span class="nb">method</span><span class="p">(</span><span class="ss">:to_s</span><span class="p">)</span> <span class="p">}</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">make_shareable</span> <span class="n">b</span>
<span class="c1"># => <internal:ractor>:820:in `make_shareable': can not make shareable object for #<Method: String#to_s()> (Ractor::Error)</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">str</span><span class="p">.</span><span class="nf">instance_exec</span> <span class="p">{</span> <span class="nb">method</span><span class="p">(</span><span class="ss">:to_s</span><span class="p">).</span><span class="nf">to_proc</span> <span class="p">}</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">make_shareable</span> <span class="n">c</span>
<span class="n">c</span><span class="p">.</span><span class="nf">call</span>
<span class="c1"># => ""</span>
<span class="n">str</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"!"</span>
<span class="n">c</span><span class="p">.</span><span class="nf">call</span>
<span class="c1"># => "!"</span>
</code></pre>
<p>Related, maybe:<br>
<a class="issue tracker-1 status-2 priority-4 priority-default" title="Bug: Proc objects are not traversed for shareable check during Ractor.make_shareable(prok) (Assigned)" href="https://redmine.ruby-lang.org/issues/19372">#19372</a><br>
<a class="issue tracker-1 status-2 priority-4 priority-default" title="Bug: Issue with Ractor.make_shareable with curried procs (Assigned)" href="https://redmine.ruby-lang.org/issues/19374">#19374</a></p>
<p>Tangential: why does Proc cause Ractor::IsolationError but Method causes Ractor::Error?</p> Ruby master - Bug #19696 (Open): YJIT panicked - branch stubs should never enlarge brancheshttps://redmine.ruby-lang.org/issues/196962023-05-25T21:19:56Zwildmaples (Maple Ong)
<a name="Description"></a>
<h3 >Description<a href="#Description" class="wiki-anchor">¶</a></h3>
<p>We found this error on Rails CI with YJIT enabled. I'm not quite sure how to reproduce it since the error was intermittent.</p>
<p>I'm posting here to see if it is helpful or if anyone else has encountered this.</p>
<pre><code>thread '<unnamed>' panicked at 'branch stubs should never enlarge branches (start_addr: 0x7fa19e55cb99, old_size: 5, new_size: 14)', ./yjit/src/core.rs:1858:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:587: [BUG] YJIT panicked
ruby 3.2.2 (2023-03-30 revision e51014f9c0) +jemalloc +YJIT [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0131 p:0008 s:0680 e:000679 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract_a
c:0130 p:0004 s:0676 e:000675 BLOCK /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/c
c:0129 p:0079 s:0673 e:000671 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/callbacks.rb:107
c:0128 p:0009 s:0663 e:000662 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/callbacks.rb:929
c:0127 p:0005 s:0658 e:000657 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/c
c:0126 p:0013 s:0653 e:000652 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/c
c:0125 p:0011 s:0648 e:000647 METHOD /var/www/components/rails-backports/lib/rails/backports/7.0/abstract_adapter_thread_local_by_default.rb:97
c:0124 p:0021 s:0642 e:000638 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/c
c:0123 p:0172 s:0635 e:000634 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/c
c:0122 p:0014 s:0625 e:000624 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_handling.rb:313
c:0121 p:0003 s:0621 e:000620 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_handling.rb:280
c:0120 p:0004 s:0617 e:000616 BLOCK /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/fixtures.rb:560
c:0119 p:0087 s:0614 E:000b90 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/fixtures.rb:575
c:0118 p:0015 s:0601 e:000600 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/test_fixtures.rb:275
c:0117 p:0104 s:0596 E:002188 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/test_fixtures.rb:125
c:0116 p:0008 s:0591 e:000590 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/isolator-0.8.0/lib/isolator/railtie.rb:27
c:0115 p:0003 s:0586 e:000585 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/test_fixtures.rb:10
c:0114 p:0009 s:0582 e:000581 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/current_attributes/test_help
c:0113 p:0009 s:0578 e:000577 METHOD /var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/execution_context/test_helpe
c:0112 p:0003 s:0574 e:000573 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-rails-6.0.2/lib/rspec/rails/adapters.rb:74 [FINISH]
c:0111 p:---- s:0570 e:000569 CFUNC :instance_exec
c:0110 p:0013 s:0565 e:000564 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0109 p:0010 s:0559 e:000558 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0108 p:0009 s:0553 e:000552 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0107 p:0018 s:0550 e:000549 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0106 p:0004 s:0544 e:000543 BLOCK /var/www/packs/tax_predictions/spec/support/tax_predictions.rb:11
c:0105 p:0018 s:0541 e:000540 METHOD /var/www/packs/tax_predictions/app/services/tax_predictions/testing.rb:14
c:0104 p:0021 s:0536 e:000535 BLOCK /var/www/packs/tax_predictions/spec/support/tax_predictions.rb:10 [FINISH]
c:0103 p:---- s:0532 e:000531 CFUNC :instance_exec
c:0102 p:0013 s:0527 e:000526 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0101 p:0010 s:0521 e:000520 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0100 p:0009 s:0515 e:000514 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0099 p:0018 s:0512 e:000511 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0098 p:0005 s:0506 e:000505 BLOCK /var/www/spec/support/initializers/system_exit.rb:14 [FINISH]
c:0097 p:---- s:0502 e:000501 CFUNC :instance_exec
c:0096 p:0013 s:0497 e:000496 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0095 p:0010 s:0491 e:000490 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0094 p:0009 s:0485 e:000484 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0093 p:0018 s:0482 e:000481 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0092 p:0041 s:0476 e:000475 BLOCK /var/www/spec/support/initializers/sidekiq_batch_middleware.rb:17 [FINISH]
c:0091 p:---- s:0471 e:000470 CFUNC :instance_exec
c:0090 p:0013 s:0466 e:000465 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0089 p:0010 s:0460 e:000459 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0088 p:0009 s:0454 e:000453 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0087 p:0018 s:0451 e:000450 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0086 p:0004 s:0445 e:000444 BLOCK /var/www/spec/support/initializers/sidekiq.rb:38
c:0085 p:0018 s:0442 e:000441 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.8/lib/sidekiq/testing.rb:16
c:0084 p:0009 s:0436 e:000435 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.8/lib/sidekiq/testing.rb:30
c:0083 p:0010 s:0431 e:000430 BLOCK /var/www/spec/support/initializers/sidekiq.rb:38 [FINISH]
c:0082 p:---- s:0427 e:000426 CFUNC :instance_exec
c:0081 p:0013 s:0422 e:000421 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0080 p:0010 s:0416 e:000415 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0079 p:0009 s:0410 e:000409 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0078 p:0018 s:0407 e:000406 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0077 p:0025 s:0401 e:000400 BLOCK /var/www/spec/support/initializers/rake.rb:18 [FINISH]
c:0076 p:---- s:0397 e:000396 CFUNC :instance_exec
c:0075 p:0013 s:0392 e:000391 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0074 p:0010 s:0386 e:000385 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0073 p:0009 s:0380 e:000379 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0072 p:0018 s:0377 e:000376 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352 [FINISH]
c:0071 p:---- s:0371 e:000370 IFUNC
c:0070 p:0116 s:0368 E:002008 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/prosopite-1.3.1/lib/prosopite.rb:49
c:0069 p:0023 s:0363 e:000362 BLOCK /var/www/spec/support/initializers/prosopite.rb:36 [FINISH]
c:0068 p:---- s:0359 e:000358 CFUNC :instance_exec
c:0067 p:0013 s:0354 e:000353 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0066 p:0010 s:0348 e:000347 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0065 p:0009 s:0342 e:000341 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0064 p:0018 s:0339 e:000338 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0063 p:0023 s:0333 e:000332 BLOCK /var/www/spec/support/initializers/logged_examples.rb:8 [FINISH]
c:0062 p:---- s:0329 e:000328 CFUNC :instance_exec
c:0061 p:0013 s:0324 e:000323 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0060 p:0010 s:0318 e:000317 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0059 p:0009 s:0312 e:000311 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0058 p:0018 s:0309 e:000308 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0057 p:0116 s:0303 e:000302 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-3.11.0/lib/knapsack_pro/adapters/rspec_adapter.rb:72 [FINISH]
c:0056 p:---- s:0298 e:000297 CFUNC :instance_exec
c:0055 p:0013 s:0293 e:000292 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0054 p:0010 s:0287 e:000286 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0053 p:0009 s:0281 e:000280 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0052 p:0018 s:0278 e:000277 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0051 p:0032 s:0272 e:000271 BLOCK /var/www/spec/support/initializers/flake_quarantine.rb:131 [FINISH]
c:0050 p:---- s:0268 e:000267 CFUNC :instance_exec
c:0049 p:0013 s:0263 e:000262 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0048 p:0010 s:0257 e:000256 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0047 p:0009 s:0251 e:000250 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0046 p:0018 s:0248 e:000247 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0045 p:0020 s:0242 e:000241 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/singed-0.2.1/lib/singed/rspec.rb:8 [FINISH]
c:0044 p:---- s:0238 e:000237 CFUNC :instance_exec
c:0043 p:0013 s:0233 e:000232 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0042 p:0010 s:0227 e:000226 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0041 p:0009 s:0221 e:000220 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0040 p:0018 s:0218 e:000217 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352 [FINISH]
c:0039 p:---- s:0212 e:000211 IFUNC
c:0038 p:0007 s:0209 e:000208 METHOD /var/www/spec/support/lib/stream_interceptor.rb:38
c:0037 p:0007 s:0205 e:000204 BLOCK /var/www/spec/support/initializers/stream_interception.rb:10 [FINISH]
c:0036 p:---- s:0201 e:000200 CFUNC :instance_exec
c:0035 p:0013 s:0196 e:000195 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457
c:0034 p:0010 s:0190 e:000189 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390
c:0033 p:0009 s:0184 e:000183 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628
c:0032 p:0018 s:0181 e:000180 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352
c:0031 p:0037 s:0175 E:0002c8 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:629
c:0030 p:0104 s:0168 E:000248 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:486
c:0029 p:0018 s:0161 E:0026e8 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:468
c:0028 p:0019 s:0156 E:002178 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:511
c:0027 p:0076 s:0151 E:000188 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:259
c:0026 p:0036 s:0144 e:000143 METHOD /var/www/components/flake_quarantine/lib/flake_quarantine/rspec/example.rb:11
c:0025 p:0037 s:0139 e:000138 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:646 [FINISH]
c:0024 p:---- s:0133 e:000132 CFUNC :map
c:0023 p:0011 s:0129 e:000128 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:642
c:0022 p:0052 s:0124 e:000123 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:607
c:0021 p:0006 s:0115 e:000114 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608 [FINISH]
c:0020 p:---- s:0111 e:000110 CFUNC :map
c:0019 p:0065 s:0107 e:000106 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608
c:0018 p:0006 s:0098 e:000097 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608 [FINISH]
c:0017 p:---- s:0094 e:000093 CFUNC :map
c:0016 p:0065 s:0090 e:000089 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608
c:0015 p:0007 s:0081 e:000080 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121 [FINISH]
c:0014 p:---- s:0077 e:000076 CFUNC :map
c:0013 p:0030 s:0073 e:000072 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121
c:0012 p:0026 s:0070 e:000069 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/configuration.rb:2070
c:0011 p:0007 s:0066 e:000065 BLOCK /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:116
c:0010 p:0009 s:0062 e:000061 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/reporter.rb:74
c:0009 p:0019 s:0057 e:000056 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:115
c:0008 p:0035 s:0050 e:000049 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:89
c:0007 p:0201 s:0044 e:000043 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-3.11.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:93
c:0006 p:0161 s:0027 e:000026 METHOD /var/www/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-3.11.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:40
c:0005 p:0041 s:0019 E:000928 METHOD bin/rspec_runner:60
c:0004 p:0016 s:0014 e:000013 METHOD bin/rspec_runner:43
c:0003 p:0005 s:0010 e:000009 METHOD bin/rspec_runner:18
c:0002 p:0060 s:0006 e:000005 EVAL bin/rspec_runner:166 [FINISH]
c:0001 p:0000 s:0003 E:000c50 DUMMY [FINISH]
-- Ruby level backtrace information ----------------------------------------
bin/rspec_runner:166:in `<main>'
bin/rspec_runner:18:in `run'
bin/rspec_runner:43:in `run'
bin/rspec_runner:60:in `run_with_knapsack_pro'
/var/www/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-3.11.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:40:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-3.11.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:93:in `run_tests'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:89:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:115:in `run_specs'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/reporter.rb:74:in `report'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:116:in `block in run_specs'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/configuration.rb:2070:in `with_suite_hooks'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121:in `map'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `map'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `block in run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `map'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:608:in `block in run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:607:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:642:in `run_examples'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:642:in `map'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example_group.rb:646:in `block in run_examples'
/var/www/components/flake_quarantine/lib/flake_quarantine/rspec/example.rb:11:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:259:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:511:in `with_around_and_singleton_context_hooks'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:468:in `with_around_example_hooks'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:486:in `run'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:629:in `run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/stream_interception.rb:10:in `block (2 levels) in <top (required)>'
/var/www/spec/support/lib/stream_interceptor.rb:38:in `intercept'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/singed-0.2.1/lib/singed/rspec.rb:8:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/flake_quarantine.rb:131:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/knapsack_pro-3.11.0/lib/knapsack_pro/adapters/rspec_adapter.rb:72:in `block (2 levels) in bind_time_tracker'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/logged_examples.rb:8:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/prosopite.rb:36:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/prosopite-1.3.1/lib/prosopite.rb:49:in `scan'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/rake.rb:18:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/sidekiq.rb:38:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.8/lib/sidekiq/testing.rb:30:in `fake!'
/var/www/vendor/bundle/ruby/3.2.0/gems/sidekiq-6.5.8/lib/sidekiq/testing.rb:16:in `__set_test_mode'
/var/www/spec/support/initializers/sidekiq.rb:38:in `block (3 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/sidekiq_batch_middleware.rb:17:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/spec/support/initializers/system_exit.rb:14:in `block (2 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/packs/tax_predictions/spec/support/tax_predictions.rb:10:in `block (2 levels) in <main>'
/var/www/packs/tax_predictions/app/services/tax_predictions/testing.rb:14:in `recompute_on_fetch!'
/var/www/packs/tax_predictions/spec/support/tax_predictions.rb:11:in `block (3 levels) in <main>'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:352:in `call'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:628:in `block (2 levels) in run_around_example_hooks_for'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/hooks.rb:390:in `execute_with'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib/rspec/core/example.rb:457:in `instance_exec'
/var/www/vendor/bundle/ruby/3.2.0/gems/rspec-rails-6.0.2/lib/rspec/rails/adapters.rb:74:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/execution_context/test_helper.rb:6:in `before_setup'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/current_attributes/test_helper.rb:6:in `before_setup'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/test_fixtures.rb:10:in `before_setup'
/var/www/vendor/bundle/ruby/3.2.0/gems/isolator-0.8.0/lib/isolator/railtie.rb:27:in `setup_fixtures'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/test_fixtures.rb:125:in `setup_fixtures'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/test_fixtures.rb:275:in `load_fixtures'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/fixtures.rb:575:in `create_fixtures'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/fixtures.rb:560:in `block in create_fixtures'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_handling.rb:280:in `connection'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/var/www/components/rails-backports/lib/rails/backports/7.0/abstract_adapter_thread_local_by_default.rb:97:in `checkout'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:704:in `checkout_and_verify'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/callbacks.rb:929:in `_run_checkout_callbacks'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activesupport/lib/active_support/callbacks.rb:107:in `run_callbacks'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:705:in `block in checkout_and_verify'
/var/www/vendor/bundle/ruby/3.2.0/bundler/gems/rails-c15ee6e7b506/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:587:in `verify!'
-- C level backtrace information -------------------------------------------
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(rb_vm_bugreport+0xb2b) [0x7fa19a87c18b]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(rb_bug_without_die+0x77) [0x7fa19a675937]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(rb_bug+0x9f) [0x7fa19a5d0cd2]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN4yjit4yjit17rb_bug_panic_hook28_$u7b$$u7b$closure$u7d$$u7d$17hfc31c2f18ccadc75E.llvm.12746241947442316067+0x5a) [0x7fa19a8b8d7a]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN3std9panicking20rust_panic_with_hook17h66309baf5235212fE+0x3d3) [0x7fa19a8c9d73]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17h3a147548aa082356E+0xb7) [0x7fa19a8ecb17]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN3std10sys_common9backtrace26__rust_end_short_backtrace17hcc62583c733bef84E+0x14) [0x7fa19a8ec824]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(rust_begin_unwind+0x42) [0x7fa19a8c9772]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN4core9panicking9panic_fmt17h8531284c14f462dcE+0x33) [0x7fa19a5d8823]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN4yjit4core20branch_stub_hit_body17h45fd758b20fb7aa6E+0xa03) [0x7fa19a89add3]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN4yjit5cruby12with_vm_lock17h09508b1ca41af130E+0x49) [0x7fa19a8936b9]
/usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/libruby.so.3.2(_ZN4yjit4core15branch_stub_hit17h5cf8bd0b5727e3b9E.llvm.7796580109460741199+0x71) [0x7fa19a89ea31]
[0x7fa19b08501f]
-- Other runtime information -----------------------------------------------
* Loaded script: bin/rspec_runner
* Loaded features:
0 enumerator.so
1 thread.rb
2 fiber.so
3 rational.so
4 complex.so
5 ruby2_keywords.rb
6 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/x86_64-linux/enc/encdb.so
7 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/x86_64-linux/enc/trans/transdb.so
8 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/x86_64-linux/rbconfig.rb
9 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/compatibility.rb
10 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/defaults.rb
11 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/deprecate.rb
12 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/errors.rb
13 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/unknown_command_spell_checker.rb
14 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/exceptions.rb
15 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/basic_specification.rb
16 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/stub_specification.rb
17 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/platform.rb
18 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/util/list.rb
19 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/version.rb
20 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/requirement.rb
21 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/specification.rb
22 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/util.rb
23 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/dependency.rb
24 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/core_ext/kernel_gem.rb
25 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/x86_64-linux/monitor.so
26 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/monitor.rb
27 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems.rb
28 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/rubygems/path_support.rb
29 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/error_highlight/version.rb
30 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/error_highlight/base.rb
31 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/error_highlight/formatter.rb
32 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/error_highlight/core_ext.rb
33 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/error_highlight.rb
34 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/version.rb
35 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/core_ext/name_error.rb
36 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/levenshtein.rb
37 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/jaro_winkler.rb
38 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checker.rb
39 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
40 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
41 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/name_error_checkers.rb
42 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/method_name_checker.rb
43 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/key_error_checker.rb
44 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/null_checker.rb
45 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/tree_spell_checker.rb
46 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/require_path_checker.rb
47 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/spell_checkers/pattern_key_name_checker.rb
48 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean/formatter.rb
49 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/did_you_mean.rb
50 /usr/lib/fullstaq-ruby/versions/3.2.2-jemalloc/lib/ruby/3.2.0/syntax_suggest/core_ext.rb
</code></pre> Ruby master - Bug #19410 (Assigned): If move from ractor fails with error, some objects are left ...https://redmine.ruby-lang.org/issues/194102023-02-03T20:02:50Zluke-gru (Luke Gruber)luke.gru@gmail.com
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">obj</span> <span class="o">=</span> <span class="n">receive</span>
<span class="k">end</span>
<span class="n">a</span> <span class="o">=</span> <span class="no">Object</span><span class="p">.</span><span class="nf">new</span>
<span class="n">obj</span> <span class="o">=</span> <span class="p">[</span><span class="n">a</span><span class="p">,</span> <span class="nb">proc</span> <span class="p">{</span> <span class="p">}]</span>
<span class="k">begin</span>
<span class="n">r</span><span class="p">.</span><span class="nf">send</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="ss">move: </span><span class="kp">true</span><span class="p">)</span>
<span class="k">rescue</span> <span class="o">=></span> <span class="n">e</span>
<span class="nb">puts</span> <span class="s2">"couldn't move"</span>
<span class="k">end</span>
<span class="nb">p</span> <span class="n">a</span> <span class="c1"># a is moved, this errors out. But it's not really moved because the other ractor can't access it. It's in limbo :)</span>
<span class="n">r</span> <span class="o"><<</span> <span class="ss">:end</span>
<span class="n">r</span><span class="p">.</span><span class="nf">take</span>
</code></pre>
<p>This might be tricky to fix, as it requires some sort of commit function for moving objects after every object is checked for ability to move.</p> Ruby master - Bug #19408 (Assigned): Object no longer frozen after moved from a ractorhttps://redmine.ruby-lang.org/issues/194082023-02-03T18:55:10Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>I think frozen objects should still be frozen after a move.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">obj</span> <span class="o">=</span> <span class="n">receive</span>
<span class="nb">p</span> <span class="n">obj</span><span class="p">.</span><span class="nf">frozen?</span> <span class="c1"># should be true but is false</span>
<span class="nb">p</span> <span class="n">obj</span>
<span class="k">end</span>
<span class="n">obj</span> <span class="o">=</span> <span class="p">[</span><span class="no">Object</span><span class="p">.</span><span class="nf">new</span><span class="p">].</span><span class="nf">freeze</span>
<span class="n">r</span><span class="p">.</span><span class="nf">send</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="ss">move: </span><span class="kp">true</span><span class="p">)</span>
<span class="n">r</span><span class="p">.</span><span class="nf">take</span>
</code></pre> Ruby master - Bug #19407 (Assigned): 2 threads taking from current ractor will hang foreverhttps://redmine.ruby-lang.org/issues/194072023-02-03T18:43:11Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>In the current implementation of Ractors, it's possible to <code>take</code> from the current ractor. This could be useful<br>
when co-ordinating threads:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">t</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">obj</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">take</span>
<span class="nb">p</span> <span class="n">obj</span> <span class="c1"># do some work with obj</span>
<span class="k">end</span>
<span class="n">t0</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">obj</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">take</span>
<span class="nb">p</span> <span class="n">obj</span> <span class="c1"># do some work with obj</span>
<span class="k">end</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">yield</span> <span class="ss">:go</span>
</code></pre>
<p>However it hangs forever:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">t</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">obj</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">take</span>
<span class="nb">p</span> <span class="n">obj</span>
<span class="k">end</span>
<span class="n">t0</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">obj</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">take</span>
<span class="nb">p</span> <span class="n">obj</span>
<span class="k">end</span>
<span class="nb">sleep</span> <span class="mf">0.5</span>
</code></pre>
<p>Should "self-take" be disabled, or was it designed to allow it but this is just a bug?</p> Ruby master - Bug #19387 (Open): Issue with ObjectSpace.each_objects not returning objects after ...https://redmine.ruby-lang.org/issues/193872023-01-27T19:27:19Zluke-gru (Luke Gruber)luke.gru@gmail.com
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">receive</span> <span class="c1"># block, the problem is not the termination of the ractor but the starting</span>
<span class="k">end</span>
<span class="no">ObjectSpace</span><span class="p">.</span><span class="nf">each_object</span><span class="p">(</span><span class="no">IO</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">io</span><span class="o">|</span>
<span class="nb">p</span> <span class="n">io</span> <span class="c1"># we get no objects</span>
<span class="p">}</span>
</code></pre> Ruby master - Bug #19383 (Assigned): Time.now.zone encoding for German display language in Window...https://redmine.ruby-lang.org/issues/193832023-01-26T20:52:24Zstringsn88keys (Thomas Powell)
<p>OS:<br>
Verified on Windows 10 and Windows Server 2022 and Ruby 2.7.7 through 3.1.3</p>
<p>Display language:<br>
Verified on German, but may impact other languages in which Time.now.zone returns characters that aren't [A-Za-z].</p>
<p>Time zone:<br>
CET (UTC +01:00) Amsterdam, Berlin, ...</p>
<p>Time.now.zone # => "Mitteleuro\xE3ische Zeit"<br>
Time.now.zone.encoding # => #<a href="Encoding:IBM437" class="external">Encoding:IBM437</a><br>
puts Time.now.zone # => "Mitteleurop∑ische Zeit" (should be "Mitteleuropäische Zeit")<br>
Time.now.zone.encode(Encoding::UTF_8) # => "Mitteleurop∑ische Zeit"</p>
<p>Doing a force_encoding on all encodings in Encoding.list reveals that ISO-8859-(1..16) and Windows-125(0,2,4,7) work to coerce the ä out of the time zone string:<br>
Time.now.zone.force_encoding(Encoding::WINDOWS_1252) # => "Mitteleuro\xE3ische Zeit"<br>
... but ...<br>
Time.now.zone.force_encoding(Encoding::WINDOWS_1252).encode(Encoding::UTF_8) #=> "Mitteleuropäische Zeit"</p>
<p>Related issue: This improper encoding/rendering caused Ohai's JSON output to be unparseable. Workaround was forcing to Windows-1252.<br>
<a href="https://github.com/chef/ohai/pull/1781" class="external">https://github.com/chef/ohai/pull/1781</a></p> Ruby master - Bug #19378 (Assigned): Windows: Use less syscalls for faster require of big gemshttps://redmine.ruby-lang.org/issues/193782023-01-26T07:02:23Zaidog (Andi Idogawa)andi@idogawa.com
<p>Hello 🙂</p>
<a name="Problem"></a>
<h2 >Problem<a href="#Problem" class="wiki-anchor">¶</a></h2>
<p>require is slow on windows for big gems. (example: require 'gtk3'=> 3 seconds+). This is a problem for people who want to make cross platform GUI apps with ruby.</p>
<a name="Possible-Reason"></a>
<h2 >Possible Reason<a href="#Possible-Reason" class="wiki-anchor">¶</a></h2>
<p>As touched on in <a href="https://bugs.ruby-lang.org/issues/15797" class="external">#15797</a> it seems like require uses realpath, which is emulated on windows. It checks every parent directory. The same syscalls run many times.</p>
<a name="Testfile"></a>
<h2 >Testfile<a href="#Testfile" class="wiki-anchor">¶</a></h2>
<p>C:\tmp\speedtest\testrequire.rb:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="n">__dir__</span> <span class="o">+</span> <span class="s2">"/helloworld1.rb"</span>
<span class="nb">require</span> <span class="n">__dir__</span> <span class="o">+</span> <span class="s2">"/helloworld2.rb"</span>
</code></pre>
<pre><code class="shell syntaxhl" data-language="shell">ruby <span class="nt">--disable-gems</span> C:<span class="se">\t</span>mp<span class="se">\s</span>peedtest<span class="se">\t</span>estrequire.rb
</code></pre>
<a name="Syscalls-per-FileDirectory"></a>
<h3 >Syscalls per File/Directory:<a href="#Syscalls-per-FileDirectory" class="wiki-anchor">¶</a></h3>
<ol>
<li>CreateFile</li>
<li>QueryInformationVolume</li>
<li>QueryIdInformation</li>
<li>QueryAllInformationFile</li>
<li>QueryNameInformationFile</li>
<li>QueryNameInformationFile</li>
<li>QueryNormalizedNameInformationFile</li>
<li>CloseFile</li>
</ol>
<a name="FilesDirectories-checked"></a>
<h3 >Files/Directories checked<a href="#FilesDirectories-checked" class="wiki-anchor">¶</a></h3>
<ol>
<li>C:\tmp</li>
<li>C:\tmp\speedtest</li>
<li>C:\tmp\speedtest\helloworld1.rb</li>
<li>C:\tmp</li>
<li>C:\tmp\speedtest</li>
<li>C:\tmp\speedtest\helloworld2.rb</li>
</ol>
<p>For two required files Ruby had to do 8*6 = <strong>48</strong> syscalls.<br>
The syscalls orginate from rb_w32_reparse_symlink_p / lstat</p>
<p>Rubygems live in subfolders with 9+ parts: "C:\Ruby32-x64\lib\ruby\gems\3.2.0\gems\glib2-4.0.8\lib\glib2\variant.rb"<br>
Each file takes 8 * 9 = <strong>72</strong>+ calls. For variant.rb it is <strong>80</strong> calls.<br>
The result for the syscalls don't change in such a short time, so it should be possible to cache it.</p>
<p>With require_relative it's twice as many calls.</p>
<a name="Other-testcases"></a>
<h2 >Other testcases<a href="#Other-testcases" class="wiki-anchor">¶</a></h2>
<p>Same result:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">File</span><span class="p">.</span><span class="nf">realpath</span> <span class="n">__dir__</span> <span class="o">+</span> <span class="s2">"/helloworld1.rb"</span>
<span class="no">File</span><span class="p">.</span><span class="nf">realpath</span> <span class="n">__dir__</span> <span class="o">+</span> <span class="s2">"/helloworld2.rb"</span>
</code></pre>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">File</span><span class="p">.</span><span class="nf">stat</span> <span class="n">__dir__</span> <span class="o">+</span> <span class="s2">"/helloworld1.rb"</span>
<span class="no">File</span><span class="p">.</span><span class="nf">stat</span> <span class="n">__dir__</span> <span class="o">+</span> <span class="s2">"/helloworld2.rb"</span>
</code></pre>
<p>It does not happen in $LOAD_PATH.resolve_feature_path(<strong>dir</strong> + "/helloworld1.rb")</p>
<a name="Request"></a>
<h2 >Request<a href="#Request" class="wiki-anchor">¶</a></h2>
<p>Would it be possible to cache the stat calls when using require?<br>
I tried to implement a cache inside the ruby source code, but failed.<br>
If not, is there now a way to combine ruby files into one?</p>
<p>I previously talked about require here: <a href="https://bugs.ruby-lang.org/issues/19325#note-11" class="external">YJIT: Windows support lacking.</a></p>
<a name="How-to-reproduce"></a>
<h2 >How to reproduce<a href="#How-to-reproduce" class="wiki-anchor">¶</a></h2>
<p>Ruby versions: At least 3.0+, most likely older ones too.<br>
Tested using Ruby Installer 3.1 and 3.2.<br>
<a href="https://learn.microsoft.com/en-us/sysinternals/downloads/procmon" class="external">Procmon Software by Sysinternals</a></p> Ruby master - Bug #19374 (Assigned): Issue with Ractor.make_shareable with curried procshttps://redmine.ruby-lang.org/issues/193742023-01-24T12:40:33Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>This works, but shouldn't:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">Worker</span>
<span class="k">def</span> <span class="nf">start</span><span class="p">(</span><span class="o">&</span><span class="n">blk</span><span class="p">)</span>
<span class="n">blk</span> <span class="o">=</span> <span class="n">blk</span><span class="p">.</span><span class="nf">curry</span> <span class="c1"># bug in ruby allows sharing of non-shareable proc</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">make_shareable</span><span class="p">(</span><span class="n">blk</span><span class="p">)</span>
<span class="vi">@ractor</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">blk</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">b</span><span class="o">|</span>
<span class="n">main</span> <span class="o">=</span> <span class="n">b</span><span class="p">.</span><span class="nf">call</span>
<span class="nb">p</span> <span class="s2">"from ractor: </span><span class="si">#{</span><span class="n">main</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">work</span>
<span class="vi">@ractor</span><span class="p">.</span><span class="nf">take</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">worker</span> <span class="o">=</span> <span class="no">Worker</span><span class="p">.</span><span class="nf">new</span>
<span class="n">a</span> <span class="o">=</span> <span class="nb">self</span> <span class="c1"># unshareable main object</span>
<span class="nb">p</span> <span class="s2">"from main: </span><span class="si">#{</span><span class="n">a</span><span class="si">}</span><span class="s2">"</span>
<span class="n">worker</span><span class="p">.</span><span class="nf">start</span> <span class="p">{</span> <span class="n">a</span> <span class="p">}</span>
<span class="n">worker</span><span class="p">.</span><span class="nf">work</span>
</code></pre>
<p>The curried proc has a reference to the original proc and it's not checked for shareability.</p> Ruby master - Bug #19372 (Assigned): Proc objects are not traversed for shareable check during Ra...https://redmine.ruby-lang.org/issues/193722023-01-23T19:23:33Zluke-gru (Luke Gruber)luke.gru@gmail.com
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">Proc</span>
<span class="nb">attr_accessor</span> <span class="ss">:obj1</span>
<span class="k">def</span> <span class="nf">initialize</span>
<span class="vi">@obj1</span> <span class="o">=</span> <span class="no">Object</span><span class="p">.</span><span class="nf">new</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="nb">p</span> <span class="o">=</span> <span class="kp">true</span><span class="p">.</span><span class="nf">instance_eval</span> <span class="p">{</span> <span class="no">Proc</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="nb">puts</span> <span class="s2">"hi"</span> <span class="p">}</span> <span class="p">}</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">make_shareable</span><span class="p">(</span><span class="nb">p</span><span class="p">)</span>
<span class="nb">p</span> <span class="s2">"Obj1 frozen?"</span><span class="p">,</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">shareable?</span><span class="p">(</span><span class="nb">p</span><span class="p">.</span><span class="nf">obj1</span><span class="p">)</span>
<span class="no">P</span> <span class="o">=</span> <span class="nb">p</span>
<span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">pp</span> <span class="o">=</span> <span class="no">P</span>
<span class="nb">p</span> <span class="n">pp</span><span class="p">.</span><span class="nf">obj1</span> <span class="c1"># gives error in debug builds (rb_ractor_confirm_belonging rb_bug() call)</span>
<span class="k">end</span>
</code></pre> Ruby master - Bug #19369 (Assigned): Small corner-case issue that breaks Ractor isolation: change...https://redmine.ruby-lang.org/issues/193692023-01-23T01:28:22Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>I was looking into how objects are traversed for deep cloning and I came up with a way to break it. I don't think it'll ever happen in real life so it's not really an issue, just<br>
an interesting case. Run with warnings disabled.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">obj</span> <span class="o">=</span> <span class="no">Object</span><span class="p">.</span><span class="nf">new</span>
<span class="nb">p</span> <span class="s2">"unshareable obj:"</span><span class="p">,</span> <span class="n">obj</span>
<span class="no">UNSHAREABLE</span> <span class="o">=</span> <span class="n">obj</span>
<span class="no">GO</span> <span class="o">=</span> <span class="kp">false</span>
<span class="no">SET</span> <span class="o">=</span> <span class="kp">false</span>
<span class="k">class</span> <span class="nc">Object</span>
<span class="nb">attr_accessor</span> <span class="ss">:unshareable</span>
<span class="k">def</span> <span class="nf">initialize_clone</span><span class="p">(</span><span class="n">orig</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Clone called for </span><span class="si">#{</span><span class="n">orig</span><span class="p">.</span><span class="nf">inspect</span><span class="si">}</span><span class="s2">, self = </span><span class="si">#{</span><span class="nb">self</span><span class="p">.</span><span class="nf">inspect</span><span class="si">}</span><span class="s2">"</span>
<span class="n">_self</span> <span class="o">=</span> <span class="nb">self</span>
<span class="k">if</span> <span class="n">orig</span> <span class="o">==</span> <span class="no">UNSHAREABLE</span>
<span class="n">t</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="nb">puts</span> <span class="s2">"In thread"</span>
<span class="no">Thread</span><span class="p">.</span><span class="nf">pass</span> <span class="k">until</span> <span class="no">GO</span>
<span class="nb">puts</span> <span class="s2">"Setting unshareable!"</span>
<span class="c1"># this must be done in separate thread to bypass object traversal deep-cloning</span>
<span class="n">_self</span><span class="p">.</span><span class="nf">unshareable</span> <span class="o">=</span> <span class="no">UNSHAREABLE</span>
<span class="no">Object</span><span class="p">.</span><span class="nf">const_set</span><span class="p">(</span><span class="ss">:SET</span><span class="p">,</span> <span class="kp">true</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">super</span><span class="p">(</span><span class="n">orig</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">o</span><span class="o">|</span>
<span class="nb">puts</span> <span class="s2">"from r</span><span class="si">#{</span><span class="no">Ractor</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">object_id</span><span class="si">}</span><span class="s2"> obj </span><span class="si">#{</span><span class="n">o</span><span class="p">.</span><span class="nf">inspect</span><span class="si">}</span><span class="s2">"</span>
<span class="no">GO</span> <span class="o">=</span> <span class="kp">true</span>
<span class="kp">loop</span> <span class="k">until</span> <span class="no">SET</span>
<span class="nb">p</span> <span class="s2">"from ractor, got unshareable:"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="nf">unshareable</span>
<span class="k">end</span>
<span class="n">r</span><span class="p">.</span><span class="nf">take</span>
</code></pre> Ruby master - Bug #19368 (Assigned): Small issue with isolated procs and evalhttps://redmine.ruby-lang.org/issues/193682023-01-22T17:40:38Zluke-gru (Luke Gruber)luke.gru@gmail.com
<pre><code>a = Object.new # non-shareable
prok = Ractor.current.instance_eval do
Proc.new do
eval('a')
end
end
prok.call # this should work, we're in the main ractor and the proc is not isolated
Ractor.make_shareable(prok) # this doesn't currently work, but I think it should. It gives Ractor::IsolationError. See below for reasoning on why I think it should work.
# A flag seems to be set on the proc after it's run and accesses outers...
</code></pre>
<p>Because this work fine:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">a</span> <span class="o">=</span> <span class="no">Object</span><span class="p">.</span><span class="nf">new</span> <span class="c1"># non-shareable</span>
<span class="n">prok</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">current</span><span class="p">.</span><span class="nf">instance_eval</span> <span class="k">do</span>
<span class="no">Proc</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="nb">eval</span><span class="p">(</span><span class="s1">'a'</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">make_shareable</span><span class="p">(</span><span class="n">prok</span><span class="p">)</span> <span class="c1"># this works, and it's okay because we get a different error when actually running the shareable proc inside a ractor that accesses outers through eval.</span>
</code></pre> Ruby master - Bug #19367 (Assigned): Issue with ractor local storage APIhttps://redmine.ruby-lang.org/issues/193672023-01-22T14:46:45Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>In a non-main ractor, you can do Ractor.main[:key] = 'val', but it only affects storage for Ractor.current, not Ractor.main (which is good!).<br>
I think it should throw a RuntimeError if trying to get/set ractor-local storage for non-current ractor.</p>
<p>Patch coming.</p> Ruby master - Bug #19364 (Assigned): Issue with tracepoint enable/disable across ractorshttps://redmine.ruby-lang.org/issues/193642023-01-21T22:54:58Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>This sometimes segfaults:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">test_enable_disable_in_multiple_ractors_with_target</span>
<span class="n">rs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="mi">100</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">i</span><span class="o">|</span>
<span class="c1"># setup new iseqs</span>
<span class="no">Kernel</span><span class="p">.</span><span class="nf">define_method</span> <span class="ss">:"my_method_to_change_for_tracing_</span><span class="si">#{</span><span class="n">i</span><span class="si">}</span><span class="ss">"</span> <span class="k">do</span>
<span class="kp">true</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="mi">100</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span> <span class="o">|</span><span class="n">i</span><span class="o">|</span>
<span class="n">rs</span> <span class="o"><<</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">j</span><span class="o">|</span>
<span class="n">meth</span> <span class="o">=</span> <span class="ss">:"my_method_to_change_for_tracing_</span><span class="si">#{</span><span class="n">j</span><span class="si">}</span><span class="ss">"</span>
<span class="n">tp</span> <span class="o">=</span> <span class="no">TracePoint</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="ss">:line</span><span class="p">)</span> <span class="p">{</span> <span class="p">}</span> <span class="c1"># local to ractor</span>
<span class="mi">100</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span>
<span class="n">tp</span><span class="p">.</span><span class="nf">enable</span><span class="p">(</span><span class="ss">target: </span><span class="nb">method</span><span class="p">(</span><span class="n">meth</span><span class="p">))</span> <span class="c1"># change iseq internals of given method, should be done with lock</span>
<span class="n">tp</span><span class="p">.</span><span class="nf">disable</span> <span class="c1"># disable hooks should hold lock too, changes method definition internals</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">rs</span><span class="p">.</span><span class="nf">each</span><span class="p">(</span><span class="o">&</span><span class="ss">:take</span><span class="p">)</span> <span class="c1"># shouldn't raise</span>
<span class="k">end</span>
<span class="n">test_enable_disable_in_multiple_ractors_with_target</span><span class="p">()</span>
</code></pre>
<p>Changing iseq internals is done without the VM lock. This is true in Tracepoint#enable and Tracepoint#disable methods.<br>
I have a patch coming.</p> Ruby master - Bug #19363 (Open): Fix rb_transient_heap_mark: wrong header (T_STRUCT) segfaulthttps://redmine.ruby-lang.org/issues/193632023-01-21T18:53:10Zbkuhlmann (Brooke Kuhlmann)brooke@alchemists.io
<a name="Overview"></a>
<h2 >Overview<a href="#Overview" class="wiki-anchor">¶</a></h2>
<p>Hello. 👋 I'm hitting an issue where my build is constantly failing with a segfault. The following is a snippet taken from my local machine with YJIT enabled (see attachments for details):</p>
<pre><code>/Users/bkuhlmann/.cache/frum/versions/3.2.0/lib/ruby/gems/3.2.0/gems/puma-6.0.2/lib/puma/runner.rb: [BUG] rb_transient_heap_mark: wrong header, T_STRUCT (0x0000000109ea98a0)
ruby 3.2.0 (2022-12-25 revision a528908271) +YJIT [arm64-darwin22.2.0]
</code></pre>
<p>The closest issue I could find that might be related to this issue (but not sure) is this issue: <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Segfault in rb_transient_heap_mark when running Sequel's specs (Closed)" href="https://redmine.ruby-lang.org/issues/15358">#15358</a>.</p>
<a name="Steps-to-Recreate"></a>
<h2 >Steps to Recreate<a href="#Steps-to-Recreate" class="wiki-anchor">¶</a></h2>
<p>You should be able to quickly recreate this issue via these steps:</p>
<ul>
<li>Download/clone my <a href="https://github.com/bkuhlmann/hemo" class="external">Hemo</a> project.</li>
<li>Run the setup steps.</li>
<li>Run the test suite by running <code>bin/rspec</code>.</li>
</ul>
<p>If you need an example of the same segfault (but not on my macOS machine), you can see the same segfault via my <a href="https://app.circleci.com/pipelines/github/bkuhlmann/hemo/11/workflows/f19abf41-60bc-4e8e-9ba9-b964a67ece73/jobs/10" class="external">Circle CI Build</a>. My Circle CI build is using my <a href="https://www.alchemists.io/projects/docker-alpine-ruby" class="external">Docker Alpine Linux Ruby</a> image which might be of interest as well. This Docker image is also built with YJIT enabled.</p>
<p>Interestingly, is if you were to run the test suite with <code>bin/guard</code> instead of <code>bin/rspec</code> then the segfault doesn't occur.</p>
<a name="Environment"></a>
<h2 >Environment<a href="#Environment" class="wiki-anchor">¶</a></h2>
<pre><code>ruby 3.2.0 (2022-12-25 revision a528908271) +YJIT [arm64-darwin22.2.0]
1.43.0 (using Parser 3.2.0.0, rubocop-ast 1.24.1, running on ruby 3.2.0) [arm64-darwin22.2.0]
- rubocop-performance 1.15.2
- rubocop-rake 0.6.0
- rubocop-rspec 2.18.1
- rubocop-sequel 0.3.4
- rubocop-thread_safety 0.4.4
</code></pre> Ruby master - Bug #19338 (Assigned): Ruby hangs when ouputting warnings inside ractor with VM loc...https://redmine.ruby-lang.org/issues/193382023-01-14T18:15:37Zluke-gru (Luke Gruber)luke.gru@gmail.com
<p>This code causes Ruby to hang:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">rs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="mi">2</span><span class="p">.</span><span class="nf">times</span> <span class="k">do</span>
<span class="n">rs</span> <span class="o"><<</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="no">MYCONSTANT</span> <span class="o">=</span> <span class="mi">2</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">rs</span><span class="p">.</span><span class="nf">each</span><span class="p">(</span><span class="o">&</span><span class="ss">:take</span><span class="p">)</span>
</code></pre>
<p>There is a problem when the warning is being outputted with multiple ractors. A thread is calling RB_VM_LOCK() while holding the VM lock in ractor.c (ractor_check_blocking())</p>
<p>If the code is changed to RB_VM_LOCK_ENTER() and RB_VM_LOCK_LEAVE() then it fixes it, but I don't know if there's a better way.</p>
<p>Thanks!</p> Ruby master - Bug #19154 (Open): Specify require and autoload guarantees in ractorshttps://redmine.ruby-lang.org/issues/191542022-11-26T23:52:22Zfxn (Xavier Noria)fxn@hashref.com
<p>Given a file <code>c.rb</code>:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">C</span>
<span class="k">end</span>
</code></pre>
<p>the following script:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r1</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="nb">require</span> <span class="s1">'./c.rb'</span>
<span class="k">end</span>
<span class="n">r2</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="nb">require</span> <span class="s1">'./c.rb'</span>
<span class="k">end</span>
<span class="n">r1</span><span class="p">.</span><span class="nf">take</span>
<span class="n">r2</span><span class="p">.</span><span class="nf">take</span>
</code></pre>
<p>raises:</p>
<pre><code>% ruby -v foo.rb
ruby 3.2.0preview3 (2022-11-27) [x86_64-darwin22]
foo.rb:1: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
#<Thread:0x000000010fee2928 run> terminated with exception (report_on_exception is true):
#<Thread:0x00000001102acfe0 run> terminated with exception (report_on_exception is true):
<internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:167:in `require'
from foo.rb:6:in `block in <main>'
<internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:37:in `require'<internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': : can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:167:in `require'
can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in <main>'
<internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from foo.rb:2:in `block in <main>'
from foo.rb:6:in `block in <main>'
<internal:ractor>:698:in `take': thrown by remote Ractor. (Ractor::RemoteError)
from foo.rb:9:in `<main>'
<internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from <internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:167:in `require'
from foo.rb:2:in `block in <main>'
<internal:/Users/fxn/.rbenv/versions/3.2.0-preview3/lib/ruby/3.2.0+3/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError)
from foo.rb:2:in `block in <main>'
</code></pre>
<p>Would it be possible to have documentation about their interaction?</p>
<p>This is important also to understand autoloading within ractors, since constant references may trigger <code>require</code> calls.</p> Ruby master - Bug #18940 (Assigned): Ruby Ractor fails with IOError when handling higher concurrencyhttps://redmine.ruby-lang.org/issues/189402022-07-26T18:33:12Zbrodock (Gabriel Mazetto)brodock@gmail.com
<p>Reproduction server:</p>
<pre><code>require 'socket'
# Set based on CPU count
CONCURRENCY = 8
server = TCPServer.new(8080)
workers = CONCURRENCY.times.map do
Ractor.new do
loop do
# receive TCPSocket
session = Ractor.recv
request = session.gets
puts request
session.print "HTTP/1.1 200\r\n"
session.print "Content-Type: text/html\r\n"
session.print "\r\n"
session.print "Hello world! Current time is #{Time.now}"
session.close
end
end
end
loop do
conn, _ = server.accept
# pass TCPSocket to one of the workers
workers.sample.send(conn, move: true)
end
</code></pre>
<p>run apache benchmark against code above:</p>
<pre><code>ab -n 20000 -c 20 http://localhost:8080/
</code></pre>
<p>or run using hey (<a href="https://github.com/rakyll/hey" class="external">https://github.com/rakyll/hey</a>):</p>
<pre><code>hey -n 20000 -c 20 http://localhost:8080/
</code></pre>
<p>you should see something like this on the benchmark tool side:</p>
<pre><code>Summary:
Total: 32.9538 secs
Slowest: 2.6317 secs
Fastest: 0.0002 secs
Average: 0.0331 secs
Requests/sec: 606.9098
Response time histogram:
0.000 [1] |
0.263 [16968] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
0.527 [1740] |■■■■
0.790 [0] |
1.053 [0] |
1.316 [0] |
1.579 [0] |
1.842 [0] |
2.105 [20] |
2.369 [0] |
2.632 [6] |
Latency distribution:
10% in 0.0008 secs
25% in 0.0010 secs
50% in 0.0012 secs
75% in 0.0016 secs
90% in 0.0075 secs
95% in 0.3101 secs
99% in 0.3175 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0322 secs, 0.0002 secs, 2.6317 secs
DNS-lookup: 0.0006 secs, 0.0000 secs, 0.0127 secs
req write: 0.0001 secs, 0.0000 secs, 0.0095 secs
resp wait: 0.0007 secs, 0.0000 secs, 0.0140 secs
resp read: 0.0001 secs, 0.0000 secs, 0.0088 secs
Status code distribution:
[200] 18735 responses
Error distribution:
[1231] Get "http://localhost:8080/": dial tcp [::1]:8080: connect: connection refused
[16] Get "http://localhost:8080/": dial tcp [::1]:8080: connect: connection reset by peer
[1] Get "http://localhost:8080/": net/http: HTTP/1.x transport connection broken: unexpected EOF
[1] Get "http://localhost:8080/": read tcp 127.0.0.1:57078->127.0.0.1:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57054->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57058->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57059->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57062->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57067->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57068->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57069->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57070->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57071->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57072->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57075->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57076->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57087->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57088->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57089->[::1]:8080: read: connection reset by peer
[1] Get "http://localhost:8080/": read tcp [::1]:57090->[::1]:8080: read: connection reset by peer
</code></pre>
<p>and this on the ruby process:</p>
<pre><code>...
GET / HTTP/1.1
GET / HTTP/1.1
#<Thread:0x0000000100fbf6e8 run> terminated with exception (report_on_exception is true):
ractor.rb:21:in `write': GET / HTTP/1.1
uninitialized stream (IOError)
from ractor.rb:21:in `print'
from ractor.rb:21:in `block (3 levels) in <main>'
from ractor.rb:11:in `loop'
from ractor.rb:11:in `block (2 levels) in <main>'
GET / HTTP/1.1
GET / HTTP/1.1
</code></pre> Ruby master - Bug #18818 (Open): Thread waitq does not retain referenced objects, can lead to use...https://redmine.ruby-lang.org/issues/188182022-06-05T21:39:16Znevans (Nicholas Evans)
<p>The attached script (and/or others like it) can cause SEGV in 3.0, 3.1, and master. It has always behaved as expected when I use <code>optflags=-O0</code>.</p>
<p>When I use it with <code>make run</code> on <code>master</code>:</p>
<pre><code>./miniruby -I../lib -I. -I.ext/common -r./x86_64-linux-fake ../test.rb
========================================================================
fiber_queue
completed in 0.00031349004711955786
========================================================================
fiber_sized_queue
../test.rb:62: [BUG] Segmentation fault at 0x0000000000000000
ruby 3.2.0dev (2022-06-05T06:18:26Z master 5ce0be022f) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0005 p:---- s:0023 e:000022 CFUNC :%
c:0004 p:0031 s:0018 e:000015 METHOD ../test.rb:62 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC :pop
c:0002 p:0009 s:0006 e:000005 BLOCK ../test.rb:154 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
../test.rb:154:in `block (2 levels) in <main>'
../test.rb:154:in `pop'
../test.rb:62:in `unblock'
../test.rb:62:in `%'
-- Machine register context ------------------------------------------------
RIP: 0x000055eae9ffa417 RBP: 0x00007f80aba855d8 RSP: 0x00007f80a9789598
RAX: 0x000000000000009b RBX: 0x00007f80a9789628 RCX: 0x00007f80ab9c37a0
RDX: 0x00007f80a97895c0 RDI: 0x0000000000000000 RSI: 0x000000000000009b
R8: 0x0000000000000000 R9: 0x00007f80a97895c0 R10: 0x0000000055550083
R11: 0x00007f80ac32ace0 R12: 0x00007f80aba855d8 R13: 0x00007f80ab9c3780
R14: 0x00007f80a97895c0 R15: 0x000000000000009b EFL: 0x0000000000010202
-- C level backtrace information -------------------------------------------
./miniruby(rb_vm_bugreport+0x5cf) [0x55eaea06b0ef]
./miniruby(rb_bug_for_fatal_signal+0xec) [0x55eae9e4fc2c]
./miniruby(sigsegv+0x4d) [0x55eae9fba30d]
[0x7f80ac153520]
./miniruby(rb_id_table_lookup+0x7) [0x55eae9ffa417]
./miniruby(callable_method_entry+0x103) [0x55eaea046bd3]
./miniruby(vm_respond_to+0x3f) [0x55eaea056c1f]
./miniruby(rb_check_funcall_default_kw+0x19c) [0x55eaea05788c]
./miniruby(rb_check_convert_type_with_id+0x8e) [0x55eae9f1b85e]
./miniruby(rb_str_format_m+0x1a) [0x55eae9fce82a]
./miniruby(vm_call_cfunc_with_frame+0x127) [0x55eaea041ac7]
./miniruby(vm_exec_core+0x114) [0x55eaea05d684]
./miniruby(rb_vm_exec+0x187) [0x55eaea04e747]
./miniruby(rb_funcallv_scope+0x1b0) [0x55eaea05a770]
./miniruby(rb_fiber_scheduler_unblock+0x3e) [0x55eae9fb979e]
./miniruby(sync_wakeup+0x10d) [0x55eae9ffd45d]
./miniruby(rb_szqueue_pop+0xf5) [0x55eae9ffefd5]
./miniruby(vm_call_cfunc_with_frame+0x127) [0x55eaea041ac7]
./miniruby(vm_exec_core+0x114) [0x55eaea05d684]
./miniruby(rb_vm_exec+0x187) [0x55eaea04e747]
./miniruby(rb_vm_invoke_proc+0x5f) [0x55eaea05584f]
./miniruby(rb_fiber_start+0x1da) [0x55eae9e1e24a]
./miniruby(fiber_entry+0x0) [0x55eae9e1e550]
</code></pre>
<p>I've attached the rest of the VM dump. <code>make runruby</code> gives a nearly identical dump. I can post a core dump or <code>rr</code> recording, if needed.<br>
_<br>
I'm sorry I didn't simplify the script more; small, seemingly irrelevant changes can change the failure or allow it to pass. Sometimes it raises a bizarre exception instead of SEGV, most commonly a NoMethodError which seemingly indicates that the local vars have been shifted or scrambled. For example, this particular SEGV was caused by a guard clause checking that <code>unblock(blocker, fiber)</code> was given a Fiber object. Here, that object is invalid, but I've seen it be a string or some other object from elsewhere in the process.</p>
<p>For comparison, this is what the script output should look like:</p>
<pre><code>========================================================================
fiber_queue
completed in 0.00031569297425448895
========================================================================
fiber_sized_queue
completed in 0.1176840600091964
========================================================================
fiber_sized_queue2
completed in 0.19209402799606323
========================================================================
fiber_sized_queue3
completed in 0.21404067997355014
========================================================================
fiber_sized_queue4
completed in 0.30277197097893804
</code></pre>
<p>I was attempting to create some simple benchmarks for <code>Queue</code> and <code>SizedQueue</code> with fibers, to mimic <code>benchmark/vm_thread_*queue*.rb</code>. I never completed the benchmarks because of this SEGV. :)</p> Ruby master - Bug #18740 (Open): Use of rightward assignment changes line number needed for line-...https://redmine.ruby-lang.org/issues/187402022-04-18T10:00:41Zhurricup (Alexandr Evstigneev)hurricup@gmail.com
<p>Affected ruby 3.1.1</p>
<p>Sample illustrating the problem (<code>test.rb</code>):</p>
<pre><code>def foo
File.read("test.rb")
.split("\n")
.map(&:strip)
.reject(&:empty?)
.first(10) => lines
puts lines
end
TracePoint.new(:line){ puts 'Hi' }.enable(target: RubyVM::InstructionSequence.of(method :foo), target_line: 2)
foo
</code></pre>
<p>produces</p>
<pre><code><internal:trace_point>:212:in `enable': can not enable any hooks (ArgumentError)
</code></pre>
<p>iseq for method:</p>
<pre><code>== disasm: #<ISeq:foo@/home/hurricup/test.rb:1 (1,0)-(9,3)> (catch: FALSE)
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] lines@0
0000 putnil ( 6)[LiCa]
0001 putnil
0002 putobject false
0004 putnil
0005 putnil
0006 opt_getinlinecache 15, <is:0> ( 2)
0009 putobject true
0011 getconstant :File
0013 opt_setinlinecache <is:0>
0015 putstring "test.rb"
0017 opt_send_without_block <calldata!mid:read, argc:1, ARGS_SIMPLE>
0019 putstring "\n" ( 3)
0021 opt_send_without_block <calldata!mid:split, argc:1, ARGS_SIMPLE>
0023 putobject :strip ( 4)
0025 send <calldata!mid:map, argc:0, ARGS_BLOCKARG>, nil
0028 putobject :empty? ( 5)
0030 send <calldata!mid:reject, argc:0, ARGS_BLOCKARG>, nil
0033 putobject 10 ( 6)
0035 opt_send_without_block <calldata!mid:first, argc:1, ARGS_SIMPLE>
0037 dup
0038 setlocal_WC_0 lines@0
0040 jump 88
0042 putspecialobject 1 ( 2)
0044 topn 4
0046 branchif 64
0048 putobject NoMatchingPatternError
0050 putspecialobject 1
0052 putobject "%p: %s"
0054 topn 4
0056 topn 7
0058 opt_send_without_block <calldata!mid:core#sprintf, argc:3, ARGS_SIMPLE>
0060 opt_send_without_block <calldata!mid:core#raise, argc:2, ARGS_SIMPLE>
0062 jump 84
0064 putobject NoMatchingPatternKeyError
0066 putspecialobject 1
0068 putobject "%p: %s"
0070 topn 4
0072 topn 7
0074 opt_send_without_block <calldata!mid:core#sprintf, argc:3, ARGS_SIMPLE>
0076 topn 7
0078 topn 9
0080 opt_send_without_block <calldata!mid:new, argc:3, kw:[matchee,key], KWARG>
0082 opt_send_without_block <calldata!mid:core#raise, argc:1, ARGS_SIMPLE>
0084 adjuststack 7
0086 jump 90
0088 adjuststack 6 ( 6)
0090 putself ( 8)[Li]
0091 getlocal_WC_0 lines@0
0093 opt_send_without_block <calldata!mid:puts, argc:1, FCALL|ARGS_SIMPLE>
0095 leave ( 9)[Re]
</code></pre>
<p>Works like a charm without <code>=> lines</code></p> Ruby master - Bug #18677 (Assigned): BigDecimal#power (**) returns FloatDomainError when passing ...https://redmine.ruby-lang.org/issues/186772022-04-04T09:27:59Zdorianmariefr (Dorian Marié)
<p>Example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="o">></span> <span class="no">BigDecimal</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="o">**</span> <span class="no">BigDecimal</span><span class="p">(</span><span class="s2">"Infinity"</span><span class="p">)</span>
<span class="no">FloatDomainError</span><span class="p">:</span> <span class="no">Computation</span> <span class="n">results</span> <span class="k">in</span> <span class="s1">'Infinity'</span>
</code></pre>
<p>Maybe:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s2">"bigdecimal/util"</span>
<span class="k">class</span> <span class="nc">BigDecimal</span> <span class="o"><</span> <span class="no">Numeric</span>
<span class="k">def</span> <span class="nf">**</span><span class="p">(</span><span class="n">other</span><span class="p">)</span>
<span class="k">if</span> <span class="n">other</span><span class="p">.</span><span class="nf">infinite?</span> <span class="o">==</span> <span class="mi">1</span>
<span class="k">if</span> <span class="nb">self</span> <span class="o">></span> <span class="mi">1</span>
<span class="no">BigDecimal</span><span class="o">::</span><span class="no">INFINITY</span>
<span class="k">elsif</span> <span class="nb">self</span> <span class="o">==</span> <span class="mi">1</span>
<span class="nb">self</span>
<span class="k">elsif</span> <span class="nb">self</span> <span class="o">>=</span> <span class="mi">0</span>
<span class="no">BigDecimal</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="k">else</span>
<span class="n">power</span><span class="p">(</span><span class="n">other</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">else</span>
<span class="n">power</span><span class="p">(</span><span class="n">other</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">puts_and_eval</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
<span class="nb">puts</span> <span class="n">string</span>
<span class="nb">p</span> <span class="nb">eval</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">puts_and_eval</span> <span class="s2">"10 ** BigDecimal::INFINITY"</span>
<span class="n">puts_and_eval</span> <span class="s2">"1 ** BigDecimal::INFINITY"</span>
<span class="n">puts_and_eval</span> <span class="s2">"0.1 ** BigDecimal::INFINITY"</span>
<span class="n">puts_and_eval</span> <span class="s2">"0 ** BigDecimal::INFINITY"</span>
<span class="n">puts_and_eval</span> <span class="s2">"-1 ** BigDecimal::INFINITY"</span>
</code></pre>
<p>Seems like ruby is doing very different things from math though</p> Ruby master - Bug #18601 (Open): Invalid byte sequences in Big5 encodingshttps://redmine.ruby-lang.org/issues/186012022-02-22T22:15:06Zjanosch-x (Janosch Müller)
<p>I encoded all unicode codepoints in all encodings:</p>
<pre><code>full_string = ((0..0xD7FF).to_a + (0xE000..0x10FFFF).to_a).pack('U*'); 1
uniq_encodings =
Encoding.name_list -
Encoding.aliases.keys -
%w[locale external filesystem internal]
encoded_strings =
uniq_encodings.map do |enc|
full_string.encode(enc, invalid: :replace, undef: :replace, replace: '')
rescue => e
puts e
end; 1
</code></pre>
<p>This prints about 10 "converter not found" errors, such as <code>code converter not found (UTF-8 to UTF-7)</code>, but I guess this is expected.</p>
<p>Some of the converters seem to output invalid strings, though:</p>
<pre><code>encoded_strings.each do |str|
str&.codepoints
rescue => e
puts e
end; 1
</code></pre>
<p>This will print <code>invalid byte sequence in {Big5HKSCS,Big5-UAO,CP950,CP951}</code>.</p>
<p>Looking for example at the generated CP950 string, 8031 of its 25342 characters are invalid, spread across 2017 distinct ranges in the string. The invalid characters' codepoints are all in the range of 0x81..0xFE.</p>
<p>Is this a bug?</p>
<p>I would expect <code>String#encode</code> with <code>invalid: :replace, undef: :replace</code> not to create invalid byte sequences, but maybe I am misunderstanding these encodings and this is an unavoidable issue?</p>
<p>CC <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/50">@duerst (Martin Dürst)</a></p> Ruby master - Bug #18455 (Open): `IO#close` has poor performance and difficult to understand sema...https://redmine.ruby-lang.org/issues/184552022-01-01T07:13:08Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p><code>IO#close</code> should be responsible for closing the file descriptor referred to by the IO instance. When dealing with buffered IO, one can also expect this to flush the internal buffers if possible.</p>
<p>Currently, all blocking IO operations release the GVL and perform the blocking system call using <code>rb_thread_io_blocking_region</code>. The current implementation takes a file descriptor and adds an entry to the VM global <code>waiting_fds</code> list. When the operation is completed, the entry is removed from <code>waiting_fds</code>.</p>
<p>When calling <code>IO#close</code>, this list is traversed and any threads performing blocking operations with a matching file descriptor are interrupted. The performance of this is O(number of blocking IO operations) which in practice the performance of <code>IO#close</code> can take milliseconds with 10,000 threads performing blocking IO. This performance is unacceptable.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1">#!/usr/bin/env ruby</span>
<span class="nb">require</span> <span class="s1">'benchmark'</span>
<span class="k">class</span> <span class="nc">Reading</span>
<span class="k">def</span> <span class="nf">initialize</span>
<span class="vi">@r</span><span class="p">,</span> <span class="vi">@w</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">pipe</span>
<span class="vi">@thread</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="vi">@r</span><span class="p">.</span><span class="nf">read</span>
<span class="k">rescue</span> <span class="no">IOError</span>
<span class="c1"># Ignore.</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="kp">attr</span> <span class="ss">:r</span>
<span class="kp">attr</span> <span class="ss">:w</span>
<span class="kp">attr</span> <span class="ss">:thread</span>
<span class="k">def</span> <span class="nf">join</span>
<span class="vi">@thread</span><span class="p">.</span><span class="nf">join</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">measure</span><span class="p">(</span><span class="n">count</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span>
<span class="n">readings</span> <span class="o">=</span> <span class="n">count</span><span class="p">.</span><span class="nf">times</span><span class="p">.</span><span class="nf">map</span> <span class="k">do</span>
<span class="no">Reading</span><span class="p">.</span><span class="nf">new</span>
<span class="k">end</span>
<span class="nb">sleep</span> <span class="mi">10</span>
<span class="n">duration</span> <span class="o">=</span> <span class="no">Benchmark</span><span class="p">.</span><span class="nf">measure</span> <span class="k">do</span>
<span class="n">readings</span><span class="p">.</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">reading</span><span class="o">|</span>
<span class="n">reading</span><span class="p">.</span><span class="nf">r</span><span class="p">.</span><span class="nf">close</span>
<span class="n">reading</span><span class="p">.</span><span class="nf">w</span><span class="p">.</span><span class="nf">close</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">average</span> <span class="o">=</span> <span class="p">(</span><span class="n">duration</span><span class="p">.</span><span class="nf">total</span> <span class="o">/</span> <span class="n">count</span><span class="p">)</span> <span class="o">*</span> <span class="mf">1000.0</span>
<span class="n">pp</span> <span class="ss">count: </span><span class="n">count</span><span class="p">,</span> <span class="ss">average: </span><span class="nb">sprintf</span><span class="p">(</span><span class="s2">"%0.2fms"</span><span class="p">,</span> <span class="n">average</span><span class="p">)</span>
<span class="n">readings</span><span class="p">.</span><span class="nf">each</span><span class="p">(</span><span class="o">&</span><span class="ss">:join</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">measure</span><span class="p">(</span> <span class="mi">10</span><span class="p">)</span>
<span class="n">measure</span><span class="p">(</span> <span class="mi">100</span><span class="p">)</span>
<span class="n">measure</span><span class="p">(</span> <span class="mi">1000</span><span class="p">)</span>
<span class="n">measure</span><span class="p">(</span><span class="mi">10000</span><span class="p">)</span>
</code></pre>
<p>In addition, the semantics of this operation are confusing at best. While Ruby programs are dealing with IO instances, the VM is dealing with file descriptors, in effect performing some internal de-duplication of IO state. In practice, this leads to strange behaviour:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1">#!/usr/bin/env ruby</span>
<span class="n">r</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">pipe</span>
<span class="n">r2</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">for_fd</span><span class="p">(</span><span class="n">r</span><span class="p">.</span><span class="nf">to_i</span><span class="p">)</span>
<span class="n">pp</span> <span class="ss">r: </span><span class="n">r</span><span class="p">,</span> <span class="ss">r2: </span><span class="n">r2</span>
<span class="n">t</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">r2</span><span class="p">.</span><span class="nf">read</span> <span class="k">rescue</span> <span class="kp">nil</span>
<span class="n">r2</span><span class="p">.</span><span class="nf">read</span> <span class="c1"># EBADF</span>
<span class="k">end</span>
<span class="nb">sleep</span> <span class="mf">0.5</span>
<span class="n">r</span><span class="p">.</span><span class="nf">close</span>
<span class="n">t</span><span class="p">.</span><span class="nf">join</span> <span class="k">rescue</span> <span class="kp">nil</span>
<span class="n">pp</span> <span class="ss">r: </span><span class="n">r</span><span class="p">,</span> <span class="ss">r2: </span><span class="n">r2</span>
<span class="c1"># r is closed, r2 is valid but will raise EBADF on any operation.</span>
</code></pre>
<p>In addition, this confusing behaviour extends to Ractor and state is leaked between the two:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">pipe</span>
<span class="n">ractor</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">r</span><span class="p">.</span><span class="nf">to_i</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">fd</span><span class="o">|</span>
<span class="n">r2</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">for_fd</span><span class="p">(</span><span class="n">fd</span><span class="p">)</span>
<span class="n">r2</span><span class="p">.</span><span class="nf">read</span>
<span class="c1"># r2.read # EBADF</span>
<span class="k">end</span>
<span class="nb">sleep</span> <span class="mf">0.5</span>
<span class="n">r</span><span class="p">.</span><span class="nf">close</span>
<span class="n">pp</span> <span class="ss">take: </span><span class="n">ractor</span><span class="p">.</span><span class="nf">take</span>
</code></pre>
<p>I propose the following changes to simplify the semantics and improve performance:</p>
<ul>
<li>Move the semantics of <code>waiting_fds</code> from per-fd to per-IO. This means that <code>IO#close</code> only interrupts blocking operations performed on the same IO instance rather than ANY IO which refers to the same file descriptor. I think this behaviour is easier to understand and still protects against the vast majority of incorrect usage.</li>
<li>Move the details of <code>struct rb_io_t</code> to <code>internal/io.h</code> so that the implementation details are not part of the public interface.</li>
</ul>
<a name="Benchmarks"></a>
<h2 >Benchmarks<a href="#Benchmarks" class="wiki-anchor">¶</a></h2>
<p>Before:</p>
<pre><code>{:count=>10, :average=>"0.19ms"}
{:count=>100, :average=>"0.11ms"}
{:count=>1000, :average=>"0.18ms"}
{:count=>10000, :average=>"1.16ms"}
</code></pre>
<p>After:</p>
<pre><code>{:count=>10, :average=>"0.20ms"}
{:count=>100, :average=>"0.11ms"}
{:count=>1000, :average=>"0.15ms"}
{:count=>10000, :average=>"0.68ms"}
</code></pre>
<p>After investigating this further I found that the <code>rb_thread_io_blocking_region</code> using <code>ubf_select</code> can be incredibly slow, proportional to the number of threads. I don't know whether it's advisable but:</p>
<pre><code class="c syntaxhl" data-language="c"> <span class="n">BLOCKING_REGION</span><span class="p">(</span><span class="n">blocking_node</span><span class="p">.</span><span class="kr">thread</span><span class="p">,</span> <span class="p">{</span>
<span class="n">val</span> <span class="o">=</span> <span class="n">func</span><span class="p">(</span><span class="n">data1</span><span class="p">);</span>
<span class="n">saved_errno</span> <span class="o">=</span> <span class="n">errno</span><span class="p">;</span>
<span class="p">},</span> <span class="nb">NULL</span> <span class="cm">/* ubf_select */</span><span class="p">,</span> <span class="n">blocking_node</span><span class="p">.</span><span class="kr">thread</span><span class="p">,</span> <span class="n">FALSE</span><span class="p">);</span>
</code></pre>
<p>Disabling the UBF function and relying on <code>read(fd, ...)</code>/<code>write(fd, ...)</code> blocking operations to fail when <code>close(fd)</code> is invoked might be sufficient? This needs more investigation but after making this change, we have constant-time IO#close.</p>
<pre><code>{:count=>10, :average=>"0.13ms"}
{:count=>100, :average=>"0.06ms"}
{:count=>1000, :average=>"0.04ms"}
{:count=>10000, :average=>"0.09ms"}
</code></pre>
<p>Which is ideally what we want.</p> Ruby master - Bug #18337 (Assigned): Ruby allows zero-width characters in identifiershttps://redmine.ruby-lang.org/issues/183372021-11-15T00:14:21Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>Ruby allows zero-width characters in identifiers, which can be shown with the following small test:</p>
<p>irb(main):001:0> script = "ab = 20; a\u200Bb = 30; puts ab;"<br>
=> "ab = 20; ab = 30; puts ab;"<br>
irb(main):002:0> eval(script)<br>
20<br>
=> nil</p>
<p>The first line creates the script. It contains a zero-width space (ZWSP), but that's not visible in most contexts (see next line). Looking at the script, one expects 30 as an output, but the output is 20 because there are two variables involved, one with a ZWSP and one without. I propose we fix this by disallowing such characters in identifiers. I'll give more details in a followup.</p> Ruby master - Bug #18119 (Assigned): Ractor crashes when instantiating classeshttps://redmine.ruby-lang.org/issues/181192021-08-19T13:23:40Zpeterzhu2118 (Peter Zhu)peter@peterzhu.ca
<p>The following script crashes with a segfault (tested on Ubuntu 20.04 and macOS 11.5.2):</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">workers</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="o">...</span><span class="mi">8</span><span class="p">).</span><span class="nf">map</span> <span class="k">do</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="kp">loop</span> <span class="k">do</span>
<span class="mi">100</span><span class="p">.</span><span class="nf">times</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="no">Class</span><span class="p">.</span><span class="nf">new</span> <span class="p">}</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">yield</span> <span class="kp">nil</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="mi">100</span><span class="p">.</span><span class="nf">times</span> <span class="p">{</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">select</span><span class="p">(</span><span class="o">*</span><span class="n">workers</span><span class="p">)</span> <span class="p">}</span>
</code></pre>
<p>Crash error:</p>
<pre><code><internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
test.rb:4: [BUG] Segmentation fault at 0x0000000000000040
ruby 3.1.0dev (2021-08-19T08:44:48Z master 6963f8f743) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0010 p:---- s:0033 e:000032 CFUNC :new
c:0009 p:0011 s:0029 e:000028 BLOCK test.rb:4 [FINISH]
c:0008 p:---- s:0026 e:000025 IFUNC
c:0007 p:---- s:0023 e:000022 CFUNC :times
c:0006 p:---- s:0020 e:000019 CFUNC :each
c:0005 p:---- s:0017 e:000016 CFUNC :map
c:0004 p:0007 s:0013 e:000012 BLOCK test.rb:4 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC :loop
c:0002 p:0004 s:0006 e:000005 BLOCK test.rb:3 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
test.rb:3:in `block (2 levels) in <main>'
test.rb:3:in `loop'
test.rb:4:in `block (3 levels) in <main>'
test.rb:4:in `map'
test.rb:4:in `each'
test.rb:4:in `times'
test.rb:4:in `block (4 levels) in <main>'
test.rb:4:in `new'
-- Machine register context ------------------------------------------------
RIP: 0x0000562c1f9cd2cb RBP: 0x00007f6c3736d378 RSP: 0x00007f6c368285f0
RAX: 0x00007f6c1c00e208 RBX: 0x00007f6c3736d378 RCX: 0x0000562c20ed8330
RDX: 0x0000000000000000 RDI: 0x00007f6c100095c0 RSI: 0x0000000000000000
R8: 0x0000000000000007 R9: 0x0000562c20ed8120 R10: 0x0000000000000022
R11: 0x0000562c21180760 R12: 0x0000000000000000 R13: 0x00007f6c3736c000
R14: 0x0000000000000000 R15: 0x00007f6c3736d378 EFL: 0x0000000000010202
-- C level backtrace information -------------------------------------------
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_print_backtrace+0x11) [0x562c1f995e38] ../vm_dump.c:759
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_vm_bugreport) ../vm_dump.c:1041
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_bug_for_fatal_signal+0xec) [0x562c1f78a0bc] ../error.c:815
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(sigsegv+0x4d) [0x562c1f8ebcbd] ../signal.c:961
/lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7f6c3b2c63c0]
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_class_remove_from_super_subclasses+0x2b) [0x562c1f9cd2cb] ../class.c:99
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(obj_free+0x37a) [0x562c1f7ae95a] ../gc.c:3123
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_plane_sweep+0x21) [0x562c1f7aef3d] ../gc.c:5322
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_page_sweep) ../gc.c:5464
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_sweep_step) ../gc.c:5630
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_heap_prepare_minimum_pages+0x0) [0x562c1f7afd94] ../gc.c:5834
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_sweep) ../gc.c:5837
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_marks+0x1c0) [0x562c1f7b3df8] ../gc.c:8144
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(gc_start) ../gc.c:9013
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(heap_prepare+0x2f) [0x562c1f7b8b6f] ../gc.c:2131
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(heap_next_freepage) ../gc.c:2422
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(ractor_cache_slots) ../gc.c:2454
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(newobj_slowpath) ../gc.c:2495
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(newobj_slowpath_wb_protected) ../gc.c:2519
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(newobj_of0+0x5) [0x562c1f7b8ebd] ../gc.c:2562
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(newobj_of) ../gc.c:2572
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_wb_protected_newobj_of) ../gc.c:2596
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(class_alloc+0x5) [0x562c1f9cd49e] ../class.c:185
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_class_boot) ../class.c:230
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(class_call_alloc_func+0x5) [0x562c1f84e5d3] ../object.c:2075
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_class_alloc) ../object.c:2047
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_class_new_instance_pass_kw) ../object.c:2120
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_cfp_consistent_p+0x0) [0x562c1f96d6bc] ../vm_insnhelper.c:2989
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call_cfunc_with_frame) ../vm_insnhelper.c:2991
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_sendish+0x303) [0x562c1f978393] ../vm_insnhelper.c:4562
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_exec_core+0xcd) [0x562c1f98316d] ../insns.def:775
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_vm_exec+0x197) [0x562c1f978fc7] ../vm.c:2164
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(collect_i+0x12) [0x562c1fa27bf2] ../enum.c:608
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_vm_pop_frame+0x0) [0x562c1f976ba8] ../vm_insnhelper.c:3795
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_yield_with_cfunc) ../vm_insnhelper.c:3796
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(invoke_block_from_c_bh+0x10) [0x562c1f97d0d3] ../vm.c:1359
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_yield) ../vm.c:1399
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_yield_0) ../vm_eval.c:1350
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_yield_1) ../vm_eval.c:1356
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(int_dotimes+0x5c) [0x562c1f83a49c] ../numeric.c:5014
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_cfp_consistent_p+0x0) [0x562c1f97dd4f] ../vm_eval.c:135
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call0_cfunc_with_frame) ../vm_eval.c:137
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call0_cfunc) ../vm_eval.c:149
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call0_body) ../vm_eval.c:182
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_call0+0x1ea) [0x562c1f9812fa] ../vm_eval.c:72
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(iterate_method+0x3b) [0x562c1f981e9b] ../vm_eval.c:847
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_iterate0+0x101) [0x562c1f973001] ../vm_eval.c:1534
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_block_call_kw+0x76) [0x562c1f9731f6] ../vm_eval.c:1566
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(enumerator_block_call+0x59) [0x562c1fa358e9] ../enumerator.c:553
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_cfp_consistent_p+0x0) [0x562c1f97dd4f] ../vm_eval.c:135
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call0_cfunc_with_frame) ../vm_eval.c:137
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call0_cfunc) ../vm_eval.c:149
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call0_body) ../vm_eval.c:182
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_call0+0x1ea) [0x562c1f9812fa] ../vm_eval.c:72
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(iterate_method+0x3b) [0x562c1f981e9b] ../vm_eval.c:847
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_iterate0+0x101) [0x562c1f973001] ../vm_eval.c:1534
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_lambda_call+0x75) [0x562c1f973295] ../vm_eval.c:1633
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(enum_collect+0x5b) [0x562c1fa29acb] ../enum.c:647
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_cfp_consistent_p+0x0) [0x562c1f96d6bc] ../vm_insnhelper.c:2989
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call_cfunc_with_frame) ../vm_insnhelper.c:2991
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_sendish+0x303) [0x562c1f978393] ../vm_insnhelper.c:4562
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_exec_core+0x130) [0x562c1f9831d0] ../insns.def:756
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_vm_exec+0x197) [0x562c1f978fc7] ../vm.c:2164
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(invoke_block_from_c_bh+0x130) [0x562c1f97c85a] ../vm.c:1264
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_yield) ../vm.c:1399
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_yield_0) ../vm_eval.c:1350
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(loop_i) ../vm_eval.c:1449
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_vrescue2+0x114) [0x562c1f794694] ../eval.c:1023
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_rescue2+0x8e) [0x562c1f79490e] ../eval.c:1000
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_cfp_consistent_p+0x0) [0x562c1f96d6bc] ../vm_insnhelper.c:2989
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_call_cfunc_with_frame) ../vm_insnhelper.c:2991
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_sendish+0x303) [0x562c1f978393] ../vm_insnhelper.c:4562
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(vm_exec_core+0x130) [0x562c1f9831d0] ../insns.def:756
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_vm_exec+0x197) [0x562c1f978fc7] ../vm.c:2164
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(thread_do_start_proc+0x294) [0x562c1f930f24] ../thread.c:716
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(thread_do_start+0xc) [0x562c1f9336fc] ../thread.c:760
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(thread_start_func_2) ../thread.c:835
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(rb_native_cond_initialize+0x0) [0x562c1f933a09] ../thread_pthread.c:1051
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(register_cached_thread_and_wait) ../thread_pthread.c:1103
/home/spin/src/github.com/Shopify/ruby-master/install/bin/ruby(thread_start_func_1) ../thread_pthread.c:1058
/lib/x86_64-linux-gnu/libpthread.so.0(0x9609) [0x7f6c3b2ba609]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f6c3b044293]
</code></pre> Ruby master - Bug #18002 (Open): s390x: Tests failing without LC_ALL envhttps://redmine.ruby-lang.org/issues/180022021-06-21T10:45:16Zjaruga (Jun Aruga)
<p>The following failures happened in RubyCI on our s390x Ubuntu focal server.<br>
On the server, RubyCI (ruby/chkbuild) is executed with LC_ALL not set, by cron.<br>
I found the unset <code>LC_ALL</code> causes the failures on the s390x server. This does not happen on x86_64 Fedora 33 on my local machine.</p>
<p>I was able to reproduce the failures on the master branch <code>dbd1887d04f5ff7c2a1f0a27d7339133a</code> on the server.</p>
<a name="Reproducer"></a>
<h2 >Reproducer<a href="#Reproducer" class="wiki-anchor">¶</a></h2>
<pre><code>$ uname -m
s390x
$ autoconf
$ ./configure \
--prefix=${HOME}/local/ruby-master-9d96837 \
--enable-shared
$ make
</code></pre>
<h3>Without <code>LC_ALL</code>
</h3>
<p>Then run the tests without <code>LC_ALL</code>.</p>
<pre><code>$ unset LC_ALL
$ echo $LC_ALL
<= empty
</code></pre>
<pre><code>$ make test-all TESTS="-v test/ruby/test_file.rb -n TestFile#test_realpath_encoding"
Run options:-
--seed=85060
"--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=./test/excludes
--name=!/memory_leak/
-v
-n
TestFile#test_realpath_encoding
# Running tests:
[1/0] TestFile#test_realpath_encoding = 0.00 s
1) Failure:
TestFile#test_realpath_encoding [/home/jaruga/git/ruby/ruby2/test/ruby/test_file.rb:284]:
<"/tmp/rubytest-realpath20210621-3365652-za1wql/A\u0391\u0410\u0531\u10A0\u05D0\u2C00\u3042"> expected but was
<"/tmp/rubytest-realpath20210621-3365652-za1wql/A\u00CE\u0091\u00D0\u0090\u00D4\u00B1\u00E1\u0082\u00A0\u00D7\u0090\u00E2\u00B0\u0080\u00E3\u0081\u0082">.
Finished tests in 0.007217s, 138.5674 tests/s, 692.8372 assertions/s.
1 tests, 5 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
make: *** [uncommon.mk:803: yes-test-all] Error 1
</code></pre>
<pre><code>$ make test-all TESTS="-v test/irb/test_context.rb -n TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception"
Run options:-
--seed=74635
"--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=./test/excludes
--name=!/memory_leak/
-v
-n
TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception
# Running tests:
[1/0] TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception = 0.00 s
1) Failure:
TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception [/home/jaruga/git/ruby/ruby2/test/irb/test_context.rb:505]:
Expected /\(irb\):1:in `fuga': A\\xF3B \(RuntimeError\)\n/
to match
"(irb):1:in `fuga': A�B (RuntimeError)\n"+
"\tfrom (irb):1:in `hoge'\n"+
"\tfrom (irb):1:in `<main>'\n"
after 1 patterns with 0 characters.
Finished tests in 0.007640s, 130.8819 tests/s, 785.2916 assertions/s.
1 tests, 6 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
make: *** [uncommon.mk:803: yes-test-all] Error 1
</code></pre>
<h3>With <code>export LC_ALL=C</code>
</h3>
<p>On the <code>export LC_ALL=C</code> (<code>LC_ALL=C</code> without <code>export</code> is not enough to pass the tests)</p>
<pre><code>$ export LC_ALL=C
$ echo $LC_ALL
C
</code></pre>
<pre><code>$ make test-all TESTS="-v test/ruby/test_file.rb -n TestFile#test_realpath_encoding"
Run options:
--seed=89696
"--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=./test/excludes
--name=!/memory_leak/
-v
-n
TestFile#test_realpath_encoding
# Running tests:
[1/0] TestFile#test_realpath_encoding = 0.00 s
Finished tests in 0.004715s, 212.0691 tests/s, 1060.3455 assertions/s.
1 tests, 5 assertions, 0 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
</code></pre>
<pre><code>$ make test-all TESTS="-v test/irb/test_context.rb -n TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception"
Run options:
--seed=67965
"--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=./test/excludes
--name=!/memory_leak/
-v
-n
TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception
# Running tests:
[1/0] TestIRB::TestContext#test_eval_input_with_invalid_byte_sequence_exception = 0.00 s
Finished tests in 0.007877s, 126.9448 tests/s, 761.6689 assertions/s.
1 tests, 6 assertions, 0 failures, 0 errors, 0 skips
ruby -v: ruby 3.1.0dev (2021-06-18T10:13:36Z master 9d96837dbd) [s390x-linux]
</code></pre>
<a name="Possible-Solution"></a>
<h2 >Possible Solution<a href="#Possible-Solution" class="wiki-anchor">¶</a></h2>
<p>Fix the tests not depending on the external LC_ALL condition.</p> Ruby master - Bug #17998 (Assigned): ractor: process hanging (with ractors initialized, but not b...https://redmine.ruby-lang.org/issues/179982021-06-17T13:45:50Zchucke (Tiago Cardoso)
<p>I couldn't figure out how to reproduce this in a more contained way, so I'll share what I'm doing <a href="https://github.com/HoneyryderChuck/minitest/tree/issue-872" class="external">in this minitest branch</a>.</p>
<p>I'm trying to make minitest's parallel mode use ractors. If you look at the last commit of the branch, I'm:</p>
<ul>
<li>replacing the parallel executor with a ractor-based one;</li>
<li>I'm defining the ractor executor, where I have a ractor pipe that a pool will consume work from</li>
<li>I'm turning off parallel subset of tests (to reproduce the bug that I'll be describing).</li>
</ul>
<p>When I run <code>rake test</code> in my Mac (BigSur 11.4), the process hangs. I can see that the ractor threads are executing and running, but the test process doesn't respond to the INFO signal interrupt (which should tell me where the process is hanging). This seems like a bug in the VM, as no work is being sent to the parallel executor, i.e. all ractors should be sleeping (I've <code>puts</code>'d also the executor shutdown process, and it never reaches it).</p>
<p>If I replace the ractor-based executor back with the thread based executor, everything works as expected.</p> Ruby master - Bug #17996 (Open): Cygwin: thread + pipe behavior since Ruby 2.6https://redmine.ruby-lang.org/issues/179962021-06-17T03:59:49Zxtkoba (Tee KOBAYASHI)
<p>The following one-liner is the repro named <code>thread-pipe-read-close.rb</code> the aim of which is essentially the same as that of "IO#close raises an IOError with a clear message" test in <code>spec/ruby/core/io/close_spec.rb</code>.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">pipe</span><span class="p">;</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span><span class="p">{</span> <span class="n">r</span><span class="p">.</span><span class="nf">read</span> <span class="p">};</span> <span class="nb">sleep</span> <span class="mf">0.5</span><span class="p">;</span> <span class="n">r</span><span class="p">.</span><span class="nf">close</span>
</code></pre>
<p>Run on Cygwin with Ruby 2.6 or later, this hangs up indefinitely consuming a full core. On the other hand, with Ruby 2.5.9p229 it works as expected.</p>
<pre><code>$ miniruby25 -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-cygwin]
$ miniruby25 thread-pipe-read-close.rb
#<Thread:0x000000080006c9f0@thread-pipe-read-close.rb:2 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
1: from thread-pipe-read-close.rb:2:in `block in <main>'
thread-pipe-read-close.rb:2:in `read': IOError
$ miniruby -v
ruby 3.1.0dev (2021-06-10T23:31:51Z master 9210f8df7f) [x86_64-cygwin]
$ miniruby thread-pipe-read-close.rb
</code></pre> Ruby master - Bug #17882 (Assigned): bootstraptest/test_ractor.rb:224 segfaults on Cygwinhttps://redmine.ruby-lang.org/issues/178822021-05-22T16:03:35Zxtkoba (Tee KOBAYASHI)
<p>The attached test code is excerpted from <code>bootstraptest/test_ractor.rb:224</code>. This code causes a segmentation fault every time when run on <code>x86_64-cygwin</code>. There are at least 3 types of dying messages, as shown below.</p>
<p>I have no idea whether this is relevant to <a class="issue tracker-1 status-1 priority-4 priority-default" title="Bug: bootstraptest/test_ractor.rb:224 a random failing test with "The outgoing-port is already closed ... (Open)" href="https://redmine.ruby-lang.org/issues/17878">#17878</a>, which is an issue with the very same test code.</p>
<p>Type 1 (null pointer dereference):</p>
<pre><code>Thread 6 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 5368]
VM_CF_BLOCK_HANDLER (cfp=0x0) at ../vm.c:115
115 const VALUE *ep = VM_CF_LEP(cfp);
(gdb) bt
#0 VM_CF_BLOCK_HANDLER (cfp=0x0) at ../vm.c:115
#1 0x00007ff6acedb495 in rb_vm_frame_block_handler (cfp=<optimized out>) at ../vm.c:128
#2 0x00007ff6acdd954e in pass_passed_block_handler (ec=0x80012bba0) at ../eval_intern.h:17
#3 rb_obj_call_init_kw (obj=obj@entry=123145240968920, argc=argc@entry=1, argv=argv@entry=0xffd0ca08, kw_splat=kw_splat@entry=0) at ../eval.c:1724
#4 0x00007ff6ace3efc2 in rb_class_new_instance (argc=argc@entry=1, argv=argv@entry=0xffd0ca08, klass=klass@entry=123145300575160) at ../object.c:2192
#5 0x00007ff6acdd1c30 in rb_exc_new_str (etype=etype@entry=123145300575160, str=<optimized out>) at ../error.c:1123
#6 0x00007ff6acdd29ad in rb_vraise (exc=123145300575160, fmt=<optimized out>, ap=<optimized out>) at ../error.c:2922
#7 0x00007ff6acdd29e5 in rb_raise (exc=0, fmt=0x0) at ../error.c:2930
#8 0x00007ff6acdf90e8 in rb_io_check_initialized (fptr=0x0) at ../io.c:767
#9 rb_io_check_initialized (fptr=<optimized out>) at ../io.c:764
#10 0x00007ff6acdf90fb in rb_io_check_closed (fptr=0x0) at ../io.c:774
#11 0x00007ff6ace011ec in prep_stdio (f=0x18023acb8 <reent_data+1336>, fmode=fmode@entry=1, klass=123145300573360, klass@entry=140697440105184, path=path@entry=0x7ff6acf158e0 <prelude_table+2944> "<STDIN>") at ../io.c:8239
#12 0x00007ff6ace0122f in rb_io_prep_stdin () at ../io.c:8255
#13 0x00007ff6acebc980 in thread_start_func_2 (th=0x0, th@entry=0x80011cbf0, stack_start=stack_start@entry=0xffd0ccf8) at ../thread.c:801
#14 0x00007ff6acebd032 in thread_start_func_1 (th_ptr=<optimized out>) at ../thread_pthread.c:1035
#15 0x000000018016d45f in pthread::thread_init_wrapper(void*) () from target:/usr/bin/cygwin1.dll
#16 0x00000001800ddbba in pthread_wrapper () from target:/usr/bin/cygwin1.dll
#17 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
</code></pre>
<p>Type 2 (<code>rb_gc_mark()</code>: <code><address></code> is <code>T_ZOMBIE</code>):</p>
<pre><code>Thread 7 hit Breakpoint 1, rb_bug (fmt=0x7ff6acf1396a <stat_data_type+8138> "rb_gc_mark(): %p is T_ZOMBIE") at ../error.c:782
782 {
(gdb) bt
#0 rb_bug (fmt=0x7ff6acf1396a <stat_data_type+8138> "rb_gc_mark(): %p is T_ZOMBIE") at ../error.c:782
#1 0x00007ff6acdeae8f in gc_mark_children (objspace=objspace@entry=0x800053970, obj=obj@entry=123145240171400) at ../gc.c:6934
#2 0x00007ff6acdeafb0 in gc_mark_stacked_objects (objspace=0x800053970, incremental=incremental@entry=0, count=count@entry=0) at ../gc.c:6961
#3 0x00007ff6acded415 in gc_mark_stacked_objects_all (objspace=0x800053970) at ../gc.c:7001
#4 gc_marks_rest (objspace=objspace@entry=0x800053970) at ../gc.c:7972
#5 0x00007ff6acdec08c in gc_marks (full_mark=<optimized out>, objspace=0x800053970) at ../gc.c:8028
#6 gc_start (objspace=objspace@entry=0x800053970, reason=<optimized out>, reason@entry=256) at ../gc.c:8862
#7 0x00007ff6acdee522 in heap_prepare (heap=0x800053998, objspace=0x800053970) at ../gc.c:2153
#8 heap_next_freepage (heap=0x800053998, objspace=0x800053970) at ../gc.c:2444
#9 ractor_cache_slots (objspace=objspace@entry=0x800053970, cr=cr@entry=0x800135d60) at ../gc.c:2476
#10 0x00007ff6acdee61a in newobj_slowpath (alloc_size=<optimized out>, wb_protected=0, cr=0x800135d60, objspace=0x800053970, flags=11, klass=123145300573360) at ../gc.c:2517
#11 newobj_slowpath_wb_unprotected (klass=123145300573360, flags=11, objspace=0x800053970, cr=0x800135d60, alloc_size=<optimized out>) at ../gc.c:2547
#12 0x00007ff6acdee815 in newobj_of0 (klass=klass@entry=123145300573360, flags=flags@entry=11, wb_protected=wb_protected@entry=0, cr=<optimized out>, alloc_size=<optimized out>) at ../gc.c:2585
#13 0x00007ff6acdee86d in newobj_of (klass=klass@entry=123145300573360, flags=flags@entry=11, v1=v1@entry=0, v2=v2@entry=0, v3=v3@entry=0, wb_protected=wb_protected@entry=0, alloc_size=40) at ../gc.c:2594
#14 0x00007ff6acdeec23 in rb_wb_unprotected_newobj_of (klass=klass@entry=123145300573360, flags=flags@entry=11, size=40, size@entry=0) at ../gc.c:2610
#15 0x00007ff6acdf666c in io_alloc (klass=klass@entry=123145300573360) at ../io.c:1038
#16 0x00007ff6acdfbca9 in prep_io (fd=2, fmode=fmode@entry=65546, klass=klass@entry=123145300573360, path=path@entry=0x7ff6acf158f1 <prelude_table+2961> "<STDERR>") at ../io.c:8206
#17 0x00007ff6ace011d4 in prep_stdio (f=0x18023ae28 <reent_data+1704>, fmode=fmode@entry=10, klass=123145300573360, klass@entry=34361007456, path=path@entry=0x7ff6acf158f1 <prelude_table+2961> "<STDERR>") at ../io.c:8237
#18 0x00007ff6ace01295 in rb_io_prep_stderr () at ../io.c:8267
#19 0x00007ff6acebc9a6 in thread_start_func_2 (th=0x0, th@entry=0x800134550, stack_start=stack_start@entry=0xffa0ccf8) at ../thread.c:803
#20 0x00007ff6acebd032 in thread_start_func_1 (th_ptr=<optimized out>) at ../thread_pthread.c:1035
#21 0x000000018016d45f in pthread::thread_init_wrapper(void*) () from target:/usr/bin/cygwin1.dll
#22 0x00000001800ddbba in pthread_wrapper () from target:/usr/bin/cygwin1.dll
#23 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
</code></pre>
<p>Type 3 (try to mark <code>T_NONE</code> object):</p>
<pre><code><OBJ_INFO:gc_mark_ptr@../gc.c:6580> 0x00006fffffe7fb70 [0 M ] T_NONE
------------------------------------------------------------------------
Thread 7 hit Breakpoint 1, rb_bug (fmt=fmt@entry=0x7ff6acf138a0 <stat_data_type+7936> "try to mark T_NONE object") at ../error.c:782
782 {
(gdb) bt
#0 rb_bug (fmt=fmt@entry=0x7ff6acf138a0 <stat_data_type+7936> "try to mark T_NONE object") at ../error.c:782
#1 0x00007ff6acdea5c9 in gc_mark_ptr (objspace=0x800053970, obj=123145300736880) at ../gc.c:6581
#2 0x00007ff6ace672ea in ractor_mark (ptr=0x800117240) at ../ractor.c:197
#3 0x00007ff6acdeafb0 in gc_mark_stacked_objects (objspace=objspace@entry=0x800053970, incremental=incremental@entry=1, count=count@entry=2147483647) at ../gc.c:6961
#4 0x00007ff6acded3f9 in gc_mark_stacked_objects_incremental (count=2147483647, objspace=0x800053970) at ../gc.c:6995
#5 gc_marks_rest (objspace=objspace@entry=0x800053970) at ../gc.c:7968
#6 0x00007ff6acdee4f1 in gc_marks_continue (heap=0x800053998, objspace=0x800053970) at ../gc.c:8012
#7 heap_prepare (heap=0x800053998, objspace=0x800053970) at ../gc.c:2148
#8 heap_next_freepage (heap=0x800053998, objspace=0x800053970) at ../gc.c:2444
#9 ractor_cache_slots (objspace=objspace@entry=0x800053970, cr=cr@entry=0x800129350) at ../gc.c:2476
#10 0x00007ff6acdee61a in newobj_slowpath (alloc_size=<optimized out>, wb_protected=0, cr=0x800129350, objspace=0x800053970, flags=11, klass=123145300573360) at ../gc.c:2517
#11 newobj_slowpath_wb_unprotected (klass=123145300573360, flags=11, objspace=0x800053970, cr=0x800129350, alloc_size=<optimized out>) at ../gc.c:2547
#12 0x00007ff6acdee815 in newobj_of0 (klass=klass@entry=123145300573360, flags=flags@entry=11, wb_protected=wb_protected@entry=0, cr=<optimized out>, alloc_size=<optimized out>) at ../gc.c:2585
#13 0x00007ff6acdee86d in newobj_of (klass=klass@entry=123145300573360, flags=flags@entry=11, v1=v1@entry=0, v2=v2@entry=0, v3=v3@entry=0, wb_protected=wb_protected@entry=0, alloc_size=40) at ../gc.c:2594
#14 0x00007ff6acdeec23 in rb_wb_unprotected_newobj_of (klass=klass@entry=123145300573360, flags=flags@entry=11, size=40, size@entry=0) at ../gc.c:2610
#15 0x00007ff6acdf666c in io_alloc (klass=klass@entry=123145300573360) at ../io.c:1038
#16 0x00007ff6acdfbca9 in prep_io (fd=0, fmode=fmode@entry=65537, klass=klass@entry=123145300573360, path=path@entry=0x7ff6acf158e0 <prelude_table+2944> "<STDIN>") at ../io.c:8206
#17 0x00007ff6ace011d4 in prep_stdio (f=0x18023acb8 <reent_data+1336>, fmode=fmode@entry=1, klass=123145300573360, klass@entry=140697440105184, path=path@entry=0x7ff6acf158e0 <prelude_table+2944> "<STDIN>") at ../io.c:8237
#18 0x00007ff6ace0122f in rb_io_prep_stdin () at ../io.c:8255
#19 0x00007ff6acebc980 in thread_start_func_2 (th=0x0, th@entry=0x80010dcb0, stack_start=stack_start@entry=0xffa0ccf8) at ../thread.c:801
#20 0x00007ff6acebd032 in thread_start_func_1 (th_ptr=<optimized out>) at ../thread_pthread.c:1035
#21 0x000000018016d45f in pthread::thread_init_wrapper(void*) () from target:/usr/bin/cygwin1.dll
#22 0x00000001800ddbba in pthread_wrapper () from target:/usr/bin/cygwin1.dll
#23 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
</code></pre> Ruby master - Bug #17678 (Assigned): Ractors do not restart after forkhttps://redmine.ruby-lang.org/issues/176782021-03-08T16:19:45Zivoanjo (Ivo Anjo)ivo.anjo@datadoghq.com
<p>Hello there! I'm working at Datadog on the <code>ddtrace</code> gem -- <a href="https://github.com/DataDog/dd-trace-rb" class="external">https://github.com/DataDog/dd-trace-rb</a> and we're experimenting with using Ractors in our library but run into a few issues.</p>
<a name="Background"></a>
<h3 >Background<a href="#Background" class="wiki-anchor">¶</a></h3>
<p>When running a Ractor as a background process, the Ractor stops & does not restart when the application forks.</p>
<a name="How-to-reproduce-Ruby-version-amp-script"></a>
<h3 >How to reproduce (Ruby version & script)<a href="#How-to-reproduce-Ruby-version-amp-script" class="wiki-anchor">¶</a></h3>
<p><code>ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]</code></p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r2</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="kp">loop</span> <span class="p">{</span> <span class="nb">puts</span> <span class="s2">"[</span><span class="si">#{</span><span class="no">Process</span><span class="p">.</span><span class="nf">pid</span><span class="si">}</span><span class="s2">] Ractor"</span><span class="p">;</span> <span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"[</span><span class="si">#{</span><span class="no">Process</span><span class="p">.</span><span class="nf">pid</span><span class="si">}</span><span class="s2">] Forking..."</span>
<span class="nb">fork</span> <span class="k">do</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"[</span><span class="si">#{</span><span class="no">Process</span><span class="p">.</span><span class="nf">pid</span><span class="si">}</span><span class="s2">] End fork."</span>
<span class="k">end</span>
<span class="kp">loop</span> <span class="k">do</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="k">end</span>
</code></pre>
<a name="Expectation-and-result"></a>
<h3 >Expectation and result<a href="#Expectation-and-result" class="wiki-anchor">¶</a></h3>
<p>The application prints “Ractor” each second in the main process, but not in the fork.</p>
<p>Expected the Ractor (defined as <code>r2</code>) to run in the fork.</p>
<pre><code>[29] Ractor
[29] Ractor
[29] Forking...
[29] Ractor
[29] Ractor
[29] Ractor
[29] Ractor
[29] Ractor
[32] End fork.
[29] Ractor
[29] Ractor
[29] Ractor
</code></pre>
<a name="Additional-notes"></a>
<h3 >Additional notes<a href="#Additional-notes" class="wiki-anchor">¶</a></h3>
<p>Threads do not restart across forks either, so it might not be unreasonable to expect consistent behavior. However, it’s possible to detect a dead Thread and recreate it after a fork (e.g. with <code>#alive?</code>, <code>#status</code>), but there’s no such mechanism for Ractors.</p>
<a name="Suggested-solutions"></a>
<h3 >Suggested solutions<a href="#Suggested-solutions" class="wiki-anchor">¶</a></h3>
<ol>
<li>Auto-restart Ractors after fork</li>
<li>Add additional methods to Ractors that allow users to check & manage the status of the Ractor, similar to Thread.</li>
</ol> Ruby master - Bug #17677 (Assigned): Ractor crashes fork when blockinghttps://redmine.ruby-lang.org/issues/176772021-03-08T16:19:22Zdelner (David Elner)
<a name="Background"></a>
<h2 >Background<a href="#Background" class="wiki-anchor">¶</a></h2>
<p>If you create a Ractor which blocks (e.g. <code>receive</code>), then fork the process, the fork will segfault upon completion.</p>
<a name="How-to-reproduce"></a>
<h2 >How to reproduce<a href="#How-to-reproduce" class="wiki-anchor">¶</a></h2>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r2</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">receive</span>
<span class="k">end</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"Forking..."</span>
<span class="nb">fork</span> <span class="k">do</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="nb">puts</span> <span class="s2">"End fork."</span>
<span class="k">end</span>
<span class="kp">loop</span> <span class="k">do</span>
<span class="nb">puts</span> <span class="s2">"Main thread."</span>
<span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="k">end</span>
</code></pre>
<a name="Expectation-and-result"></a>
<h2 >Expectation and result<a href="#Expectation-and-result" class="wiki-anchor">¶</a></h2>
<p>Application prints “Main thread” from main process every second, while fork prints “End fork.” then produces a segfault. Main process continues to run.</p>
<p>Expected fork to not raise a segfault.</p>
<pre><code><internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
Forking...
Main thread.
Main thread.
End fork.
app/sandbox.rb:80: [BUG]: Device or resource busy (EBUSY)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0011 e:000010 CFUNC :fork
c:0002 p:0048 s:0007 E:001b48 EVAL app/sandbox.rb:80 [FINISH]
c:0001 p:0000 s:0003 E:002590 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
app/sandbox.rb:80:in `<main>'
app/sandbox.rb:80:in `fork'
-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.3.0(rb_print_backtrace+0x11) [0x7f9848528cfb] vm_dump.c:758
/usr/local/lib/libruby.so.3.0(rb_vm_bugreport) vm_dump.c:998
/usr/local/lib/libruby.so.3.0(bug_report_end+0x0) [0x7f9848354808] error.c:763
/usr/local/lib/libruby.so.3.0(rb_bug_without_die) error.c:763
/usr/local/lib/libruby.so.3.0(die+0x0) [0x7f98482c6902] error.c:771
/usr/local/lib/libruby.so.3.0(rb_bug) error.c:773
/usr/local/lib/libruby.so.3.0(rb_bug_errno+0x3c) [0x7f9848354a1c] error.c:802
/usr/local/lib/libruby.so.3.0(rb_native_mutex_destroy+0x20) [0x7f98484ce380] thread_pthread.c:444
/usr/local/lib/libruby.so.3.0(rb_native_cond_initialize) (null):0
/usr/local/lib/libruby.so.3.0(ractor_free+0xd) [0x7f984844487d] ractor.c:229
/usr/local/lib/libruby.so.3.0(run_final+0xb) [0x7f9848371c66] gc.c:3670
/usr/local/lib/libruby.so.3.0(finalize_list) gc.c:3689
/usr/local/lib/libruby.so.3.0(rb_objspace_call_finalizer+0x33d) [0x7f984837cc5d] gc.c:3852
/usr/local/lib/libruby.so.3.0(rb_ec_cleanup+0x311) [0x7f984835f0b1] eval.c:184
/usr/local/lib/libruby.so.3.0(ruby_stop+0x9) [0x7f984835f339] eval.c:329
/usr/local/lib/libruby.so.3.0(rb_f_fork+0x1f) [0x7f98484402f8] process.c:4348
/usr/local/lib/libruby.so.3.0(rb_f_fork) process.c:4338
/usr/local/lib/libruby.so.3.0(vm_call_cfunc_with_frame+0x11b) [0x7f984850672b] vm_insnhelper.c:2898
/usr/local/lib/libruby.so.3.0(vm_call_method_each_type+0xf9) [0x7f98485192c9] vm_insnhelper.c:3388
/usr/local/lib/libruby.so.3.0(vm_call_method+0xb4) [0x7f9848519b24] vm_insnhelper.c:3506
/usr/local/lib/libruby.so.3.0(vm_sendish+0xb3) [0x7f984850a3d3] vm_insnhelper.c:4499
/usr/local/lib/libruby.so.3.0(vm_exec_core+0x140) [0x7f98485123e0] insns.def:770
/usr/local/lib/libruby.so.3.0(rb_vm_exec+0x176) [0x7f9848517b26] vm.c:2163
/usr/local/lib/libruby.so.3.0(rb_ec_exec_node+0xd9) [0x7f9848359719] eval.c:317
/usr/local/lib/libruby.so.3.0(ruby_run_node+0x55) [0x7f984835f395] eval.c:375
/usr/local/bin/ruby(main+0x5b) [0x565147e5410b] ./main.c:50
...
Main thread.
Main thread.
Main thread.
</code></pre>
<a name="Additional-notes"></a>
<h2 >Additional notes<a href="#Additional-notes" class="wiki-anchor">¶</a></h2>
<p>This does not happen if a blocking operation does not occur in the Ractor. E.g.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">r2</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="kp">loop</span> <span class="p">{</span> <span class="nb">puts</span> <span class="s2">"[</span><span class="si">#{</span><span class="no">Process</span><span class="p">.</span><span class="nf">pid</span><span class="si">}</span><span class="s2">] Ractor"</span><span class="p">;</span> <span class="nb">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">}</span>
<span class="k">end</span>
</code></pre>
<p>Segfault can also be prevented by invoking <code>close_incoming</code> prior to forking, although this raises another error internally.</p>
<p>It also does not crash on MacOS 10.15.7: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19].</p>
<a name="Suggested-solutions"></a>
<h2 >Suggested solutions<a href="#Suggested-solutions" class="wiki-anchor">¶</a></h2>
<p>(None)</p> Ruby master - Bug #17624 (Open): Ractor.receive is not thread-safehttps://redmine.ruby-lang.org/issues/176242021-02-13T02:14:53Zdazuma (Daniel Azuma)dazuma@gmail.com
<p>It does not seem to be possible to have multiple blocked <code>Ractor.receive</code> calls concurrently in the same Ractor (but different threads). One may succeed but the others will hang indefinitely, even if messages are present in the queue.</p>
<p>Example code below. It does the following:</p>
<ol>
<li>Starts a Ractor <code>r1</code> that spawns two "listener threads". Each thread calls <code>Ractor.receive</code>, which blocks waiting for messages.</li>
<li>The main Ractor pauses briefly to ensure that the threads have started, and then sends two messages to the Ractor <code>r1</code>, with the expectation that each thread will receive one of them.</li>
<li>What actually happens is, the <code>Ractor.receive</code> call in <em>one</em> of the threads will pick a message and return. However, the <code>Ractor.receive</code> call in the other thread remains blocked, even though the second message is in the queue.</li>
<li>Ractor <code>r1</code>, after a pause to ensure that both messages have been sent, issues another <code>Ractor.receive</code> call. This call does not block (because the second message is in the queue), and successfully returns the message. Meanwhile, the second thread's <code>Ractor.receive</code> call remains blocked. This demonstrates that the second message has been sent successfully and is receivable, even though the second thread still hasn't returned it. It appears that the second thread's receive call is in a bad state.</li>
</ol>
<pre><code>r1 = Ractor.new do
# Start two listener threads
t1 = Thread.new do
puts "T1 received #{Ractor.receive}"
end
t2 = Thread.new do
puts "T2 received #{Ractor.receive}"
end
# Pause to ensure that both messages have been sent.
# (One of the messages will have been picked up by a
# thread, but the other remains in the queue.)
sleep(3)
# Receive the second message. This will succeed, even
# though the second thread is still blocked.
puts "Later received #{Ractor.receive}"
# Wait for the threads to finish.
# This will never complete because one of the threads will not
# receive the second message, and is still blocking.
[t1, t2].each(&:join)
:ok
end
# Make sure both receive calls are blocking
sleep(1)
# Send two messages.
r1.send(1)
r1.send(2)
# This never returns because the ractor never completes.
puts r1.take
</code></pre>
<p>This happens both in 3.0.0 release and on 3.1.0 head.</p>
<pre><code>% ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
</code></pre>
<pre><code>% ruby -v
ruby 3.1.0dev (2021-02-09T13:22:37Z master e7a831de8e) [x86_64-darwin20]
</code></pre>
<p>Notes:</p>
<ul>
<li>This also happens when using <code>receive_if</code>.</li>
<li>I would expect this use case to be common when writing a Ractor that contains multiple thread-safe "workers". (This was in fact the use case I was trying to implement when I encountered this issue.) Thus, if we decide this is working as intended, we should document it, and possibly suggest to users that they write their Ractor to funnel communication through a single dedicated thread.</li>
</ul> Ruby master - Bug #17617 (Open): When a Ractor's incoming port is closed, Ractor.receive_if does ...https://redmine.ruby-lang.org/issues/176172021-02-09T16:24:27Zdazuma (Daniel Azuma)dazuma@gmail.com
<p>If Ractor#close_incoming is called on a Ractor, any pending Ractor.receive call will raise Ractor::ClosedError. However, any pending Ractor.receive_if call will not; instead, it never returns.</p>
<pre><code>r1 = Ractor.new do
Ractor.receive
rescue => e
e
end
r1.close_incoming
result = r1.take
puts "**** taken: #{result}" # displays the Ractor::ClosedError
r2 = Ractor.new do
Ractor.receive_if { true }
puts "**** never reaches here"
rescue => e
puts "**** never reaches here"
e
end
r2.close_incoming
puts "**** hangs here..."
r2.take
puts "**** never reaches here"
</code></pre>
<p>This was tested against both 3.0.0 and 3.1.0 head, with the same result.</p>
<pre><code>% ruby -v
ruby 3.1.0dev (2021-02-09T13:22:37Z master e7a831de8e) [x86_64-darwin20]
</code></pre>
<pre><code>% ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20
</code></pre>
<p>I have also tried including sleep statements to force the Ractor.receive_if to execute both before and after the Ractor#close_incoming call. The result is the same either way. receive_if hangs regardless of whether the incoming port is already closed when receive_if is invoked, or whether the port is closed while the receive_if is already blocking.</p> Ruby master - Bug #17578 (Assigned): mkmf experimental C++ Supporthttps://redmine.ruby-lang.org/issues/175782021-01-25T06:26:31Zcfis (Charlie Savage)
<p>I've been working on the Rice gem (<a href="https://github.com/jasonroelofs/rice" class="external">https://github.com/jasonroelofs/rice</a>) that wraps C++ code for use in Ruby.</p>
<p>I noticed that some c++ support was added to mkmf for Ruby 2.7. However, if I try to use it find a header it fails to work. For example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">find_header</span><span class="p">(</span><span class="s1">'rice.hpp'</span><span class="p">)</span>
</code></pre>
<p>The reason is the conftest uses gcc -E instead of g++ -E. To fix that requires overlading the cpp_command to support C++.</p>
<p>This the fix I have put in that works:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">MakeMakefile</span><span class="p">[</span><span class="s1">'C++'</span><span class="p">].</span><span class="nf">module_eval</span> <span class="k">do</span>
<span class="k">def</span> <span class="nf">cpp_command</span><span class="p">(</span><span class="n">outfile</span><span class="p">,</span> <span class="n">opt</span><span class="o">=</span><span class="s2">""</span><span class="p">)</span>
<span class="n">conf</span> <span class="o">=</span> <span class="n">cc_config</span><span class="p">(</span><span class="n">opt</span><span class="p">)</span>
<span class="k">if</span> <span class="vg">$universal</span> <span class="ow">and</span> <span class="p">(</span><span class="n">arch_flag</span> <span class="o">=</span> <span class="n">conf</span><span class="p">[</span><span class="s1">'ARCH_FLAG'</span><span class="p">])</span> <span class="ow">and</span> <span class="o">!</span><span class="n">arch_flag</span><span class="p">.</span><span class="nf">empty?</span>
<span class="n">conf</span><span class="p">[</span><span class="s1">'ARCH_FLAG'</span><span class="p">]</span> <span class="o">=</span> <span class="n">arch_flag</span><span class="p">.</span><span class="nf">gsub</span><span class="p">(</span><span class="sr">/(?:\G|\s)-arch\s+\S+/</span><span class="p">,</span> <span class="s1">''</span><span class="p">)</span>
<span class="k">end</span>
<span class="no">RbConfig</span><span class="o">::</span><span class="n">expand</span><span class="p">(</span><span class="s2">"$(CXX) -E </span><span class="si">#$INCFLAGS</span><span class="s2"> </span><span class="si">#$CPPFLAGS</span><span class="s2"> </span><span class="si">#$CFLAGS</span><span class="s2"> </span><span class="si">#{</span><span class="n">opt</span><span class="si">}</span><span class="s2"> </span><span class="si">#{</span><span class="no">CONFTEST_CXX</span><span class="si">}</span><span class="s2"> </span><span class="si">#{</span><span class="n">outfile</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span>
<span class="n">conf</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">end</span>
</code></pre>
<p>The two changes over the default method are:</p>
<p>$(CC) -> $(CXX) -E<br>
#{CONFTEST_c} -> #{CONFTEST_cxx}</p>
<p>Could this change be merged in? I can provide a patch file if you would like.</p>
<p>Last, it wasn't obvious to me how to activate the C++ support in mkfm. I ended up doing this:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="kp">include</span> <span class="no">MakeMakefile</span><span class="p">[</span><span class="s1">'C++'</span><span class="p">]</span>
</code></pre>
<p>Is that correct?</p> Ruby master - Bug #17516 (Assigned): forking in a ractor causes Ruby to crashhttps://redmine.ruby-lang.org/issues/175162021-01-06T10:56:50Zpkmuldoon (Phil Muldoon)
<p>I just want to point out, there's absolutely no reason to do this, but</p>
<p>r = Ractor.new do<br>
Process.fork()<br>
end</p>
<p>Will cause:</p>
<p><a href="internal:ractor" class="external">internal:ractor</a>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.<br>
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)<br>
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]</p>
<p>-- Crash Report log information --------------------------------------------<br>
See Crash Report log file under the one of following:<br>
* ~/Library/Logs/DiagnosticReports<br>
* /Library/Logs/DiagnosticReports<br>
for more details.<br>
Don't forget to include the above Crash Report log file in bug reports.</p>
<p>-- Control frame information -----------------------------------------------<br>
c:0001 p:---- s:0003 e:000002 (none) [FINISH]</p>
<p>-- C level backtrace information -------------------------------------------<br>
=> #<Ractor:#3 (pry):5 terminated><br>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]<br>
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]<br>
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]</p> Ruby master - Bug #17420 (Open): Unsafe mutation of $" when doing non-RubyGems require in Ractorhttps://redmine.ruby-lang.org/issues/174202020-12-21T18:31:49ZEregon (Benoit Daloze)
<p>With an empty file <code>a.rb</code>:</p>
<pre><code>$ ruby --disable-gems -e 'Ractor.new { puts $" }.take'
-e:1:in `block in <main>': can not access global variables $" from non-main Ractors (RuntimeError)
</code></pre>
<p>That is expected, given the rules for global variables.</p>
<pre><code>ruby --disable-gems -e 'Ractor.new { require "./a.rb"; }.take; p $"'
[... , "/home/eregon/a.rb"]
</code></pre>
<p>Is it OK that the Ractor can do <code>require</code>, which does modify <code>$"</code>?</p>
<p>I think it's not, and it might lead to segfaults if e.g. the main Ractor mutates <code>$"</code> in parallel to some other Ractor doing <code>require</code>.</p>
<p>Probably <code>require</code> needs to be forbidden in non-main Ractors (it does mutate <code>$"</code>, so it's logical), or there needs to be always VM-global synchronization on any access to <code>$"</code> (otherwise, segfaults are possible).<br>
The latter doesn't seem reasonable, especially when considering the user might do <code>$".each { ... }</code>.</p>
<hr>
<p>Note that RubyGems' <code>require</code> does not work on non-main Ractors (pretty much expected given it depends on a lot of global state):</p>
<pre><code>$ ruby -e 'Ractor.new { require "./a.rb"; }.take'
<internal:/home/eregon/prefix/ruby-master/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (NameError)
</code></pre>
<p>This probably also has consequences for <code>autoload</code>.<br>
Maybe the <code>zeitwerk</code> gem can help with the mode to resolve all autoload at once.</p> Ruby master - Bug #17400 (Open): Incorrect character downcase for Greek Sigmahttps://redmine.ruby-lang.org/issues/174002020-12-16T23:47:34Zxfalcox (Rafael Silva)xfalcox@gmail.com
<p>An issue caused by this bug was first reported at Discourse support community at <a href="https://meta.discourse.org/t/unicode-username-results-in-error-loading-profile-page/173182?u=falco" class="external">https://meta.discourse.org/t/unicode-username-results-in-error-loading-profile-page/173182?u=falco</a>.</p>
<p>The issue is that in Greek, there are two ways to downcase the letter ‘Σ’</p>
<ul>
<li>‘ς’ when it is used at the end of a word</li>
<li>‘σ’ anywhere else</li>
</ul>
<p>NodeJS follows this rule:</p>
<pre><code>➜ node
Welcome to Node.js v12.11.1.
Type ".help" for more information.
> "ΣΠΥΡΟΣ".toLowerCase()
'σπυρος'
</code></pre>
<p>Python too:</p>
<pre><code>➜ python
Python 3.8.2 (default, Nov 23 2020, 16:33:30)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> "ΣΠΥΡΟΣ".lower()
'σπυρος'
</code></pre>
<p>Ruby (both 2.7 and 3) doesn't:</p>
<pre><code>➜ ruby --version
ruby 3.0.0dev (2020-12-16T18:46:44Z master 93ba3ac036) [x86_64-linux]
➜ irb
irb(main):001:0> "ΣΠΥΡΟΣ".downcase
=> "σπυροσ"
</code></pre>
<pre><code>➜ ruby --version
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
➜ irb
irb(main):001:0> "ΣΠΥΡΟΣ".downcase
=> "σπυροσ"
</code></pre> Ruby master - Bug #17359 (Open): Ractor copy mode is not Ractor-safehttps://redmine.ruby-lang.org/issues/173592020-12-01T08:29:37Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<p>It should not be possible to mutate an object across Ractors, but the copy mode allows it currently:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">Foo</span>
<span class="nb">attr_accessor</span> <span class="ss">:x</span>
<span class="k">def</span> <span class="nf">initialize_copy</span><span class="p">(</span><span class="o">*</span><span class="p">)</span>
<span class="vg">$last</span> <span class="o">=</span> <span class="nb">self</span>
<span class="k">super</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">o</span> <span class="o">=</span> <span class="no">Foo</span><span class="p">.</span><span class="nf">new</span>
<span class="n">o</span><span class="p">.</span><span class="nf">x</span> <span class="o">=</span> <span class="mi">42</span>
<span class="n">r</span> <span class="o">=</span> <span class="no">Ractor</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">o</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">copy</span><span class="o">|</span>
<span class="nb">puts</span> <span class="n">copy</span><span class="p">.</span><span class="nf">x</span> <span class="c1"># => 42</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">yield</span> <span class="ss">:sync</span>
<span class="no">Ractor</span><span class="p">.</span><span class="nf">yield</span> <span class="ss">:sync</span>
<span class="nb">puts</span> <span class="n">copy</span><span class="p">.</span><span class="nf">x</span> <span class="c1"># => 666</span>
<span class="k">end</span>
<span class="n">r</span><span class="p">.</span><span class="nf">take</span> <span class="c1"># => :sync</span>
<span class="vg">$last</span><span class="p">.</span><span class="nf">x</span> <span class="o">=</span> <span class="mi">666</span>
<span class="n">r</span><span class="p">.</span><span class="nf">take</span> <span class="c1"># => :sync</span>
<span class="n">r</span><span class="p">.</span><span class="nf">take</span>
</code></pre>
<p>Maybe the <code>copy</code> object should be marked as moved?</p> Ruby master - Bug #16819 (Assigned): Line reporting off by one when reporting line of a hash?https://redmine.ruby-lang.org/issues/168192020-04-27T18:18:58Zenebo (Thomas Enebo)tom.enebo@gmail.com
<p>If I run this program:</p>
<pre><code>TracePoint.new(:line) { |t| p t.lineno}.enable
def foo(a, b) # 2
a + b # 3
end # 4
# 5
foo 1, 2 # 6
# 7
A = { # 8
a: 1, # 9
b: 2 # 10
} # 11
</code></pre>
<p>I see:</p>
<pre><code>system ~/work/jruby no_sourceposition * 2388% mri26 ../snippets/ast1.rb
2
6
3
9
</code></pre>
<p>I believe this 9 should be an 8 (it is what we currently emit for JRuby). I tried to figure out why this is the case and I patched RubyVM::AbstractSyntaxTree with the ability to note newline flag:</p>
<pre><code>diff --git a/ast.c b/ast.c
index f0e8dd2eaf..df58006a96 100644
--- a/ast.c
+++ b/ast.c
@@ -7,6 +7,8 @@
#include "vm_core.h"
#include "iseq.h"
+#define RBOOL(v) ((v) ? Qtrue : Qfalse)
+
static VALUE rb_mAST;
static VALUE rb_cNode;
@@ -731,6 +733,16 @@ rb_ast_node_inspect(VALUE self)
return str;
}
+static VALUE
+rb_ast_node_newline(VALUE self)
+{
+ struct ASTNodeData *data;
+ TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
+
+ return RBOOL(data->node->flags & NODE_FL_NEWLINE);
+}
+
+
void
Init_ast(void)
{
@@ -756,5 +768,6 @@ Init_ast(void)
rb_define_method(rb_cNode, "last_lineno", rb_ast_node_last_lineno, 0);
rb_define_method(rb_cNode, "last_column", rb_ast_node_last_column, 0);
rb_define_method(rb_cNode, "children", rb_ast_node_children, 0);
+ rb_define_method(rb_cNode, "newline?", rb_ast_node_newline, 0);
rb_define_method(rb_cNode, "inspect", rb_ast_node_inspect, 0);
}
</code></pre>
<p>I also made a simple script:</p>
<pre><code>source = File.read ARGV.shift
root = RubyVM::AbstractSyntaxTree.parse source
def print_node(node, indent = "")
if node.respond_to? :first_lineno
eol = node.newline? ? " <-- newline" : ""
$stdout.write "#{indent}(#{node.type}@#{node.first_lineno-1}-#{node.last_lineno-1})"
case node.type
when :LIT, :STR
puts " = #{node.children[0].inspect}#{eol}"
when :ARRAY
puts eol
node.children[0..-2].each do |child|
print_node(child, indent + " ")
end
when :FCALL
puts " = #{node.children[0]}#{eol}"
node.children[1..-1].each do |child|
print_node(child, indent + " ")
end
else
puts eol
node.children.each do |child|
print_node(child, indent + " ")
end
end
elsif node.nil?
puts "#{indent}nil"
else
puts "#{indent}#{node.inspect}"
end
end
print_node root
puts RubyVM::InstructionSequence.compile(source).disasm
</code></pre>
<p>If I run this I see MRI has line 8 marked as the newline (which JRuby also matches) but if we look at the disasm it would appear compile.c decided to put the line in a different location:</p>
<pre><code>../ruby/ruby --disable-gems ../snippets/ast_mri.rb ../snippets/ast1.rb
(SCOPE@0-10)
[]
nil
(BLOCK@0-10)
(CALL@0-0) <-- newline
(ITER@0-0)
(CALL@0-0)
(CONST@0-0)
:TracePoint
:new
(ARRAY@0-0)
(LIT@0-0) = :line
(SCOPE@0-0)
[:t]
(ARGS@0-0)
1
nil
nil
nil
0
nil
nil
nil
nil
nil
(FCALL@0-0) = p <-- newline
(ARRAY@0-0)
(CALL@0-0)
(DVAR@0-0)
:t
:lineno
nil
:enable
nil
(DEFN@1-3) <-- newline
:foo
(SCOPE@1-3)
[:a, :b]
(ARGS@1-1)
2
nil
nil
nil
0
nil
nil
nil
nil
nil
(OPCALL@2-2) <-- newline
(LVAR@2-2)
:a
:+
(ARRAY@2-2)
(LVAR@2-2)
:b
(FCALL@5-5) = foo <-- newline
(ARRAY@5-5)
(LIT@5-5) = 1
(LIT@5-5) = 2
(CDECL@7-10) <-- newline
:A
(HASH@7-10)
(ARRAY@8-9)
(LIT@8-8) = :a
(LIT@8-8) = 1
(LIT@9-9) = :b
(LIT@9-9) = 2
== disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(11,18)> (catch: FALSE)
== catch table
| catch type: break st: 0000 ed: 0013 sp: 0000 cont: 0013
| == disasm: #<ISeq:block in <compiled>@<compiled>:1 (1,22)-(1,39)> (catch: FALSE)
| == catch table
| | catch type: redo st: 0001 ed: 0010 sp: 0000 cont: 0001
| | catch type: next st: 0001 ed: 0010 sp: 0000 cont: 0010
| |------------------------------------------------------------------------
| local table (size: 1, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
| [ 1] t@0<Arg>
| 0000 nop ( 1)[Bc]
| 0001 putself [Li]
| 0002 getlocal_WC_0 t@0
| 0004 opt_send_without_block <callinfo!mid:lineno, argc:0, ARGS_SIMPLE>, <callcache>
| 0007 opt_send_without_block <callinfo!mid:p, argc:1, FCALL|ARGS_SIMPLE>, <callcache>
| 0010 nop
| 0011 leave ( 1)[Br]
|------------------------------------------------------------------------
0000 opt_getinlinecache 7, <is:0> ( 1)[Li]
0003 getconstant :TracePoint
0005 opt_setinlinecache <is:0>
0007 putobject :line
0009 send <callinfo!mid:new, argc:1>, <callcache>, block in <compiled>
0013 nop
0014 opt_send_without_block <callinfo!mid:enable, argc:0, ARGS_SIMPLE>, <callcache>( 1)
0017 pop
0018 putspecialobject 1 ( 2)[Li]
0020 putobject :foo
0022 putiseq foo
0024 opt_send_without_block <callinfo!mid:core#define_method, argc:2, ARGS_SIMPLE>, <callcache>
0027 pop
0028 putself ( 6)[Li]
0029 putobject_INT2FIX_1_
0030 putobject 2
0032 opt_send_without_block <callinfo!mid:foo, argc:2, FCALL|ARGS_SIMPLE>, <callcache>
0035 pop
0036 duphash {:a=>1, :b=>2} ( 9)[Li]
0038 dup ( 8)
0039 putspecialobject 3
0041 setconstant :A
0043 leave
== disasm: #<ISeq:foo@<compiled>:2 (2,0)-(4,3)> (catch: FALSE)
local table (size: 2, argc: 2 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 2] a@0<Arg> [ 1] b@1<Arg>
0000 getlocal_WC_0 a@0 ( 3)[LiCa]
0002 getlocal_WC_0 b@1
0004 opt_plus <callinfo!mid:+, argc:1, ARGS_SIMPLE>, <callcache>
0007 leave ( 4)[Re]
</code></pre> Ruby master - Bug #16776 (Assigned): Regression in coverage libraryhttps://redmine.ruby-lang.org/issues/167762020-04-10T16:39:29Zdeivid (David Rodríguez)
<p>Hi!</p>
<p>I noticed a regression in the coverage library. I tried to write a minimal program to show it, hopefully it gives some clues or where the issue might lie.</p>
<p>In ruby 2.5.8 and earlier, the following program would print <code>{:lines=>[1, 1, nil]}</code>, showing that the body of the "foo" method was run once. However, on newer rubies, it prints <code>{:lines=>[1, 0, nil]}</code>, which is incorrect because the "foo" method body has actually been run once.</p>
<p>This is the repro script:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1"># frozen_string_literal: true</span>
<span class="nb">require</span> <span class="s2">"coverage"</span>
<span class="no">Coverage</span><span class="p">.</span><span class="nf">start</span><span class="p">(</span><span class="ss">lines: </span><span class="kp">true</span><span class="p">)</span>
<span class="n">code</span> <span class="o">=</span> <span class="o"><<~</span><span class="no">RUBY</span><span class="sh">
def foo
"LOL"
end
</span><span class="no">RUBY</span>
<span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s2">"foo.rb"</span><span class="p">,</span> <span class="s2">"w"</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="p">.</span><span class="nf">write</span><span class="p">(</span><span class="n">code</span><span class="p">)</span> <span class="p">}</span>
<span class="nb">require_relative</span> <span class="s2">"foo"</span>
<span class="no">TracePoint</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="ss">:line</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">_tp</span><span class="o">|</span>
<span class="n">foo</span>
<span class="k">end</span><span class="p">.</span><span class="nf">enable</span> <span class="k">do</span>
<span class="nb">sleep</span> <span class="mi">0</span>
<span class="k">end</span>
<span class="n">res</span> <span class="o">=</span> <span class="no">Coverage</span><span class="p">.</span><span class="nf">result</span>
<span class="nb">puts</span> <span class="n">res</span><span class="p">[</span><span class="no">File</span><span class="p">.</span><span class="nf">expand_path</span><span class="p">(</span><span class="s2">"foo.rb"</span><span class="p">)]</span>
</code></pre> Ruby master - Bug #16497 (Assigned): StringIO#internal_encoding is broken (more severely in 2.7)https://redmine.ruby-lang.org/issues/164972020-01-10T11:18:31Zzverok (Victor Shepelev)zverok.offline@gmail.com
<p>To the best of my understanding from <a href="https://docs.ruby-lang.org/en/master/Encoding.html" class="external">Encoding</a> docs, the following is true:</p>
<ul>
<li>external encoding (explicitly specified or taken from <code>Encoding.default_external</code>) specifies how the IO understands input and stores it internally</li>
<li>internal encoding (explicitly specified or taken from <code>Encoding.default_internal</code>) specifies how the IO converts what it reads.</li>
</ul>
<p>Demonstration with regular files:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="c1"># prepare data</span>
<span class="no">File</span><span class="p">.</span><span class="nf">write</span><span class="p">(</span><span class="s1">'test.txt'</span><span class="p">,</span> <span class="s1">'Україна'</span><span class="p">.</span><span class="nf">encode</span><span class="p">(</span><span class="s1">'KOI8-U'</span><span class="p">),</span> <span class="ss">encoding: </span><span class="s1">'KOI8-U'</span><span class="p">)</span> <span class="c1">#=> 7</span>
<span class="k">def</span> <span class="nf">test</span><span class="p">(</span><span class="n">io</span><span class="p">)</span>
<span class="n">str</span> <span class="o">=</span> <span class="n">io</span><span class="p">.</span><span class="nf">read</span>
<span class="p">[</span><span class="n">io</span><span class="p">.</span><span class="nf">external_encoding</span><span class="p">,</span> <span class="n">io</span><span class="p">.</span><span class="nf">internal_encoding</span><span class="p">,</span> <span class="n">str</span><span class="p">,</span> <span class="n">str</span><span class="p">.</span><span class="nf">encoding</span><span class="p">]</span>
<span class="k">end</span>
<span class="c1"># read it:</span>
<span class="nb">test</span><span class="p">(</span><span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s1">'test.txt'</span><span class="p">,</span> <span class="s1">'r:KOI8-U'</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
<span class="c1"># We can specify internal encoding when opening the file:</span>
<span class="nb">test</span><span class="p">(</span><span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s1">'test.txt'</span><span class="p">,</span> <span class="s1">'r:KOI8-U:UTF-8'</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, #<Encoding:UTF-8>, "Україна", #<Encoding:UTF-8>]</span>
<span class="c1"># ...or when it is already opened</span>
<span class="nb">test</span><span class="p">(</span><span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s1">'test.txt'</span><span class="p">).</span><span class="nf">tap</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="p">.</span><span class="nf">set_encoding</span><span class="p">(</span><span class="s1">'KOI8-U'</span><span class="p">,</span> <span class="s1">'UTF-8'</span><span class="p">)</span> <span class="p">})</span>
<span class="c1"># => [#<Encoding:KOI8-U>, #<Encoding:UTF-8>, "Україна", #<Encoding:UTF-8>]</span>
<span class="c1"># ...or with Encoding.default_internal</span>
<span class="no">Encoding</span><span class="p">.</span><span class="nf">default_internal</span> <span class="o">=</span> <span class="s1">'UTF-8'</span>
<span class="nb">test</span><span class="p">(</span><span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s1">'test.txt'</span><span class="p">,</span> <span class="s1">'r:KOI8-U'</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, #<Encoding:UTF-8>, "Україна", #<Encoding:UTF-8>]</span>
</code></pre>
<p>But with StringIO, <strong>internal encoding can't be set</strong> in Ruby <strong>2.6</strong>:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s1">'stringio'</span>
<span class="no">Encoding</span><span class="p">.</span><span class="nf">default_internal</span> <span class="o">=</span> <span class="kp">nil</span>
<span class="n">str</span> <span class="o">=</span> <span class="s1">'Україна'</span><span class="p">.</span><span class="nf">encode</span><span class="p">(</span><span class="s1">'KOI8-U'</span><span class="p">)</span>
<span class="c1"># Simplest form:</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
<span class="c1"># Try to set via mode</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="s1">'r:KOI8-U:UTF-8'</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
<span class="c1"># Try to set via set_encoding:</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="s1">'r:KOI8-U:UTF-8'</span><span class="p">).</span><span class="nf">tap</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="p">.</span><span class="nf">set_encoding</span><span class="p">(</span><span class="s1">'KOI8-U'</span><span class="p">,</span> <span class="s1">'UTF-8'</span><span class="p">)</span> <span class="p">})</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
<span class="c1"># Try to set via Enoding.default_internal:</span>
<span class="no">Encoding</span><span class="p">.</span><span class="nf">default_internal</span> <span class="o">=</span> <span class="s1">'UTF-8'</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
</code></pre>
<p>So, in 2.6, any attempt to do something with StringIO's internal encoding are <strong>just ignored</strong>.</p>
<p>In <strong>2.7</strong>, though, matters became much worse:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s1">'stringio'</span>
<span class="no">Encoding</span><span class="p">.</span><span class="nf">default_internal</span> <span class="o">=</span> <span class="kp">nil</span>
<span class="n">str</span> <span class="o">=</span> <span class="s1">'Україна'</span><span class="p">.</span><span class="nf">encode</span><span class="p">(</span><span class="s1">'KOI8-U'</span><span class="p">)</span>
<span class="c1"># Behaves same as 2.6</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
<span class="c1"># Try to set via mode: WEIRD behavior starts</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="s1">'r:KOI8-U:UTF-8'</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:UTF-8>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:UTF-8>]</span>
<span class="c1"># Try to set via set_encoding: still just ignored</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="s1">'r:KOI8-U:UTF-8'</span><span class="p">).</span><span class="nf">tap</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="p">.</span><span class="nf">set_encoding</span><span class="p">(</span><span class="s1">'KOI8-U'</span><span class="p">,</span> <span class="s1">'UTF-8'</span><span class="p">)</span> <span class="p">})</span>
<span class="c1"># => [#<Encoding:KOI8-U>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:KOI8-U>]</span>
<span class="c1"># Try to set via Enoding.default_internal: WEIRD behavior again</span>
<span class="no">Encoding</span><span class="p">.</span><span class="nf">default_internal</span> <span class="o">=</span> <span class="s1">'UTF-8'</span>
<span class="nb">test</span><span class="p">(</span><span class="no">StringIO</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="n">str</span><span class="p">))</span>
<span class="c1"># => [#<Encoding:UTF-8>, nil, "\xF5\xCB\xD2\xC1\xA7\xCE\xC1", #<Encoding:UTF-8>]</span>
</code></pre>
<p>So, <strong>2.7</strong> not just ignores attempts to set <strong>internal</strong> encoding, but erroneously sets it to <strong>external</strong> one, so strings are not recoded, but their encoding is forced to change.</p>
<p>I believe it is severe bug (more severe than 2.6's "just ignoring").</p>
<p><a href="https://www.reddit.com/r/ruby/comments/emd6q4/is_this_a_stringio_bug_in_ruby_270/" class="external">This Reddit thread</a> shows how it breaks existing code:</p>
<ul>
<li>the author uses <code>StringIO</code> to work with <code>ASCII-8BIT</code> strings;</li>
<li>the code is performed in Rails environment (which sets <code>internal_encoding</code> to <code>UTF-8</code> by default);</li>
<li>under <strong>2.7</strong>, <code>StringIO#read</code> returns <code>ASCII-8BIT</code> content in Strings saying their encoding is <code>UTF-8</code>.</li>
</ul> Ruby master - Bug #15764 (Open): Whitespace and control characters should not be permitted in tokenshttps://redmine.ruby-lang.org/issues/157642019-04-11T20:59:47ZBatmanAoD (Kyle Strand)kyle.j.strand@gmail.com
<p>As of Ruby 2.5.1p57, it appears that all valid Unicode code-points above 128 are permitted in tokens. This includes whitespace and control characters.</p>
<p>This was demonstrated here: <a href="https://gist.github.com/qrohlf/7045823" class="external">https://gist.github.com/qrohlf/7045823</a></p>
<p>I have attached the raw download from the above gist.</p>
<p>The issue has been discussed on StackOverflow: <a href="https://stackoverflow.com/q/34455427/1858225" class="external">https://stackoverflow.com/q/34455427/1858225</a></p>
<p>I would say this is arguably a bug, but I am marking this ticket as a "feature" since the current behavior could be considered by-design.</p> Ruby master - Bug #15550 (Assigned): Windows - gem bin files - can't run from bash shellhttps://redmine.ruby-lang.org/issues/155502019-01-20T00:45:45ZMSP-Greg (Greg L)
<p>As I recall, ruby-loco is no longer touching the gem related files located in the bin folder. Previously, there were two files associated with each gem, one with a .cmd/.bat extension, one without.</p>
<p>Currently, there is just one file with a .cmd extension. I have seen this before, and just came across it again, where gems are using *nix scripts run with either the MSYS2 shell or the Git shell in their CI. Hence, there is an expectation for the plain (extensionless) file to exist.</p>
<p>Not sure if this is considered a breaking change or a bug/issue.</p>
<p>Thanks, Greg</p> Ruby master - Bug #15499 (Assigned): Breaking behavior on ruby 2.6: rb_thread_call_without_gvl do...https://redmine.ruby-lang.org/issues/154992019-01-03T01:37:49Zapolcyn (alex polcyn)
<p>This issue was noticed when trying to add ruby 2.6 support to the "grpc" ruby gem (this gem is a native C-extension), and was caught by a unit test.</p>
<p>There are several APIs on the grpc ruby gem (<a href="https://github.com/grpc/grpc/tree/master/src/ruby" class="external">https://github.com/grpc/grpc/tree/master/src/ruby</a>) that invoke "rb_thread_call_without_gvl" on the current thread, doing a blocking operation in the "without gvl" callback and cancel that blocking operation in the "unblocking function". These APIs work in ruby versions prior to ruby 2.6 (e.g. ruby 2.5), but have problems when used on ruby 2.6</p>
<p>Minimal repro:</p>
<p>My system:</p>
<pre><code>> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.6 (stretch)
Release: 9.6
Codename: stretch
> ruby -v
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux
# I installed ruby 2.6.0 with rvm - https://rvm.io/rvm/install
> GRPC_CONFIG=dbg gem install grpc --platform ruby # build grpc gem from source with debug symbols
</code></pre>
<p>ruby script, "repro.rb" that looks like this:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s1">'grpc'</span>
<span class="n">ch</span> <span class="o">=</span> <span class="no">GRPC</span><span class="o">::</span><span class="no">Core</span><span class="o">::</span><span class="no">Channel</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s1">'localhost:1234'</span><span class="p">,</span> <span class="p">{},</span> <span class="ss">:this_channel_is_insecure</span><span class="p">)</span>
<span class="n">ch</span><span class="p">.</span><span class="nf">watch_connectivity_state</span><span class="p">(</span><span class="n">ch</span><span class="p">.</span><span class="nf">connectivity_state</span><span class="p">,</span> <span class="no">Time</span><span class="p">.</span><span class="nf">now</span> <span class="o">+</span> <span class="mi">360</span><span class="p">)</span>
</code></pre>
<p>Run "ruby repro.rb" with an interactive shell, and it will hang there. At this point, ctrl^C the process, and it will not terminate.<br>
What should happen is this unblocking func should be invoked: <a href="https://github.com/grpc/grpc/blob/master/src/ruby/ext/grpc/rb_channel.c#L354" class="external">https://github.com/grpc/grpc/blob/master/src/ruby/ext/grpc/rb_channel.c#L354</a>, but as seen with logging or debuggers, that unblocking func is never ran. Thus the blocking operation never completes and the main thread is stuck.</p>
<p>When the same repro.rb is ran on e.g. ruby 2.5.3 or ruby 2.4.1, the blocking operation is unblocked and the process terminates, as expected, when sending it a SIGINT.</p>
<p>Also note that if the blocking operation is put in a background thread, e.g. with this script:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s1">'grpc'</span>
<span class="n">th</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">ch</span> <span class="o">=</span> <span class="no">GRPC</span><span class="o">::</span><span class="no">Core</span><span class="o">::</span><span class="no">Channel</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s1">'localhost:1234'</span><span class="p">,</span> <span class="p">{},</span> <span class="ss">:this_channel_is_insecure</span><span class="p">)</span>
<span class="n">ch</span><span class="p">.</span><span class="nf">watch_connectivity_state</span><span class="p">(</span><span class="n">ch</span><span class="p">.</span><span class="nf">connectivity_state</span><span class="p">,</span> <span class="no">Time</span><span class="p">.</span><span class="nf">now</span> <span class="o">+</span> <span class="mi">360</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">th</span><span class="p">.</span><span class="nf">join</span>
</code></pre>
<p>then "unblocking" functions will in fact be invoked upon sending the process a SIGINT, so this looks like a problem specifically with rb_thread_call_without_gvl being used on the main thread.</p>
<p>Please let me know and I can provide more details or alternative repro cases.</p>
<p>Thanks in advance.</p> Ruby master - Bug #15334 (Open): child_info_fork::abort: address space needed by 'emoji_iso2022_k...https://redmine.ruby-lang.org/issues/153342018-11-23T08:41:53Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>When testing for upgrade to Unicode 11.0.0, I'm running into the following error:</p>
<pre><code>$$ ./ruby test/runner.rb test/ruby/test_m17n.rb
Run options:
# Running tests:
[124/139] TestM17N#test_utf_16_32_inspect(UTF-16BE) 1 [main] ruby 16076 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
3 [main] ruby 9736 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
2 [main] ruby 1108 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
2 [main] ruby 11476 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
2 [main] ruby 12308 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
3 [main] ruby 14096 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
2 [main] ruby 2392 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
3 [main] ruby 13132 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
2 [main] ruby 14772 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
4 [main] ruby 13780 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
4 [main] ruby 10312 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
3 [main] ruby 14936 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
1 [main] ruby 15944 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
2 [main] ruby 14188 child_info_fork::abort: address space needed by 'emoji_iso2022_kddi.so' (0x40000) is already occupied
Finished tests in 43.540324s, 0.0000 tests/s, 0.0000 assertions/s.
0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Interrupted
</code></pre>
<p>This can go on and on until I interrupt it with Ctrl-C, as done above. The errors happen in the following files:</p>
<pre><code>test/ruby/test_m17n.rb
test/ruby/test_string.rb
test/ruby/test_regexp.rb
</code></pre>
<p>although running just <code>test/ruby/test_string.rb</code> or <code>test/ruby/test_regexp.rb</code> alone works fine, but running <code>test/ruby/test_m17n.rb</code>, even if alone, produces the errors.</p>
<p>The numbers at the start of the error messages are usually very low (as above), but I have seen numbers up to around 27000 also on several occasions but rarely. The file name (<code>emoji_iso2022_kddi.so</code>) and the address (0x40000) are always the same. The numbers after <code>ruby</code> (I guess they are process numbers) vary with each run, as do the numbers at the start.</p>
<p>My current guess is that these errors should not appear if the various <code>.so</code> files are really relocatable, but I'm no expert in linking/loading details.</p>
<p>If there's any other way to run the tests, e.g. with some special option(s) to <code>test/runner.rb</code> or so, I'd appreciate a hint.</p> Ruby master - Bug #15315 (Open): ec_switch can still lose interruptshttps://redmine.ruby-lang.org/issues/153152018-11-18T00:50:29Znormalperson (Eric Wong)normalperson@yhbt.net
<p>ec_switch and thread switching may still lose interrupts</p>
<p>trap interrupt is OK because of r64062</p>
<p>Not OK:</p>
<ol>
<li>
<p>postponed job interrupt from MJIT worker<br>
This is trickiest to solve because it also affects thread switching,<br>
not just EC switching</p>
</li>
<li>
<p>pending interrupt is not safe but fixing ec_switch is sufficient because<br>
rb_threadptr_interrupt only targets threads, not EC.</p>
</li>
<li>
<p>timer interrupt is not critical because another interrupt will fire in 100ms</p>
</li>
</ol>
<p>Solutions:</p>
<p>moving interrupt_flag back to rb_thread_t will solve 2 and 3</p>
<ol>
<li>will remain dangerous, we need to add extra checks at thread switching<br>
because MJIT worker may get stuck if target thread stalls or dies.</li>
</ol> Ruby master - Bug #15263 (Open): [PATCH] vm_trace.c (postponed_job_register): only hit main threadhttps://redmine.ruby-lang.org/issues/152632018-10-27T23:35:33Znormalperson (Eric Wong)normalperson@yhbt.net
<pre><code>vm_trace.c (postponed_job_register): only hit main thread
Since postponed_job_register may be called in a signal handler,
only the main thread is safe to touch as other threads may
become invalid. Furthermore, the problem with trap interrupt
being lost during ec_switch [Bug #14939] also applies to the
postponed job and timer interrupts, so we need to preserve all
three interrupts in ec_switch.
Note: A minor problem is a possible crash during/after
ruby_vm_destruct if postponed jobs are registered.
The correct and performant fix would be to leak memory at exit
for `vm' and `vm->main_thread'. free(3) slows down short-lived
scripts, as does unregistering signal handlers.
* vm_trace.c (postponed_job_register): only hit main thread
* cont.c (ec_switch): preserve postponed and timer interrupt flags, too
</code></pre> Ruby master - Bug #15097 (Open): Gem install fails on Ruby 2.5.1 with Cygwin (get_dns_server_list...https://redmine.ruby-lang.org/issues/150972018-09-10T03:52:01Zcaspercg (Casper G)
<p>Compiled and installed Ruby 2.5.1 on Cygwin, and now gem install fails with:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">ERROR</span><span class="p">:</span> <span class="no">While</span> <span class="n">executing</span> <span class="n">gem</span> <span class="o">...</span> <span class="p">(</span><span class="no">NameError</span><span class="p">)</span>
<span class="n">undefined</span> <span class="n">local</span> <span class="n">variable</span> <span class="ow">or</span> <span class="nb">method</span> <span class="sb">`get_dns_server_list' for Win32::Resolv:Module
</span></code></pre>
<p>While building Ruby I got the following warning:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">win32</span><span class="o">/</span><span class="ss">resolv:
</span><span class="no">Could</span> <span class="ow">not</span> <span class="n">be</span> <span class="n">configured</span><span class="o">.</span> <span class="no">It</span> <span class="n">will</span> <span class="ow">not</span> <span class="n">be</span> <span class="n">installed</span><span class="o">.</span>
<span class="no">Check</span> <span class="n">ext</span><span class="o">/</span><span class="n">win32</span><span class="o">/</span><span class="n">resolv</span><span class="o">/</span><span class="n">mkmf</span><span class="p">.</span><span class="nf">log</span> <span class="k">for</span> <span class="n">more</span> <span class="n">details</span><span class="o">.</span>
</code></pre>
<p>The error in mkmf.log is:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="sr">/ruby-2.5.1/ex</span><span class="n">t</span><span class="o">/</span><span class="n">win32</span><span class="o">/</span><span class="n">resolv</span><span class="o">/</span><span class="n">conftest</span><span class="p">.</span><span class="nf">c</span><span class="p">:</span><span class="mi">14</span><span class="p">:</span> <span class="n">undefined</span> <span class="n">reference</span> <span class="n">to</span> <span class="sb">`GetNetworkParams'
collect2: error: ld returned 1 exit status
</span></code></pre>
<p>The mkmf.log is also attached.</p>
<p>Could not figure out how to fix this problem.<br>
Is 2.5.1 not compatible with Cygwin?</p> Ruby master - Bug #14727 (Assigned): TestQueue#test_queue_with_trap always timeout on Windows10https://redmine.ruby-lang.org/issues/147272018-05-01T02:27:47Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<p>表題の通りです。ささださんも把握しているそうなので、備忘録として。</p>
<pre><code>[19/35] TestQueue#test_queue_with_trap = 10.13 s
1) Error:
TestQueue#test_queue_with_trap:
Timeout::Error: execution of assert_in_out_err expired timeout (10 sec)
pid 11608 exit 0
|
C:/Users/usa/develop/ruby/core/mytree/test/thread/test_queue.rb:553:in `test_queue_with_trap'
</code></pre> Ruby master - Bug #14640 (Open): [win32] File.realpath treats a relative path with a drive letter...https://redmine.ruby-lang.org/issues/146402018-03-28T16:18:34Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<p>When <code>t</code> exists in the current directory under the drive C:,</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">File</span><span class="p">.</span><span class="nf">realpath</span><span class="p">(</span><span class="s2">"c:t"</span><span class="p">)</span> <span class="c1">#=> No such file or directory @ realpath_rec - c:/t (Errno::ENOENT)</span>
</code></pre>
<p>whereas <code>File.expand_path</code> returns <code>Dir.pwd + "/t"</code>.</p> Ruby master - Bug #14090 (Assigned): `TestGc#test_interrupt_in_finalizer` fails very rarelyhttps://redmine.ruby-lang.org/issues/140902017-11-07T07:35:25Zmame (Yusuke Endoh)mame@ruby-lang.org
<p><code>TestGc#test_interrupt_in_finalizer</code> fails very rarely, only once every handred or thousand runs.</p>
<pre><code># Running tests:
[1/1] TestGc#test_interrupt_in_finalizer = 10.13 s
1) Error:
TestGc#test_interrupt_in_finalizer:
Timeout::Error: execution of assert_in_out_err expired
pid 24697 killed by SIGABRT (signal 6) (core dumped)
|
| [BUG] Segmentation fault at 0x000003e800006075
| ruby 2.5.0dev (2017-11-07) [x86_64-linux]
|
| -- Control frame information -----------------------------------------------
|
|
| -- Machine register context ------------------------------------------------
| RIP: 0x00007f80612bb072 RBP: 0x000055c3587e1efc RSP: 0x00007ffc4f8100b0
| RAX: 0xfffffffffffffffc RBX: 0x000055c3587e1ee4 RCX: 0x00007f80612bb072
| RDX: 0x0000000000000000 RDI: 0x000055c3587e1efc RSI: 0x0000000000000080
| R8: 0x00000000000000ca R9: 0x0000000000000000 R10: 0x0000000000000000
| R11: 0x0000000000000246 R12: 0x000055c3587e1ed0 R13: 0x00007ffc4f810110
| R14: 0x000055c3587e1f38 R15: 0x0000000000000003 EFL: 0x0000000000000246
|
| -- C level backtrace information -------------------------------------------
| /home/mame/work/ruby.tmp/ruby(rb_vm_bugreport+0x7d3) [0x55c357e7a333] vm_dump.c:703
| /home/mame/work/ruby.tmp/ruby(rb_bug_context+0xd1) [0x55c357e6de11] error.c:554
| /home/mame/work/ruby.tmp/ruby(sigsegv+0x42) [0x55c357d5e602] signal.c:928
| /lib/x86_64-linux-gnu/libpthread.so.0 [0x7f80612c0150]
| /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x152) [0x7f80612bb072]
| /home/mame/work/ruby.tmp/ruby(native_sleep.constprop.79+0x1de) [0x55c357d967fe] thread_pthread.c:340
| /home/mame/work/ruby.tmp/ruby(rb_thread_terminate_all+0x1e0) [0x55c357d9aba0] thread.c:507
| /home/mame/work/ruby.tmp/ruby(ruby_cleanup+0x17e) [0x55c357c6078e] eval.c:188
| /home/mame/work/ruby.tmp/ruby(ruby_run_node+0x36) [0x55c357c60aa6] eval.c:302
| /home/mame/work/ruby.tmp/ruby(main+0x5f) [0x55c357c5ca1f] encoding.c:164
|
| -- Other runtime information -----------------------------------------------
|
| * Loaded script: -e
|
| * Loaded features:
|
| 0 enumerator.so
| 1 thread.rb
| 2 rational.so
| 3 complex.so
| 4 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/encdb.so
| 5 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/trans/transdb.so
| 6 /home/mame/work/ruby.tmp/rbconfig.rb
| 7 /home/mame/work/ruby.tmp/lib/rubygems/compatibility.rb
| 8 /home/mame/work/ruby.tmp/lib/rubygems/defaults.rb
| 9 /home/mame/work/ruby.tmp/lib/rubygems/deprecate.rb
| 10 /home/mame/work/ruby.tmp/lib/rubygems/errors.rb
| 11 /home/mame/work/ruby.tmp/lib/rubygems/version.rb
| 12 /home/mame/work/ruby.tmp/lib/rubygems/requirement.rb
| 13 /home/mame/work/ruby.tmp/lib/rubygems/platform.rb
| 14 /home/mame/work/ruby.tmp/lib/rubygems/basic_specification.rb
| 15 /home/mame/work/ruby.tmp/lib/rubygems/stub_specification.rb
| 16 /home/mame/work/ruby.tmp/lib/rubygems/util/list.rb
| 17 /home/mame/work/ruby.tmp/.ext/x86_64-linux/stringio.so
| 18 /home/mame/work/ruby.tmp/lib/rubygems/specification.rb
| 19 /home/mame/work/ruby.tmp/lib/rubygems/exceptions.rb
| 20 /home/mame/work/ruby.tmp/lib/rubygems/core_ext/kernel_gem.rb
| 21 /home/mame/work/ruby.tmp/lib/monitor.rb
| 22 /home/mame/work/ruby.tmp/lib/rubygems/core_ext/kernel_require.rb
| 23 /home/mame/work/ruby.tmp/lib/rubygems.rb
| 24 /home/mame/work/ruby.tmp/lib/rubygems/dependency.rb
| 25 /home/mame/work/ruby.tmp/lib/rubygems/path_support.rb
|
| * Process memory map:
|
| 55c357c3a000-55c357f55000 r-xp 00000000 fd:01 21892603 /home/mame/work/ruby.tmp/ruby
| 55c358155000-55c35815a000 r--p 0031b000 fd:01 21892603 /home/mame/work/ruby.tmp/ruby
| 55c35815a000-55c35815b000 rw-p 00320000 fd:01 21892603 /home/mame/work/ruby.tmp/ruby
| 55c35815b000-55c35816c000 rw-p 00000000 00:00 0
| 55c3587e1000-55c358b0d000 rw-p 00000000 00:00 0 [heap]
| 7f8058000000-7f8058021000 rw-p 00000000 00:00 0
| 7f8058021000-7f805c000000 ---p 00000000 00:00 0
| 7f805e93f000-7f805eb1e000 r--s 00000000 fd:01 15604574 /lib/x86_64-linux-gnu/libc-2.26.so
| 7f805eb1e000-7f805fb92000 r--s 00000000 fd:01 21892603 /home/mame/work/ruby.tmp/ruby
| 7f805fb92000-7f805fba8000 r-xp 00000000 fd:01 15597591 /lib/x86_64-linux-gnu/libgcc_s.so.1
| 7f805fba8000-7f805fda7000 ---p 00016000 fd:01 15597591 /lib/x86_64-linux-gnu/libgcc_s.so.1
| 7f805fda7000-7f805fda8000 r--p 00015000 fd:01 15597591 /lib/x86_64-linux-gnu/libgcc_s.so.1
| 7f805fda8000-7f805fda9000 rw-p 00016000 fd:01 15597591 /lib/x86_64-linux-gnu/libgcc_s.so.1
| 7f805fda9000-7f805feaa000 rw-p 00000000 00:00 0
| 7f805feaa000-7f805feb3000 r-xp 00000000 fd:01 23333969 /home/mame/work/ruby.tmp/.ext/x86_64-linux/stringio.so
| 7f805feb3000-7f80600b2000 ---p 00009000 fd:01 23333969 /home/mame/work/ruby.tmp/.ext/x86_64-linux/stringio.so
| 7f80600b2000-7f80600b3000 r--p 00008000 fd:01 23333969 /home/mame/work/ruby.tmp/.ext/x86_64-linux/stringio.so
| 7f80600b3000-7f80600b4000 rw-p 00009000 fd:01 23333969 /home/mame/work/ruby.tmp/.ext/x86_64-linux/stringio.so
| 7f80600b4000-7f80600b6000 r-xp 00000000 fd:01 23333689 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/trans/transdb.so
| 7f80600b6000-7f80602b6000 ---p 00002000 fd:01 23333689 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/trans/transdb.so
| 7f80602b6000-7f80602b7000 r--p 00002000 fd:01 23333689 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/trans/transdb.so
| 7f80602b7000-7f80602b8000 rw-p 00003000 fd:01 23333689 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/trans/transdb.so
| 7f80602b8000-7f80602ba000 r-xp 00000000 fd:01 23333649 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/encdb.so
| 7f80602ba000-7f80604b9000 ---p 00002000 fd:01 23333649 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/encdb.so
| 7f80604b9000-7f80604ba000 r--p 00001000 fd:01 23333649 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/encdb.so
| 7f80604ba000-7f80604bb000 rw-p 00002000 fd:01 23333649 /home/mame/work/ruby.tmp/.ext/x86_64-linux/enc/encdb.so
| 7f80604bb000-7f8060691000 r-xp 00000000 fd:01 15604574 /lib/x86_64-linux-gnu/libc-2.26.so
| 7f8060691000-7f8060891000 ---p 001d6000 fd:01 15604574 /lib/x86_64-linux-gnu/libc-2.26.so
| 7f8060891000-7f8060895000 r--p 001d6000 fd:01 15604574 /lib/x86_64-linux-gnu/libc-2.26.so
| 7f8060895000-7f8060897000 rw-p 001da000 fd:01 15604574 /lib/x86_64-linux-gnu/libc-2.26.so
| 7f8060897000-7f806089b000 rw-p 00000000 00:00 0
| 7f806089b000-7f80609f0000 r-xp 00000000 fd:01 15604578 /lib/x86_64-linux-gnu/libm-2.26.so
| 7f80609f0000-7f8060bef000 ---p 00155000 fd:01 15604578 /lib/x86_64-linux-gnu/libm-2.26.so
| 7f8060bef000-7f8060bf0000 r--p 00154000 fd:01 15604578 /lib/x86_64-linux-gnu/libm-2.26.so
| 7f8060bf0000-7f8060bf1000 rw-p 00155000 fd:01 15604578 /lib/x86_64-linux-gnu/libm-2.26.so
| 7f8060bf1000-7f8060bfa000 r-xp 00000000 fd:01 15604576 /lib/x86_64-linux-gnu/libcrypt-2.26.so
| 7f8060bfa000-7f8060df9000 ---p 00009000 fd:01 15604576 /lib/x86_64-linux-gnu/libcrypt-2.26.so
| 7f8060df9000-7f8060dfa000 r--p 00008000 fd:01 15604576 /lib/x86_64-linux-gnu/libcrypt-2.26.so
| 7f8060dfa000-7f8060dfb000 rw-p 00009000 fd:01 15604576 /lib/x86_64-linux-gnu/libcrypt-2.26.so
| 7f8060dfb000-7f8060e29000 rw-p 00000000 00:00 0
| 7f8060e29000-7f8060e2c000 r-xp 00000000 fd:01 15604577 /lib/x86_64-linux-gnu/libdl-2.26.so
| 7f8060e2c000-7f806102b000 ---p 00003000 fd:01 15604577 /lib/x86_64-linux-gnu/libdl-2.26.so
| 7f806102b000-7f806102c000 r--p 00002000 fd:01 15604577 /lib/x86_64-linux-gnu/libdl-2.26.so
| 7f806102c000-7f806102d000 rw-p 00003000 fd:01 15604577 /lib/x86_64-linux-gnu/libdl-2.26.so
| 7f806102d000-7f80610ab000 r-xp 00000000 fd:01 12068737 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
| 7f80610ab000-7f80612ab000 ---p 0007e000 fd:01 12068737 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
| 7f80612ab000-7f80612ac000 r--p 0007e000 fd:01 12068737 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
| 7f80612ac000-7f80612ad000 rw-p 0007f000 fd:01 12068737 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.2
| 7f80612ad000-7f80612c7000 r-xp 00000000 fd:01 15604589 /lib/x86_64-linux-gnu/libpthread-2.26.so
| 7f80612c7000-7f80614c6000 ---p 0001a000 fd:01 15604589 /lib/x86_64-linux-gnu/libpthread-2.26.so
| 7f80614c6000-7f80614c7000 r--p 00019000 fd:01 15604589 /lib/x86_64-linux-gnu/libpthread-2.26.so
| 7f80614c7000-7f80614c8000 rw-p 0001a000 fd:01 15604589 /lib/x86_64-linux-gnu/libpthread-2.26.so
| 7f80614c8000-7f80614cc000 rw-p 00000000 00:00 0
| 7f80614cc000-7f80614f3000 r-xp 00000000 fd:01 15602223 /lib/x86_64-linux-gnu/ld-2.26.so
| 7f8061592000-7f80615b6000 r--s 00000000 fd:01 15604589 /lib/x86_64-linux-gnu/libpthread-2.26.so
| 7f80615b6000-7f80616bc000 rw-p 00000000 00:00 0
| 7f80616cb000-7f80616cc000 ---p 00000000 00:00 0
| 7f80616cc000-7f80616ec000 rw-p 00000000 00:00 0
| 7f80616ec000-7f80616ed000 ---p 00000000 00:00 0
| 7f80616ed000-7f80616f3000 rw-p 00000000 00:00 0
| 7f80616f3000-7f80616f4000 r--p 00027000 fd:01 15602223 /lib/x86_64-linux-gnu/ld-2.26.so
| 7f80616f4000-7f80616f5000 rw-p 00028000 fd:01 15602223 /lib/x86_64-linux-gnu/ld-2.26.so
| 7f80616f5000-7f80616f6000 rw-p 00000000 00:00 0
| 7ffc4f013000-7ffc4f812000 rw-p 00000000 00:00 0 [stack]
| 7ffc4f904000-7ffc4f907000 r--p 00000000 00:00 0 [vvar]
| 7ffc4f907000-7ffc4f909000 r-xp 00000000 00:00 0 [vdso]
| ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
|
|
| [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
|
/home/mame/work/ruby.tmp/test/ruby/test_gc.rb:354:in `test_interrupt_in_finalizer'
Finished tests in 10.127763s, 0.0987 tests/s, 0.2962 assertions/s.
1 tests, 3 assertions, 0 failures, 1 errors, 0 skips
</code></pre>
<a name="How-to-reproduce"></a>
<h2 >How to reproduce<a href="#How-to-reproduce" class="wiki-anchor">¶</a></h2>
<ol>
<li>Apply this patch. This removes a mitigation of this issue.</li>
</ol>
<pre><code>diff --git a/thread.c b/thread.c
index bfa903c6a4..dfaf75d1ce 100644
--- a/thread.c
+++ b/thread.c
@@ -507,7 +507,7 @@ rb_thread_terminate_all(void)
* me when the last sub-thread exit.
*/
sleeping = 1;
- native_sleep(th, &tv);
+ native_sleep(th, 0);
RUBY_VM_CHECK_INTS_BLOCKING(ec);
sleeping = 0;
}
</code></pre>
<ol start="2">
<li>Run <code>make test-all</code> many times. The following command would be useful.</li>
</ol>
<pre><code>make && while make test-all TESTOPTS="test/ruby/test_gc.rb -n test_interrupt_in_finalizer"; do date; done
</code></pre>
<p>FYI: With execution counter</p>
<pre><code>make && i=0 && while make test-all TESTOPTS="test/ruby/test_gc.rb -n test_interrupt_in_finalizer"; do echo; date; echo "trial:$i"; i=`expr $i + 1`; done
</code></pre>
<a name="Details"></a>
<h2 >Details<a href="#Details" class="wiki-anchor">¶</a></h2>
<p><code>TestGc#test_interrupt_in_finalizer</code> checks if SIGINT can interrupt the GC finalizers. This test itself runs on a child process, and the process should end with SIGINT. If the process does not end in ten seconds, the parent sends SIGSEGV to the child, terminates the test, and reports it as a failure. ("C level backtrace information" has "sigsegv", but don't worry, this SEGV would be the one the parent sent. I guess this bug is not so significant, parhaps.)</p>
<p>When a main thread of Ruby process ends, it terminates all child threads and waits for them. However, for unknown reason (maybe depending upon the timing of SIGINT?), it sometimes fails synchronization: all child threads end, and the main thread meaninglessly waits forever.</p>
<p>Based on Ko1's proposal, I committed a tiny change to mitigate this issue at r60694: instead of waiting forever, the main thread wakes up every one second to monitor all child threads. This is not an essential solution for this issue, but just hides. To debug this issue, we need remove the mitigation by the patch described above.</p> Ruby master - Bug #13999 (Assigned): Cygwin 環境で ripper_state_lex.rb がコアダンプするhttps://redmine.ruby-lang.org/issues/139992017-10-11T05:19:02Zhigaki (masaru higaki)mas.higa@gmail.com
<p>いくつかの gem をインストールした際にコアダンプしました。</p>
<p>--no-ri を付けるとコアダンプしないことから ri の何かが関係していそうです。</p>
<p>$ gem install bitclust-core # コアダンプ<br>
$ gem install --no-ri bitclust-core # コアダンプしない</p>
<p>標準出力、エラー出力を添付します。</p> Ruby master - Bug #13671 (Assigned): Regexp with lookbehind and case-insensitivity raises RegexpE...https://redmine.ruby-lang.org/issues/136712017-06-22T23:28:58Zdschweisguth (Dave Schweisguth)dave@schweisguth.org
<p>Here is a test program:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">test</span><span class="p">(</span><span class="n">description</span><span class="p">)</span>
<span class="k">begin</span>
<span class="k">yield</span>
<span class="nb">puts</span> <span class="s2">"</span><span class="si">#{</span><span class="n">description</span><span class="si">}</span><span class="s2"> is OK"</span>
<span class="k">rescue</span> <span class="no">RegexpError</span>
<span class="nb">puts</span> <span class="s2">"</span><span class="si">#{</span><span class="n">description</span><span class="si">}</span><span class="s2"> raises RegexpError"</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="nb">test</span><span class="p">(</span><span class="s2">"ass, case-insensitive, special"</span><span class="p">)</span> <span class="p">{</span> <span class="sr">/(?<!ass)/i</span> <span class="o">=~</span> <span class="s1">'✨'</span> <span class="p">}</span>
<span class="nb">test</span><span class="p">(</span><span class="s2">"bss, case-insensitive, special"</span><span class="p">)</span> <span class="p">{</span> <span class="sr">/(?<!bss)/i</span> <span class="o">=~</span> <span class="s1">'✨'</span> <span class="p">}</span>
<span class="nb">test</span><span class="p">(</span><span class="s2">"as, case-insensitive, special"</span><span class="p">)</span> <span class="p">{</span> <span class="sr">/(?<!as)/i</span> <span class="o">=~</span> <span class="s1">'✨'</span> <span class="p">}</span>
<span class="nb">test</span><span class="p">(</span><span class="s2">"ss, case-insensitive, special"</span><span class="p">)</span> <span class="p">{</span> <span class="sr">/(?<!ss)/i</span> <span class="o">=~</span> <span class="s1">'✨'</span> <span class="p">}</span>
<span class="nb">test</span><span class="p">(</span><span class="s2">"ass, case-sensitive, special"</span><span class="p">)</span> <span class="p">{</span> <span class="sr">/(?<!ass)/</span> <span class="o">=~</span> <span class="s1">'✨'</span> <span class="p">}</span>
<span class="nb">test</span><span class="p">(</span><span class="s2">"ass, case-insensitive, regular"</span><span class="p">)</span> <span class="p">{</span> <span class="sr">/(?<!ass)/i</span> <span class="o">=~</span> <span class="s1">'x'</span> <span class="p">}</span>
</code></pre>
<p>Running the test program with Ruby 2.4.1 (macOS) gives</p>
<pre><code>ass, case-insensitive, special raises RegexpError
bss, case-insensitive, special raises RegexpError
as, case-insensitive, special is OK
ss, case-insensitive, special is OK
ass, case-sensitive, special is OK
ass, case-insensitive, regular is OK
</code></pre>
<p>The RegexpError is "invalid pattern in look-behind: /(?<!ass)/i (RegexpError)"</p>
<p>Side note: in the real code in which I found this error I was able to work around the error by using (?i) after the lookbehind instead of //i.</p>
<p>Running the test program with Ruby 2.3.4 does not report any RegexpErrors.</p>
<p>I think this is a regression, although I might be wrong and it might be saving me from an incorrect result with certain strings.</p> Ruby master - Bug #12725 (Assigned): Trying to use ./miniruby before it existshttps://redmine.ruby-lang.org/issues/127252016-09-05T05:04:23Zduerst (Martin Dürst)duerst@it.aoyama.ac.jpRuby master - Bug #12582 (Assigned): OpenSSL Authenticated Encryption should check for tag lengthhttps://redmine.ruby-lang.org/issues/125822016-07-11T07:35:30Zpatrick.oscity (Patrick Oscity)
<p>The current API for using ciphers with Authenticated Encryption (currently only AES-GCM) is rather misleading and quickly leads to subtle bugs related to the length of <code>auth_tag</code>.</p>
<p>In particular, the current implementation will <em>not</em> check for the length of the <code>auth_tag</code>. Because GCM mode allows arbitrary sizes of the <code>auth_tag</code> up to 128 bytes, only a single byte needs to be supplied to make the authentication pass. This means that an attacker needs at most 256 attempts in order to forge a valid <code>auth_tag</code>.</p>
<pre><code>data = 'secret'
cipher = OpenSSL::Cipher.new('aes-128-gcm')
cipher.encrypt
key = cipher.random_key
iv = cipher.random_iv
cipher.auth_data = 'auth_data'
ciphertext = cipher.update(data) + cipher.final
auth_tag = cipher.auth_tag
auth_tag = auth_tag[0] # single byte is sufficient
cipher = OpenSSL::Cipher.new('aes-128-gcm')
cipher.decrypt
cipher.key = key
cipher.iv = iv
cipher.auth_tag = auth_tag
cipher.auth_data = 'auth_data'
data = cipher.update(ciphertext) + cipher.final
# NO error raised
</code></pre>
<p>Currently, the only way to prevent such attacks is to manually assert the correct <code>auth_tag</code> length when decrypting/authenticating.</p>
<pre><code>raise 'incorrect auth_tag length' unless auth_tag.length == 16
</code></pre>
<p>I suggest the following improvements:</p>
<a name="Documentation-should-mention-the-importance-of-manually-checking-auth_tag-length"></a>
<h3 >Documentation should mention the importance of manually checking <code>auth_tag</code> length<a href="#Documentation-should-mention-the-importance-of-manually-checking-auth_tag-length" class="wiki-anchor">¶</a></h3>
<p>This can/should be done immediately even if the API should not change.</p>
<a name="Authentication-tag-length-should-be-an-input-parameter-to-the-cipher"></a>
<h3 >Authentication tag length should be an input parameter to the cipher<a href="#Authentication-tag-length-should-be-an-input-parameter-to-the-cipher" class="wiki-anchor">¶</a></h3>
<p>To improve the usability of the API and unburden users from performing additional manual checks without compromising security, I suggest to add an <code>auth_tag_len</code> accessor. This can be used to determine the size of the <code>auth_tag</code> both when generating and when authenticating the <code>auth_tag</code>. The default value should be 16 bytes (see below).</p>
<h3>
<code>#auth_tag</code> should use <code>auth_tag_len</code> to determine the output length</h3>
<p>During encryption:</p>
<p>If no parameter is given, <code>#auth_tag</code> should return an authentication tag according to the length configured in <code>auth_tag_len</code>.</p>
<p>If a length parameter is given, <code>#auth_tag</code> should use the supplied parameter to determine the length of the authentication tag. Although this parameter is not as useful any more it should be kept for backwards compatibility. Maybe it should be deprecated.</p>
<p>Currently the API supports different tag lengths by passing the length parameter to <code>#auth_tag</code>. This currently defaults to 16 bytes, which should be the default value for <code>auth_tag_len</code> in order to keep backwards compatibility.</p>
<h3>
<code>#final</code> should use <code>auth_tag_len</code> to assert the correct length of the <code>auth_tag</code>
</h3>
<p>During decryption:</p>
<p><code>auth_tag_len</code> should be used to assert that the supplied <code>auth_tag</code> has the correct length. The big difference to the existing API lies here, because users need to actively change the value of <code>auth_tag_len</code> in order to allow shorter tags.</p>
<p>When the check fails, an <code>OpenSSL::Cipher::CipherError</code> should be raised. The same type of error is already raised when authentication fails, so existing users should be fine without having to touch their error handling. A descriptive error message should be helpful. In order to distinguish between such errors and "actual" verification errors, we could also add a descriptive message for the latter.</p>
<p>I'd be happy to implement these changes, but I wanted to discuss them first.</p> Ruby master - Bug #12506 (Assigned): On cygwin, Feature #5994 does not workhttps://redmine.ruby-lang.org/issues/125062016-06-19T08:18:47Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>On cygwin, Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Dir.glob without wildcards returns pattern, not filename (Closed)" href="https://redmine.ruby-lang.org/issues/5994">#5994</a> doesn't seem to have been implemented. This can be confirmed with test/ruby/test_dir.rb (see the very end of this report), or even simpler, as follows:</p>
<pre><code>duerst@Arnisee /cygdrive/c/Data/testCygwin
$ ruby -e 'Dir.mkdir("Matsumoto")'
duerst@Arnisee /cygdrive/c/Data/testCygwin
$ ruby -e 'puts Dir.glob("Ma*to")'
Matsumoto
duerst@Arnisee /cygdrive/c/Data/testCygwin
$ ruby -e 'puts Dir.glob("ma*to")'
duerst@Arnisee /cygdrive/c/Data/testCygwin
$ ruby -e 'puts Dir.glob("matsumoto")'
matsumoto
</code></pre>
<p>The 4th execution shows the problem. Please note that the third execution is also strange.</p>
<pre><code>$ bin/ruby test/runner.rb test/ruby/test_dir.rb
Run options:
# Running tests:
[10/23] TestDir#test_glob_cases = 0.11 s
1) Failure:
TestDir#test_glob_cases [/cygdrive/c/Data/ruby/test/ruby/test_dir.rb:255]:
<a href="/issues/5994">[ruby-core:42469]</a> [Feature #5994]
Dir.glob should return the filename with actual cases on the filesystem.
<["FileWithCases"]> expected but was
<["filewithcases"]>.
Finished tests in 3.294094s, 6.9822 tests/s, 77.7148 assertions/s.
23 tests, 256 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 2.4.0dev (2016-06-19 trunk 55452) [x86_64-cygwin]
</code></pre> Ruby master - Bug #12445 (Assigned): Testing TestIO#test_open_fifo_does_not_block_other_threads r...https://redmine.ruby-lang.org/issues/124452016-05-31T10:15:12Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>When I run <code>bin/ruby test/runner.rb test/ruby/test_*</code>, testing stops at <code>TestIO#test_open_fifo_does_not_block_other_threads</code>. Checking the task manager shows that this is a deadlock (there are two ruby interpreters running, but they don't use any CPU at all).</p>
<p>This is what I see for ages:</p>
<pre><code>[1589/4545] TestIO#test_open_fifo_does_not_block_other_threads
</code></pre> Ruby master - Bug #12444 (Assigned): Segmentation fault when running TestException#test_machine_s...https://redmine.ruby-lang.org/issues/124442016-05-31T10:10:48Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>When I try to run <code>bin/ruby test/runner.rb test/ruby/test_*</code>, I get the error below. This is immediately followed by a very similar error for TestException#test_machine_stackoverflow_by_define_method.</p>
<pre><code>[ 942/4545] TestException#test_machine_stackoverflow = 1.27 s
19) Failure:
TestException#test_machine_stackoverflow [/cygdrive/c/Data/ruby/test/ruby/test_exception.rb:577]:
pid 16416 killed by SIGABRT (signal 6) (core dumped)
| -:7: [BUG] Segmentation fault at 0x000000ffe03fc0
| ruby 2.4.0dev (2016-05-31 trunk 55228) [x86_64-cygwin]
|
| -- Control frame information -----------------------------------------------
| c:0690 p:0014 s:1387 e:001386 LAMBDA -:7 [FINISH]
| c:0689 p:0014 s:1385 e:001384 LAMBDA -:7 [FINISH]
| c:0688 p:0014 s:1383 e:001382 LAMBDA -:7 [FINISH]
| c:0687 p:0014 s:1381 e:001380 LAMBDA -:7 [FINISH]
| c:0686 p:0014 s:1379 e:001378 LAMBDA -:7 [FINISH]
| c:0685 p:0014 s:1377 e:001376 LAMBDA -:7 [FINISH]
| c:0684 p:0014 s:1375 e:001374 LAMBDA -:7 [FINISH]
| c:0683 p:0014 s:1373 e:001372 LAMBDA -:7 [FINISH]
| c:0682 p:0014 s:1371 e:001370 LAMBDA -:7 [FINISH]
| c:0681 p:0014 s:1369 e:001368 LAMBDA -:7 [FINISH]
</code></pre>
<p>[very long list, ending in]</p>
<pre><code>| c:0009 p:0014 s:0025 e:000024 LAMBDA -:7 [FINISH]
| c:0008 p:0014 s:0023 e:000022 LAMBDA -:7 [FINISH]
| c:0007 p:0014 s:0021 e:000020 LAMBDA -:7 [FINISH]
| c:0006 p:0014 s:0019 e:000018 LAMBDA -:7 [FINISH]
| c:0005 p:0014 s:0017 e:000016 LAMBDA -:7 [FINISH]
| c:0004 p:0028 s:0015 E:001588 BLOCK -:8
| c:0003 p:0052 s:0012 e:000011 METHOD /cygdrive/c/Data/ruby/test/lib/test/unit/assertions.rb:74
| c:0002 p:0047 s:0004 E:000610 EVAL -:6 [FINISH]
| c:0001 p:0000 s:0002 E:001930 (none) [FINISH]
|
| -- Ruby level backtrace information ----------------------------------------
| -:6:in `<main>'
| /cygdrive/c/Data/ruby/test/lib/test/unit/assertions.rb:74:in `assert_raise'
| -:8:in `block in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
</code></pre>
<p>[again very long list, probably about same length, ending with]</p>
<pre><code>| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
| -:7:in `block (2 levels) in <main>'
|
| -- Other runtime information -----------------------------------------------
|
| * Loaded script: -
|
| * Loaded features:
|
| 0 enumerator.so
| 1 thread.rb
| 2 rational.so
| 3 complex.so
| 4 /cygdrive/c/Data/ruby/lib/ruby/2.4.0/x86_64-cygwin/enc/encdb.so
| 5 /cygdrive/c/Data/ruby/lib/ruby/2.4.0/x86_64-cygwin/enc/trans/transdb.so
| 6 /cygdrive/c/Data/ruby/lib/ruby/2.4.0/x86_64-cygwin/enc/windows_31j.so
| 7 /cygdrive/c/Data/ruby/lib/ruby/vendor_ruby/unicode_normalize.rb
| 8 /cygdrive/c/Data/ruby/lib/ruby/vendor_ruby/optparse.rb
| 9 /cygdrive/c/Data/ruby/lib/ruby/2.4.0/x86_64-cygwin/rbconfig.rb
| 10 /cygdrive/c/Data/ruby/test/lib/leakchecker.rb
| 11 /cygdrive/c/Data/ruby/test/lib/minitest/unit.rb
| 12 /cygdrive/c/Data/ruby/lib/ruby/vendor_ruby/prettyprint.rb
| 13 /cygdrive/c/Data/ruby/lib/ruby/vendor_ruby/pp.rb
| 14 /cygdrive/c/Data/ruby/test/lib/test/unit/assertions.rb
| 15 /cygdrive/c/Data/ruby/lib/ruby/vendor_ruby/open3.rb
| 16 /cygdrive/c/Data/ruby/lib/ruby/vendor_ruby/timeout.rb
| 17 /cygdrive/c/Data/ruby/test/lib/find_executable.rb
| 18 /cygdrive/c/Data/ruby/lib/ruby/2.4.0/x86_64-cygwin/rbconfig/sizeof.so
| 19 /cygdrive/c/Data/ruby/test/lib/envutil.rb
| 20 /cygdrive/c/Data/ruby/test/lib/test/unit/testcase.rb
| 21 /cygdrive/c/Data/ruby/test/lib/test/unit.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
|
</code></pre> Ruby master - Bug #12442 (Assigned): TestArgf#test_textmode fails on cygwinhttps://redmine.ruby-lang.org/issues/124422016-05-31T10:01:19Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>When I try to run <code>bin/ruby test/runner.rb test/ruby/test_*</code> (because <code>make test-all</code> doesn't work), the first failure that I get is as below.</p>
<pre><code>$ bin/ruby test/runner.rb test/ruby/test_*
Run options:
# Running tests:
[ 156/4545] TestArgf#test_textmode = 1.60 s
1) Failure:
TestArgf#test_textmode [/cygdrive/c/Data/ruby/test/ruby/test_argf.rb:685]:
<a href="/issues/5268">[ruby-core:39234]</a>.
<"1\n2\n3\n4\n5\n6\n"> expected but was
<"1\n2\n3\n4\n5\r\n6\r\n">.
</code></pre> Ruby master - Bug #12040 (Assigned): [Win32] File.stat fails on a mounted volumehttps://redmine.ruby-lang.org/issues/120402016-02-01T08:13:24Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<p>On Windows, <code>File.stat</code> fails on the volume mount point directory whose name contains <code>"..."</code>.</p>
<p>Where <code>%vol%</code> is the volume ID of a new VHD volume,</p>
<pre><code>C:> set vol
\\?\Volume{3C458AE9-C8B1-11E5-A233-0800271D089F}\
C:> mkdir x...y
C:> mountvol x...y %vol%
C:> .\miniruby -e "p Dir.chdir('x...y'){File.stat('.')}" -e "p File.stat('x...y')"
#<File::Stat dev=0x2, ino=1407374883553285, mode=040755, nlink=1, uid=0, gid=0, rdev=0x2, size=4096, blksize=nil, blocks=nil, atime=2016-02-01 16:35:45 +0900, mtime=2016-02-01 16:35:45 +0900, ctime=2016-02-01 16:35:45 +0900>
-e:2:in `stat': No such file or directory @ rb_file_s_stat - x...y (Errno::ENOENT)
from -e:2:in `<main>'
</code></pre>
<p>Note that <code>Dir.chdir</code> and <code>File.stat</code> there succeed.<br>
This failures depends on the mount point name, because of <code>check_valid_dir()</code>.</p> Ruby master - Bug #11840 (Open): Error with "make check" on Cygwinhttps://redmine.ruby-lang.org/issues/118402015-12-18T05:54:23Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>Encouraged by Hiroshi Shibata's talk at Ruby Kaigi 2015, I tried "make check" on my usual cygwin compilation. If I understand the output below correctly, there was only one error in 1010 tests. If we can fix that error (or exclude the test if it doesn't make sense on cygwin or on Windows in general), then cygwin would pass the tests.</p>
<pre><code>generating prelude.c
prelude.c unchanged
make[2]: 'rubyw.exe' is up to date.
make[2]: Leaving directory '/cygdrive/c/Data/ruby-public'
make[1]: Leaving directory '/cygdrive/c/Data/ruby-public'
test succeeded
#254 test_fork.rb: F
begin
r, w = IO.pipe
if pid1 = fork
w.close
r.read(1)
Process.kill("USR1", pid1)
_, s = Process.wait2(pid1)
s.success? ? :ok : :ng
else
r.close
if pid2 = fork
trap("USR1") { Time.now.to_s; Process.kill("USR2", pid2) }
w.close
Process.wait2(pid2)
else
w.close
sleep 0.2
end
exit true
end
rescue NotImplementedError
:ok
end
#=> "ng" (expected "ok") <a href="/issues/3005">[ruby-core:28924]</a>
stderr output is not empty
bootstraptest.tmp.rb:13:in `kill': No such process (Errno::ESRCH)
from bootstraptest.tmp.rb:13:in `block in <main>'
from bootstraptest.tmp.rb:15:in `wait2'
from bootstraptest.tmp.rb:15:in `<main>'
test_fork.rb FAIL 1/5
FAIL 1/1010 tests failed
uncommon.mk:581: recipe for target 'yes-btest-ruby' failed
make: *** [yes-btest-ruby] Error 1
</code></pre> Ruby master - Bug #11808 (Open): Different behavior between Enumerable#grep and Array#grephttps://redmine.ruby-lang.org/issues/118082015-12-11T23:53:02ZBenOlive (Ben Olive)ben.olive@gatech.edu
<p>Regex special global variables are available within the block for <code>Array#grep</code>, but are nil within the block for <code>Enumerable#grep</code>.</p>
<p>Here is an example that explains it better:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">Test</span>
<span class="kp">include</span> <span class="no">Enumerable</span>
<span class="k">def</span> <span class="nf">each</span>
<span class="k">return</span> <span class="n">enum_for</span><span class="p">(</span><span class="ss">:each</span><span class="p">)</span> <span class="k">unless</span> <span class="nb">block_given?</span>
<span class="k">yield</span> <span class="s2">"Hello"</span>
<span class="k">yield</span> <span class="s2">"World"</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="n">enum</span> <span class="o">=</span> <span class="no">Test</span><span class="p">.</span><span class="nf">new</span>
<span class="n">array</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"Hello"</span><span class="p">,</span> <span class="s2">"World"</span><span class="p">]</span>
<span class="n">enum</span><span class="p">.</span><span class="nf">grep</span><span class="p">(</span><span class="sr">/^(.)/</span><span class="p">)</span> <span class="p">{</span><span class="vg">$1</span><span class="p">}</span> <span class="c1"># => [nil, nil]</span>
<span class="n">array</span><span class="p">.</span><span class="nf">grep</span><span class="p">(</span><span class="sr">/^(.)/</span><span class="p">)</span> <span class="p">{</span><span class="vg">$1</span><span class="p">}</span> <span class="c1"># => ["H", "W"]</span>
</code></pre>
<p>Tested on 2.0.0, 2.1.5, & 2.2.2</p> Ruby master - Bug #11438 (Open): native_thread_init_stack() get machine.stack_start unequal to th...https://redmine.ruby-lang.org/issues/114382015-08-13T07:31:10Zrickerliang (l ly)rickerliang@outlook.com
<p>In function native_thread_init_stack() use VirtualQuery to get thread's stack start address.But some situation(ruby embbed in other application and initial it on the fly),native_thread_init_stack() will be called at low stack address and VirtualQuery return memory info BaseAddress + RegionSize < thread stack base(teb.StackBase).<br>
In this situation,subsequently call stack_check() at high stack address will cause stack_overflow exception,because esp > machine.stack_start:<br>
(teb.StackLimit < machine.stack_start < esp < teb.StackBase)<br>
but actually it is not stack overflow at this time.<br>
Use teb.StackBase instead of VirtualQuery get thread stack base is a more reliable solution.</p> Ruby master - Bug #11142 (Open): Command line argument parser on windows handles double quotes in...https://redmine.ruby-lang.org/issues/111422015-05-12T16:09:28Zksubrama (Kartik Cating-Subramanian)ksubramanian@chef.io
<p>I believe the issue is with <a href="https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L1671" class="external">https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L1671</a> through 1673.</p>
<p>C:\Users\ksubrama>ruby -e "puts ARGV" "foo""bar"<br>
foo"bar</p>
<p>C:\Users\ksubrama>ruby -e "puts ARGV" "foo"" bar"<br>
foo"<br>
bar</p>
<p>I believe the intent is that if ruby encounters "" inside a " quoted string, then it interprets it as a literal " and doesn't close out the string. If that's the case, then the code should read:</p>
<pre><code> if (quote == L'"' && quote == ptr[1])
ptr++;
else
quote = L'\0';
</code></pre>
<p>Otherwise, the string gets closed out anyway and the ptr++ here combined with the ptr++ at the bottom of the switch at line 1685 simply skip over both "" characters while considering the string closed.</p>
<p>As a further test case consider:</p>
<p>C:\Users\ksubrama>ruby -e "puts ARGV" "foo""bar""baz"<br>
foo"barbaz</p>
<p>The parser is now very confused because the first "" closed out the string and the next "" is not interpreted as a literal " but as "open and close and empty string element" and the trailing " just gets dropped.</p> Ruby master - Bug #10416 (Open): Create mechanism for updating of Unicode data files downstreams ...https://redmine.ruby-lang.org/issues/104162014-10-22T11:27:03Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>The current mechanism for updating Unicode data files will create the following problem:<br>
Downstream compilers/packagers will download Unicode data files ONE time (they may already have done so).</p>
<p>However, if they don't activate ALWAYS_UPDATE_UNICODE = yes, these files will never get updated, and they will stay on Unicode version 7.0 even if in five years Unicode is e.g. on version 12.0.<br>
On the other hand, if they activate ALWAYS_UPDATE_UNICODE = yes (and assuming issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Unicode data files (in enc/unicode/data) don't get updated even if ALWAYS_UPDATE_UNICODE = yes is... (Closed)" href="https://redmine.ruby-lang.org/issues/10415">#10415</a> gets fixed), they constantly update to the latest version of Unicode. That's good for those who actually want this, but now what our current policy is.<br>
What's missing is that we (Ruby core) can make sure downstream checkouts update to a new Unicode version when we want then to do so (as we e.g. can do for other parts that are based on Unicode data, see e.g. <a href="https://bugs.ruby-lang.org/issues/9092" class="external">https://bugs.ruby-lang.org/issues/9092</a>), without sending an email to everybody and hoping they read and follow it.</p>
<p>[Currently, the only solution I know will work is the one pointed out by Yui Naruse in https://bugs.ruby-lang.org/issues/10084#note-17, but I'm okay with any other solution.]</p> Ruby master - Bug #10128 (Open): Quoting problem for arguments of Kernel.system, Kernel.exec on W...https://redmine.ruby-lang.org/issues/101282014-08-12T16:18:30ZMaxLap (Maxime Lapointe)hunter_spawn@hotmail.com
<p>On Windows, the methods that call shell commands and receive the parameters individually sometimes do not wrap the parameters sent in quotes.<br>
This results in Windows either splitting the parameter in 2 parameters or, worse, splitting the command in 2 commands.</p>
<p>I joined the file <em>puts_first.bat</em>, which simply outputs the first argument it received. When the parameter received was wrapped by ruby, you will see quotes, it's normal. Just run a irb from from the directory containing that file.</p>
<p>Lines that don't work properly (Using Kernel.exec will do the same thing):</p>
<pre><code># these write *hello*, then says 'world' is not recognized as an internal or external command
Kernel.system 'puts_first.bat', 'hello&world'
Kernel.system 'puts_first.bat', 'hello|world'
# these write *hello*
Kernel.system 'puts_first.bat', 'hello,world'
Kernel.system 'puts_first.bat', 'hello;world'
Kernel.system 'puts_first.bat', 'hello<world'
# this writes *hello* in the file world
Kernel.system 'puts_first.bat', 'hello>world'
# this writes *helloworld* without the ^
Kernel.system 'puts_first.bat', 'hello^world'
</code></pre>
<p>If we add a space anywhere in the above hello world strings, it will work as expected because ruby wraps the parameter if it finds a space.</p>
<pre><code># Ruby does try to wrap if it finds a double quote, but it escapes double quotes incorrectly:
# this writes *"hello\"world"*, double quotes should be escaped by putting 2 of them, so we should see: *"hello""world"*
Kernel.system 'puts_first.bat', 'hello"world'
# adding a space show the problem in action, this writes *"hello\"*
Kernel.system 'puts_first.bat', 'hello" world'
</code></pre>
<p>As a side note, the single quote is not special in Windows, so there is no need to wrap this (but I don't think it's a problem):</p>
<pre><code># this writes *"hello'world"*
Kernel.system 'puts_first.bat', "hello'world"
</code></pre>
<p>This bug also happens in 1.9.3, do you think this be backported?</p>
<p>Unless I did a mistake, this should be all of the problematic characters, I tested with every printable ascii characters.</p>
<p>Thank you</p> Ruby master - Bug #10009 (Open): IO operation is 10x slower in multi-thread environmenthttps://redmine.ruby-lang.org/issues/100092014-07-06T07:35:01Zariveira (Alexandre Riveira)alexandre@objectdata.com.br
<p>I created this issue <a class="issue tracker-5 status-1 priority-4 priority-default" title="Misc: better concurrency in threads (Open)" href="https://redmine.ruby-lang.org/issues/9832">#9832</a> but not have io operation.<br>
In the script attached I simulate IO operation in multi-thread environment.<br>
For ruby 1.9.2 apply <code>taskset -c -p 2 #{Process.pid}</code> for regulates threads behavior.<br>
The second Thread is a io operation</p>
<p>My results:</p>
<ol>
<li>
<p>ruby 2.1.2<br>
first 43500194<br>
second 95<br>
third 42184385</p>
</li>
<li>
<p>ruby-2.0.0-p451<br>
first 38418401<br>
second 95<br>
third 37444470</p>
</li>
<li>
<p>1.9.3-p545<br>
first 121260313<br>
second 50<br>
third 44275164</p>
</li>
<li>
<p>1.9.2-p320<br>
first 31189901<br>
second 897 <============<br>
third 31190598</p>
</li>
</ol>
<p>Regards</p>
<p>Alexandre Riveira</p> Ruby master - Bug #9409 (Open): Cygwin で "filesystem" の encoding が正しくないケースhttps://redmine.ruby-lang.org/issues/94092014-01-14T08:43:25Zganaware (Nayuta Taga)
<p>Cygwin で環境変数 LANG に設定されているエンコーディングと<br>
システムのコードページが異なる場合<br>
"filesystem" の encoding が正しく設定されないようです。</p>
<p>例えば、</p>
<ul>
<li>Windows 7 (日本語)</li>
<li>Cygwin 環境 (CYGWIN_NT-6.1-WOW64 ****** 1.7.27(0.271/5/3) 2013-12-09 11:57 i686 Cygwin)</li>
<li>環境変数 LANG は ja_JP.UTF-8</li>
<li>カレントディレクトリに「<code>日本語.txt</code>」という名前のファイルが存在</li>
</ul>
<p>という状態で以下のコードを実行すると</p>
<pre><code>print "LANG=#{ENV['LANG']}\n"
print "\n"
Dir.open('.').each{|item|
p item.encoding
p item
}
print "\n"
Dir.open('.',encoding: 'locale').each{|item|
p item.encoding
p item
}
print "\n"
</code></pre>
<p>例えば以下のような出力が得られます。</p>
<pre><code>LANG=ja_JP.UTF-8
#<Encoding:Windows-31J>
"."
#<Encoding:Windows-31J>
".."
#<Encoding:Windows-31J>
"test.rb"
#<Encoding:Windows-31J>
"\x{E697}\xA5\x{E69C}\xAC\x{E8AA}\x9E.txt"
#<Encoding:UTF-8>
"."
#<Encoding:UTF-8>
".."
#<Encoding:UTF-8>
"test.rb"
#<Encoding:UTF-8>
"日本語.txt"
</code></pre>
<p>本来ならば全ての Encoding が UTF-8 であるべきだと思います。</p>
<p><code>Init_enc_set_filesystem_encoding()</code> を以下のように修正すれば修正可能です。</p>
<pre><code>Index: localeinit.c
===================================================================
--- localeinit.c (revision 44594)
+++ localeinit.c (working copy)
@@ -53,7 +53,7 @@
int idx;
#if defined NO_LOCALE_CHARMAP
# error NO_LOCALE_CHARMAP defined
-#elif defined _WIN32 || defined __CYGWIN__
+#elif defined _WIN32 && !defined __CYGWIN__
char cp[sizeof(int) * 8 / 3 + 4];
snprintf(cp, sizeof cp, "CP%d", AreFileApisANSI() ? GetACP() : GetOEMCP());
idx = rb_enc_find_index(cp);
</code></pre> Ruby master - Bug #9115 (Assigned): Logger traps all exceptions; breaks Timeouthttps://redmine.ruby-lang.org/issues/91152013-11-16T12:30:25Zcphoenix (Chris Phoenix)cphoenix@gmail.com
<p>Line 577-579 of logger.rb</p>
<pre><code> rescue Exception => ignored
warn("log writing failed. #{ignored}")
end
</code></pre>
<p>Thus, when the system times out in the middle of writing a log message, it warns "log writing failed. execution expired" and just keeps right on running.</p>
<p>This is true in 1.9.3 as well. I haven't looked at older versions.</p>
<p>Pardon me while I go grep "rescue Exception" in the entire Ruby codebase, and see whether I can reliably use Timeout at all...</p>
<p>OK, you might check out C:\Ruby200\lib\ruby\gems\2.0.0\gems\activerecord-3.2.13\lib\active_record\railties\databases.rake</p>
<p>All the other "rescue Exception" seem to re-raise it, except maybe C:\Ruby200\lib\ruby\2.0.0\xmlrpc\server.rb and C:\Ruby200\lib\ruby\gems\2.0.0\gems\activesupport-3.2.13\lib\active_support\callbacks.rb</p> Ruby master - Bug #9010 (Assigned): ./configure --prefix= cannot handle directories with spaceshttps://redmine.ruby-lang.org/issues/90102013-10-10T07:50:41Zpostmodern (Hal Brodigan)postmodern.mod3@gmail.com
<p>It appears that the linking task fails when the --prefix value contains spaces.</p>
<p>Steps to Reproduce:</p>
<ol>
<li>./configure --prefix="$HOME/foo bar"</li>
<li>make</li>
</ol>
<p>Expected Result: success<br>
Actual Result:</p>
<p>make[2]: Entering directory <code>/home/hal/src/ruby-2.0.0-p247' linking ruby gcc: error: bar/lib: No such file or directory gcc: error: bar/lib: No such file or directory make[2]: *** [ruby] Error 1 make[2]: Leaving directory </code>/home/hal/src/ruby-2.0.0-p247'<br>
make[1]: *** [all] Error 2<br>
make[1]: Leaving directory `/home/hal/src/ruby-2.0.0-p247'<br>
make: *** [build-ext] Error 2</p> Ruby master - Bug #8445 (Assigned): IO.open and IO#set_enconding does not support :fallback optionhttps://redmine.ruby-lang.org/issues/84452013-05-24T22:03:00Zpjmtdw (Haruhiro Yoshimoto)pjmtdw@gmail.com
<p>RubyDoc says that <code>IO.open</code> and <code>IO#set_encoding</code> supports optional argument defined in <code>String#encode</code>.<br>
<a href="http://ruby-doc.org/core-2.0/IO.html#method-c-new-label-Options" class="external">http://ruby-doc.org/core-2.0/IO.html#method-c-new-label-Options</a><br>
In fact, <code>:invalid, :undef and :replace</code> works as expected.</p>
<p>However, <code>:fallback</code> option does not work neither for <code>IO.open</code> and <code>IO#set_encoding</code>.<br>
Following is the example code which does not work.<br>
<code>f(x)</code> is never called even if hoge.txt contains non convertible character.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s2">"./hoge.txt"</span><span class="p">,</span><span class="s2">"r:Shift_JIS:utf-8"</span><span class="p">,</span> <span class="ss">:fallback</span> <span class="o">=></span> <span class="nb">lambda</span><span class="p">{</span><span class="o">|</span><span class="n">x</span><span class="o">|</span><span class="n">f</span><span class="p">(</span><span class="n">x</span><span class="p">)}){</span><span class="o">|</span><span class="n">f</span><span class="o">|</span>
<span class="o">...</span>
<span class="p">}</span>
<span class="no">File</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span><span class="s2">"./hoge.txt"</span><span class="p">){</span><span class="o">|</span><span class="n">f</span><span class="o">|</span>
<span class="n">f</span><span class="p">.</span><span class="nf">set_encoding</span><span class="p">(</span><span class="s2">"Shift_JIS"</span><span class="p">,</span><span class="s2">"utf-8"</span><span class="p">,</span><span class="ss">:fallback</span> <span class="o">=></span> <span class="nb">lambda</span><span class="p">{</span><span class="o">|</span><span class="n">x</span><span class="o">|</span><span class="n">f</span><span class="p">(</span><span class="n">x</span><span class="p">)})</span>
<span class="o">...</span>
<span class="p">}</span>
</code></pre>
<p>I Think this is because <code>fill_cbuf()</code> in <code>io.c</code> calls <code>rb_econv_convert()</code> from <code>transcode.c</code> directly.<br>
On the other hand, <code>fallback_func</code> is called in <code>transcode_loop()</code>, which is called by <code>str_encode()</code>.</p>
<p>Since <code>transcode_loop()</code> also calls <code>rb_econv_convert()</code>, I wrote a small patch which moves some codes from<br>
<code>transcode_loop()</code> to <code>rb_econv_convert()</code> to fix the problem.</p>
<p>The attached file is the patch. Hope this helps.</p> Ruby master - Bug #8444 (Open): Regexp vars $~ and friends are not thread localhttps://redmine.ruby-lang.org/issues/84442013-05-24T18:15:17Zjamespharaoh (James Pharaoh)james@phsys.co.uk
<p>In the docs for the Regexp special variables, <code>$~</code> and friends, it says "These global variables are thread-local and method-local variables". However the following gives an unexpected result:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">def</span> <span class="nf">get_proc</span>
<span class="nb">proc</span> <span class="k">do</span> <span class="o">|</span><span class="n">str</span><span class="o">|</span>
<span class="n">str</span> <span class="o">=~</span> <span class="sr">/(.+)/</span>
<span class="nb">sleep</span> <span class="mf">0.1</span>
<span class="nb">puts</span> <span class="s2">"got </span><span class="si">#{</span><span class="vg">$1</span><span class="si">}</span><span class="s2"> from </span><span class="si">#{</span><span class="n">str</span><span class="si">}</span><span class="se">\n</span><span class="s2">"</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="nb">proc</span> <span class="o">=</span> <span class="n">get_proc</span>
<span class="n">t1</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="nb">proc</span><span class="p">.</span><span class="nf">call</span> <span class="s2">"abc"</span> <span class="p">}</span>
<span class="n">t2</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="nb">proc</span><span class="p">.</span><span class="nf">call</span> <span class="s2">"def"</span> <span class="p">}</span>
<span class="n">t1</span><span class="p">.</span><span class="nf">join</span>
<span class="n">t2</span><span class="p">.</span><span class="nf">join</span>
</code></pre>
<p>This outputs the following:</p>
<pre><code>got abc from abc
got abc from def
</code></pre>
<p>The expected result is of course:</p>
<pre><code>got abc from abc
got def from def
</code></pre>
<p>Clearly the variables are being scoped to the <code>get_proc</code> method and are being shared by both threads. This runs contrary to the documentation and also to expectations.</p>
<p>This behaviour should either be changed, or the documentation updated to reflect the actual behaviour.</p>
<p>Interestingly, the following does work as expected:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">proc</span> <span class="o">=</span> <span class="nb">proc</span> <span class="k">do</span> <span class="o">|</span><span class="n">str</span><span class="o">|</span>
<span class="n">str</span> <span class="o">=~</span> <span class="sr">/(.+)/</span>
<span class="nb">sleep</span> <span class="mf">0.1</span>
<span class="nb">puts</span> <span class="s2">"got </span><span class="si">#{</span><span class="vg">$1</span><span class="si">}</span><span class="s2"> from </span><span class="si">#{</span><span class="n">str</span><span class="si">}</span><span class="se">\n</span><span class="s2">"</span>
<span class="k">end</span>
<span class="n">t1</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="nb">proc</span><span class="p">.</span><span class="nf">call</span> <span class="s2">"abc"</span> <span class="p">}</span>
<span class="n">t2</span> <span class="o">=</span> <span class="no">Thread</span><span class="p">.</span><span class="nf">new</span> <span class="p">{</span> <span class="nb">proc</span><span class="p">.</span><span class="nf">call</span> <span class="s2">"def"</span> <span class="p">}</span>
<span class="n">t1</span><span class="p">.</span><span class="nf">join</span>
<span class="n">t2</span><span class="p">.</span><span class="nf">join</span>
</code></pre> Ruby master - Bug #7968 (Assigned): Poor UDPSocket#send performance in ruby 2.0.0 on windowshttps://redmine.ruby-lang.org/issues/79682013-02-26T20:55:25Zcs96and (Alan Davies)alan.n.davies@gmail.com
<p>I have noticed that the performance of UDPSocket#send on ruby 2.0.0 on windows is much poorer than that of 1.9.3 or 1.8.7. Running the attahced script on 2.0.0 gives the following...</p>
<p>d:\scripts>bash -c "ruby --version"<br>
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]</p>
<p>d:\scripts>bash -c "time ruby socketsendtest.rb"</p>
<p>real 0m2.572s<br>
user 0m0.000s<br>
sys 0m0.016s</p>
<p>However, running the same test with 1.9.3 is much faster...</p>
<p>d:\scripts>pik 193</p>
<p>d:\scripts>bash -c "ruby --version"<br>
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]</p>
<p>d:\scripts>bash -c "time ruby socketsendtest.rb"</p>
<p>real 0m0.993s<br>
user 0m0.015s<br>
sys 0m0.016s</p>
<p>Additionally, if I change the send call to a print (commented out in the script), then the performance is fine on 2.0.0....</p>
<p>d:\scripts>pik 200</p>
<p>d:\scripts>bash -c "ruby --version"<br>
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]</p>
<p>d:\scripts>bash -c "time ruby socketsendtest.rb"</p>
<p>real 0m0.907s<br>
user 0m0.000s<br>
sys 0m0.015s</p>
<p>What is send() doing that print() doesn't do that is causing the massive performance drop?</p>
<p>Thanks<br>
Alan.</p> Ruby master - Bug #7964 (Assigned): Writing an ASCII-8BIT String to a StringIO created from a UTF...https://redmine.ruby-lang.org/issues/79642013-02-26T16:32:50Zbrixen (Brian Shirai)brixen@gmail.com
<p>=begin<br>
In the following script, an ASCII-8BIT String is written to a StringIO created with a UTF-8 String without error. However, a << b or a + b will raise an exception, as will writing an ASCII-8BIT String to a File with UTF-8 external encoding.</p>
<ul>
<li>
<p>$ cat file_enc.rb</p>
<a name="encoding-utf-8"></a>
<h1 >encoding: utf-8<a href="#encoding-utf-8" class="wiki-anchor">¶</a></h1>
<p>require 'stringio'</p>
<p>a = "On a very cold morning, it was -8°F."<br>
b = a.dup.force_encoding "ascii-8bit"</p>
<p>io = StringIO.new a<br>
io.write(b)<br>
p io.string.encoding</p>
<p>File.open "data.txt", "w:utf-8" do |f|<br>
f.write a<br>
f.write b<br>
end</p>
</li>
<li>
<p>$ ruby2.0 -v file_enc.rb<br>
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin10.8.0]<br>
#<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a><br>
file_enc.rb:13:in <code>write': "\xC2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) from file_enc.rb:13:in </code>block in '<br>
from file_enc.rb:11:in <code>open' from file_enc.rb:11:in </code>'</p>
</li>
<li>
<p>$ ruby1.9.3 -v file_enc.rb<br>
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin10.8.0]<br>
#<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a><br>
file_enc.rb:13:in <code>write': "\xC2" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError) from file_enc.rb:13:in </code>block in '<br>
from file_enc.rb:11:in <code>open' from file_enc.rb:11:in </code>'<br>
=end</p>
</li>
</ul> Ruby master - Bug #7892 (Open): MIME encoding bug of NKF.nkfhttps://redmine.ruby-lang.org/issues/78922013-02-20T16:01:52Zmrkn (Kenta Murata)muraken@gmail.com
<p>NKF の MIME encoding の結果が 1.8 と 1.9/2.0 で異なってます。</p>
<a name="18-の場合"></a>
<h1 >1.8 の場合<a href="#18-の場合" class="wiki-anchor">¶</a></h1>
<p>$ /usr/bin/ruby -rnkf -ve "puts NKF.nkf('-jW -M --cp932', '「あああああああああああ by ああああああああああ」のレシピ')"<br>
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]<br>
=?ISO-2022-JP?B?GyRCIVYkIiQiJCIkIiQiJCIkIiQiJCIkIiQiGyhC?= by<br>
=?ISO-2022-JP?B?GyRCJCIkIiQiJCIkIiQiJCIkIiQiJCIhVyROJWwlNyVUGyhC?=</p>
<a name="193-p385-の場合"></a>
<h1 >1.9.3-p385 の場合<a href="#193-p385-の場合" class="wiki-anchor">¶</a></h1>
<p>$ ruby -rnkf -ve "puts NKF.nkf('-jW -M --cp932', '「あああああああああああ by ああああああああああ」のレシピ')"<br>
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin11.4.2]<br>
=?ISO-2022-JP?B?GyRCIVYkIiQiJCIkIiQiJCIkIiQiJCIkIiQiGyhC?= by<br>
=?US-ASCII?Q??=<br>
=?ISO-2022-JP?B?GyRCJCIkIiQiJCIkIiQiJCIkIiQiJCIhVyROJWwlNyVUGyhC?=</p>
<a name="200-rc2-の場合"></a>
<h1 >2.0.0-rc2 の場合<a href="#200-rc2-の場合" class="wiki-anchor">¶</a></h1>
<p>$ RBENV_VERSION=2.0.0-rc2 rbenv exec ruby -rnkf -ve "puts NKF.nkf('-jW -M --cp932', '「あああああああああああ by ああああああああああ」のレシピ')"<br>
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.2]<br>
=?ISO-2022-JP?B?GyRCIVYkIiQiJCIkIiQiJCIkIiQiJCIkIiQiGyhC?= by<br>
=?US-ASCII?Q??=<br>
=?ISO-2022-JP?B?GyRCJCIkIiQiJCIkIiQiJCIkIiQiJCIhVyROJWwlNyVUGyhC?=</p> Ruby master - Bug #7742 (Open): System encoding (Windows-1258) is not recognized by Ruby to conv...https://redmine.ruby-lang.org/issues/77422013-01-26T15:33:40ZMars (Hong Ha Dang )dhhmars9999@gmail.com
<p>I installed Railsinstaller in win8. After intall complete the screen set to</p>
<blockquote>
<p>configuration Railsinstaller on cmd (step 2). I give user name: DHH Mars and<br>
email: <a href="mailto:dhhma...@gmail.com" class="email">dhhma...@gmail.com</a>. It ran and have following massage:</p>
<p>C:/RailsInstaller/scripts/config_check.rb:64:in 'exist?': code converter not<br>
found <a href="Encoding::ConverterNotFoundError" class="external">Encoding::ConverterNotFoundError</a> from<br>
C:/RailsInstaller/scripts/config_check.rb:64:in 'main'</p>
<p>C:\Sites></p>
</blockquote> Ruby master - Bug #6360 (Assigned): Debug information build even without requesting ithttps://redmine.ruby-lang.org/issues/63602012-04-26T08:46:44Zluislavena (Luis Lavena)luislavena@gmail.com
<p>Hello,</p>
<p>While working on latest RubyInstaller release for 1.9.3-p194 our team detected a bigger shared library and import library being generated.</p>
<p>After further inspection, we found this commit:<br>
<a href="https://github.com/ruby/ruby/commit/ffdaca1d748804f2b5ca2de612f17cf6c78d351b" class="external">https://github.com/ruby/ruby/commit/ffdaca1d748804f2b5ca2de612f17cf6c78d351b</a></p>
<p>Backported r34840 into ruby_1_9_3 branch</p>
<p>The above change added -ggdb to CFLAGS even when was not provided by debugflags configure option.</p>
<p>The following is the comparison of "make" summary with and without the change:</p>
<p>Current trunk:</p>
<pre>
C:\Users\Luis\Projects\oss\ruby\build32>make
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -fno-omit-frame-pointer -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -DFD_SETSIZE=32767 -D_WIN32_WINNT=0x0501 -I. -I.ext/include/i386-mingw32 -I../include -I..
DLDFLAGS = -Wl,--enable-auto-image-base,--enable-auto-import -Wl,--out-implib=libmsvcrt-ruby200.dll.a msvcrt-ruby200.def -Wl,--stack,0x00200000,--enable-auto-import
SOLIBS = msvcrt-ruby200.res.o -lshell32 -lws2_32 -limagehlp
</pre>
<p>Reverting r34840:</p>
<pre>
C:\Users\Luis\Projects\oss\ruby\build32>make
CC = gcc
LD = ld
LDSHARED = gcc -shared -s
CFLAGS = -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -DFD_SETSIZE=32767 -D_WIN32_WINNT=0x0501 -I. -I.ext/include/i386-mingw32 -I../include -I..
DLDFLAGS = -Wl,--enable-auto-image-base,--enable-auto-import -Wl,--out-implib=libmsvcrt-ruby200.dll.a msvcrt-ruby200.def -Wl,--stack,0x00200000,--enable-auto-import
SOLIBS = msvcrt-ruby200.res.o -lshell32 -lws2_32 -limagehlp
</pre>
<p>Notice that -g changed into -ggdb instead.</p>
<p>I think debug symbols shouldn't be compiled unless requested and this is a regression.</p> Ruby master - Bug #6351 (Assigned): transcode table generator does not support multi characters o...https://redmine.ruby-lang.org/issues/63512012-04-24T20:41:39Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<p>改めてチケット起こします。<a href="/issues/6349">[ruby-dev:45576]</a> より。</p>
<p>On 2012/04/24 17:11, "Martin J. Dürst" wrote:</p>
<blockquote>
<p>On 2012/04/24 17:02, U.Nakamura wrote:</p>
<blockquote>
<p>データは例によってNetBSDのものが利用できそうです。<br>
なのですが、transcodeってUnicodeの第0面(BMP)以外はサポートし<br>
てましたっけ?</p>
</blockquote>
<p>もちろんです :-)</p>
</blockquote>
<p>もうちょっと調べました。BMP 以外は transcode の最初から全く問題ないです<br>
が、現時点で引っかかるのは次のものです<br>
(<a href="http://x0213.org/codetable/euc-jis-2004-std.txt" class="external">http://x0213.org/codetable/euc-jis-2004-std.txt</a> から抜粋):</p>
<p>0xA4F7 U+304B+309A # [2000]<br>
0xA4F8 U+304D+309A # [2000]<br>
0xA4F9 U+304F+309A # [2000]<br>
0xA4FA U+3051+309A # [2000]<br>
0xA4FB U+3053+309A # [2000]</p>
<p>0xA5F7 U+30AB+309A # [2000]<br>
0xA5F8 U+30AD+309A # [2000]<br>
0xA5F9 U+30AF+309A # [2000]<br>
0xA5FA U+30B1+309A # [2000]<br>
0xA5FB U+30B3+309A # [2000]<br>
0xA5FC U+30BB+309A # [2000]<br>
0xA5FD U+30C4+309A # [2000]<br>
0xA5FE U+30C8+309A # [2000]</p>
<p>0xA6F8 U+31F7+309A # [2000]</p>
<p>0xABC4 U+00E6+0300 # [2000]</p>
<p>0xABC8 U+0254+0300 # [2000]<br>
0xABC9 U+0254+0301 # [2000]<br>
0xABCA U+028C+0300 # [2000]<br>
0xABCB U+028C+0301 # [2000]<br>
0xABCC U+0259+0300 # [2000]<br>
0xABCD U+0259+0301 # [2000]<br>
0xABCE U+025A+0300 # [2000]<br>
0xABCF U+025A+0301 # [2000]</p>
<p>0xABE5 U+02E9+02E5 # [2000]<br>
0xABE6 U+02E5+02E9 # [2000]</p>
<p>ようするに、JIS X 0213 で一文字になっているが、Unicode で二文字になって<br>
いるものです。EUC-JISX0213 から UTF-8 は問題ないですが、逆は現在引っかか<br>
ります。windows-1258 も (逆ですが) 同じ問題がありますので、いずれはなく<br>
さないといけないと思いましたが、今回はいいきっかけのではないかと思います。</p>
<p>よろしくお願いします。 Martin.</p>