Ruby Issue Tracking System: Issueshttps://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112024-03-22T01:58:03ZRuby Issue Tracking System
Redmine Ruby master - Misc #20387 (Open): Meta-ticket for ASAN supporthttps://redmine.ruby-lang.org/issues/203872024-03-22T01:58:03Zkjtsanaktsidis (KJ Tsanaktsidis)kjtsanaktsidis@gmail.com
<p>I was asked to provide a bit of information about the current status of ASAN in CRuby, so I thought I'd open this meta-ticket to track all of the work I've been performing on fixing up address sanitizer support.</p>
<p>So far, I have fixed the following issues related to ASAN support:</p>
<ul>
<li>
<a href="https://bugs.ruby-lang.org/issues/20001" class="external">https://bugs.ruby-lang.org/issues/20001</a> + <a href="https://github.com/ruby/ruby/pull/9505" class="external">https://github.com/ruby/ruby/pull/9505</a>, which dealt with two main themes:
<ul>
<li>Pushing the logic for capturing the start of the machine stack much closer to the top of the call stack, so that VALUEs stored close to the top of the machine stack get marked properly</li>
<li>Marking VALUEs stored on ASAN fake stacks during machine stack marking</li>
</ul>
</li>
<li>
<a href="https://bugs.ruby-lang.org/issues/20220" class="external">https://bugs.ruby-lang.org/issues/20220</a> + <a href="https://github.com/ruby/ruby/pull/9734" class="external">https://github.com/ruby/ruby/pull/9734</a>, which made M:N threading notify ASAN about stack switches in the same way that fibers do
<ul>
<li>Note: ASAN still doesn't work with M:N threading, but that actually has nothing to do with ASAN; it's because the most recent versions of Clang which are needed for ASAN just don't work with M:N threading either. See <a href="https://bugs.ruby-lang.org/issues/20243" class="external">https://bugs.ruby-lang.org/issues/20243</a> for more info about that.</li>
</ul>
</li>
<li>
<a href="https://bugs.ruby-lang.org/issues/20273" class="external">https://bugs.ruby-lang.org/issues/20273</a> + <a href="https://github.com/ruby/ruby/pull/10012" class="external">https://github.com/ruby/ruby/pull/10012</a>, which disables <code>callcc</code> (and the associated tests) when ASAN is enabled
<ul>
<li>callcc is very rarely used in real code and the way it works is just fundamentally incompatible with ASAN (it performs longjmp's which I think are technically undefined behaviour)</li>
</ul>
</li>
<li>
<a href="https://bugs.ruby-lang.org/issues/20221" class="external">https://bugs.ruby-lang.org/issues/20221</a> + <a href="https://github.com/ruby/ruby/pull/9865" class="external">https://github.com/ruby/ruby/pull/9865</a>, which ignore some global symbols that ASAN defines from the global symbol leak checker</li>
<li>
<a href="https://bugs.ruby-lang.org/issues/20274" class="external">https://bugs.ruby-lang.org/issues/20274</a> + <a href="https://github.com/ruby/ruby/pull/10087" class="external">https://github.com/ruby/ruby/pull/10087</a>, which ignores some false positive tests about memory leaks when ASAN is enabl</li>
<li>I updated the ASAN docs in <a href="https://github.com/ruby/ruby/pull/9922" class="external">https://github.com/ruby/ruby/pull/9922</a> to more closely reflect current reality</li>
</ul>
<p>The current state of things is that, by following the instructions in <a href="https://github.com/ruby/ruby/blob/master/doc/contributing/building_ruby.md" class="external">https://github.com/ruby/ruby/blob/master/doc/contributing/building_ruby.md</a>, you can successfully build Ruby with ASAN enabled, however, the test suite has several failures. I'm currently working on addressing these:</p>
<p>The next step is to merge <a href="https://github.com/ruby/ruby/pull/10122" class="external">https://github.com/ruby/ruby/pull/10122</a> (<a href="https://bugs.ruby-lang.org/issues/20310" class="external">https://bugs.ruby-lang.org/issues/20310</a>) which I plan to do next week (I'm currently away on a work trip). That makes sure that VALUEs stored in ASAN fake stacks from threads other than the currently running thread get marked during GC.</p>
<p>After that, I need to push up patches for the remaining few issues. I mostly have these patches ready to go already; in fact, last week I got the full <code>make check</code> suite passing all tests with ASAN enabled!</p>
<p>Once that's working, I'd like to investigate how ASAN can fit into CRuby's CI matrix somewhere so that it <em>stays</em> working, although I have not thought too deeply about this yet.</p>
<p>I will provide further updates on this ticket so anybody interested can stay in the loop.</p> Ruby master - Feature #20347 (Assigned): Separate docs task from allhttps://redmine.ruby-lang.org/issues/203472024-03-19T09:10:29Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<p>I would like to migrate RDoc as bundled gems at Ruby 3.5.</p>
<p>We need to handle <code>install-doc</code> and related task with that. I removed <code>docs</code> task from <code>all</code> and re-order <code>docs</code> task at <code>install-all</code>.</p>
<p><a href="https://github.com/ruby/ruby/pull/10282" class="external">https://github.com/ruby/ruby/pull/10282</a></p>
<p>It works with RDoc as bundled gems. We can keep current behavior with this migration.</p>
<p>I hope to merge changes for <code>all</code> task and re-order <code>install-all</code> task at Ruby 3.4.</p>
<p><a href="https://github.com/ruby/ruby/pull/10282/commits/b160083175aed062c320b8d76eafe1c8706309d4" class="external">https://github.com/ruby/ruby/pull/10282/commits/b160083175aed062c320b8d76eafe1c8706309d4</a></p>
<p>After that, the default <code>make</code> task will not generate rdoc. We need to add <code>make all docs</code> for that.</p> Ruby master - Feature #20309 (Assigned): Bundled gems for Ruby 3.5https://redmine.ruby-lang.org/issues/203092024-02-27T22:16:20Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<p>I propose migrate the following default gems to bundled gems at Ruby 3.5. So, It means users will get warnings if users try to load them.</p>
<p>(Update with 2024/03/14)</p>
<ul>
<li>ostruct
<ul>
<li>I make ostruct as optional on json at <a href="https://github.com/flori/json/pull/565" class="external">https://github.com/flori/json/pull/565</a>
</li>
</ul>
</li>
<li>logger
<ul>
<li>activesupport needs to add logger to its dependency same as bigdecimal, drb or etc.</li>
</ul>
</li>
<li>fiddle</li>
<li>pstore</li>
<li>win32ole</li>
</ul>
<p>I have a plan to migrate the following default gems too. But I need to more feedback from other committers about them.</p>
<ul>
<li>irb
<ul>
<li>We need to consider how works <code>binding.irb</code> after Ruby 3.5.</li>
<li>I consider to use <code>irb</code> without Gemfile.</li>
</ul>
</li>
<li>reline</li>
<li>readline (wrapper file for readline-ext and reline)</li>
<li>io-console
<ul>
<li>rubygems uses that. Should we make optional that?</li>
</ul>
</li>
<li>open-uri</li>
<li>yaml (wrapper file for psych)
<ul>
<li>syck is retired today. I'm not sure what people uses <code>psych</code> directly, not <code>yaml</code>.</li>
</ul>
</li>
<li>rdoc
<ul>
<li>We need to change build task like download rdoc gem before document generation.
<ul>
<li>extract <code>make doc</code> from <code>make all</code> and invoke <code>make doc</code> before <code>make install</code>.</li>
</ul>
</li>
<li>or We make document generation is optional from Ruby 3.5
<ul>
<li>We explicitly separate <code>make install</code> and <code>make install-doc</code>
</li>
</ul>
</li>
</ul>
</li>
<li>un
<ul>
<li>
<code>ruby -run</code> is one of cool feature of Ruby. Should we avoid uninstalling <code>un</code> gem?</li>
<li>mkmf uses <code>ruby -run</code> for that. I need to investigate that.</li>
</ul>
</li>
<li>singleton
<ul>
<li>This is famous design pattern. Should we enforce users add them to their Gemfile?</li>
</ul>
</li>
<li>forwadable
<ul>
<li>
<code>reline</code> needs to add forwardable their <code>runtime_dependency</code> after migration.</li>
</ul>
</li>
<li>weakref
<ul>
<li>I'm not sure how impact after migrating bundled gems.</li>
</ul>
</li>
<li>fcntl
<ul>
<li>Should we integrate these constants into ruby core?</li>
</ul>
</li>
</ul>
<p>I would like to migrate <code>ipaddr</code> and <code>uri</code> too. But these are used by webrick that is mock server for our test suite. We need to rewrite <code>webrick</code> with <code>TCPSocker</code> or extract <code>ipaddr</code> and <code>uri</code> dependency from <code>webrick</code></p>
<p>Other default gems depend on our build process or other libraries deeply. I will update this proposal if I could extract them from default gems.</p> 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 - Feature #20261 (Open): Add symbol synonyms for '' and nil for IO method line separa...https://redmine.ruby-lang.org/issues/202612024-02-12T20:34:51Zburdettelamar (Burdette Lamar)
<p>[Feature 20261] For IO's line-oriented read methods, there are two special values for the line-separator argument <code>sep</code>; I'm proposing to add (user-friendlier) symbol synonyms for those values:</p>
<ul>
<li>
<code>:paragraph</code> as synonym for <code>''</code> (read paragraphs).</li>
<li>
<code>:slurp</code> as synonym for <code>nil</code> (read all).</li>
</ul>
<p>Details (code, documentation, tests) may be seen at <a href="https://github.com/ruby/ruby/pull/9921" class="external">https://github.com/ruby/ruby/pull/9921</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 - Feature #20105 (Open): Introduce `IO::Stream` or something similar.https://redmine.ruby-lang.org/issues/201052024-01-01T07:43:50Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p>Ruby's IO class has a general model for streaming IO, including some hidden classes like <code>IO::generic_readable</code> and <code>IO::generic_writable</code>.</p>
<p>As Ruby's core IO classes evolve, gems like <code>openssl</code> (see <code>OpenSSL::Buffering</code>) need to be updated to support changes to the interface.</p>
<p>As it stands, there are changes in <code>IO</code> which are not copied to <code>OpenSSL::Buffering</code>. I'd like to propose we introduce some shared interface for streams that is used by <code>IO</code>, <code>Socket</code>, and <code>OpenSSL</code> to start with. The general interface would be similar to <code>IO</code> and allow code like <code>OpenSSL</code> to avoid re-implementing the <code>IO</code> interface.</p>
<p>I don't have a strong idea for the interface yet, but it would probably look something like this:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="k">class</span> <span class="nc">IO::Stream</span>
<span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">io</span><span class="p">,</span> <span class="ss">buffered: </span><span class="kp">true</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">read</span><span class="p">(</span><span class="n">size</span><span class="p">,</span> <span class="n">buffer</span><span class="o">=</span><span class="kp">nil</span><span class="p">)</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="n">size</span><span class="p">,</span> <span class="n">buffer</span><span class="o">=</span><span class="kp">nil</span><span class="p">)</span>
<span class="k">end</span>
<span class="c1"># Include general operations from IO, like gets, puts, etc</span>
<span class="k">end</span>
</code></pre>
<p>I think ideally we'd try implement with pure Ruby and a first goal would be to replace <code>OpenSSL::Buffering</code>.</p> Ruby master - Feature #20102 (Open): Introduce `Fiber#resuming?`https://redmine.ruby-lang.org/issues/201022023-12-28T07:25:59Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p>There are some tricky edge cases when using <code>Fibre#raise</code> and <code>Fiber#kill</code>, e.g.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">fiber</span> <span class="o">=</span> <span class="kp">nil</span>
<span class="n">killer</span> <span class="o">=</span> <span class="no">Fiber</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">fiber</span><span class="p">.</span><span class="nf">raise</span><span class="p">(</span><span class="s2">"Stop"</span><span class="p">)</span>
<span class="k">end</span>
<span class="n">fiber</span> <span class="o">=</span> <span class="no">Fiber</span><span class="p">.</span><span class="nf">new</span> <span class="k">do</span>
<span class="n">killer</span><span class="p">.</span><span class="nf">resume</span>
<span class="k">end</span>
<span class="n">fiber</span><span class="p">.</span><span class="nf">resume</span>
<span class="c1"># 4:in `raise': attempt to raise a resuming fiber (FiberError)</span>
<span class="c1"># 4:in `block in <main>'</span>
</code></pre>
<p>Async has to deal with this edge case explicitly by rescuing the exception:</p>
<p><a href="https://github.com/socketry/async/blob/ffd019d9c1d547926a28fe8f36bf7bfe91d8a168/lib/async/task.rb#L226-L233" class="external">https://github.com/socketry/async/blob/ffd019d9c1d547926a28fe8f36bf7bfe91d8a168/lib/async/task.rb#L226-L233</a></p>
<p>I'd like to avoid doing that and instead just ask "Can I kill/raise on this fiber right now?" which is determined by whether the fiber itself can be resumed or transferred to.</p>
<p>To address this, I'd like to introduce <code>Fiber#resuming?</code>:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="cm">/*
* call-seq: fiber.resumed? -> true or false
*
* Whether the fiber is currently resumed.
*/</span>
<span class="n">VALUE</span>
<span class="nf">rb_fiber_resuming_p</span><span class="p">(</span><span class="n">VALUE</span> <span class="n">fiber_value</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">struct</span> <span class="n">rb_fiber_struct</span> <span class="o">*</span><span class="n">fiber</span> <span class="o">=</span> <span class="n">fiber_ptr</span><span class="p">(</span><span class="n">fiber_value</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">FIBER_TERMINATED_P</span><span class="p">(</span><span class="n">fiber</span><span class="p">))</span> <span class="k">return</span> <span class="n">RUBY_Qfalse</span><span class="p">;</span>
<span class="k">return</span> <span class="n">RBOOL</span><span class="p">(</span><span class="n">fiber</span><span class="o">-></span><span class="n">resuming_fiber</span><span class="p">);</span>
<span class="p">}</span>
</code></pre>
<p>See the PR: <a href="https://github.com/ruby/ruby/pull/9382" class="external">https://github.com/ruby/ruby/pull/9382</a></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 - Feature #19972 (Assigned): Install default/bundled gems into dedicated directorieshttps://redmine.ruby-lang.org/issues/199722023-10-25T15:30:22Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>I think that the current situation, where the same directory (lets call it <code>Gem.default_dir</code>) is used for default/bundled gems as well as for user installed gems, is suboptimal. During the times, this has caused us quite some issue on Fedora. Historically, we redefined the <code>Gem.default_dir</code> to user home directory, to avoid the mixing of system gems and user installed gems. Unfortunately, with advent of default/bundled gems, we were facing issues that these gems were suddenly not listed, etc. I am realizing this issue in full once again since the "user install" RubyGems feature has landed <a href="https://github.com/rubygems/rubygems/pull/5327" class="external">1</a>. I also think that we have arrived to this situation by evolution, not by design.</p>
<p>Therefore my proposal is:</p>
<p>Keep the <code>Gem.default_dir</code> for user <code>gem install</code>ed gems and lets install default and bundled gems into separate dedicated directories. Have separate <code>Gem.bundled_gems_dir</code> and <code>Gem.default_gems_dir</code> structures.</p>
<p>Of course, if <code>Gem.default_dir == Gem.bundled_gems_dir == Gem.default_gems_dir</code>, we still can have the current layout.</p>
<p>I have a simple POC here:</p>
<p><a href="https://github.com/ruby/ruby/pull/8761" class="external">https://github.com/ruby/ruby/pull/8761</a></p>
<p>BTW I have reported it here, because I think that RubyGems provides all it is needed. So it is not RubyGems ticket after all. However, I believe that RubyGems could benefit from this long term and some simplifications/cleanups would be possible.</p> Ruby master - Feature #19908 (Assigned): Update to Unicode 15.1https://redmine.ruby-lang.org/issues/199082023-10-02T06:55:45Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<p>The Unicode 15.1 is released.</p>
<p>The current enc-unicode.rb seems to fail because of <code>Indic_Conjunct_break</code> properties with values.</p>
<p>I'm not sure how these properties should be handled well.<br>
<code>/\p{InCB_Liner}/</code> or <code>/\p{InCB=Liner}/</code> as the comments in that file?<br>
<a href="https://github.com/nobu/ruby/tree/unicode-15.1" class="external">https://github.com/nobu/ruby/tree/unicode-15.1</a> is the former.</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 - Feature #19642 (Open): Remove vectored read/write from `io.c`.https://redmine.ruby-lang.org/issues/196422023-05-15T06:33:11Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p><a href="https://github.com/socketry/async/issues/228#issuecomment-1546789910" class="external">https://github.com/socketry/async/issues/228#issuecomment-1546789910</a> is a comment from the kernel developer who tells us that <code>writev</code> is always worse than <code>write</code> system call.</p>
<p>A large amount of complexity in <code>io.c</code> comes from optional support from <code>writev</code>.</p>
<p>So, I'd like to remove support for <code>writev</code>.</p>
<p>I may try to measure the performance before/after. However it may not show much difference, except that the implementation in <code>io.c</code> can be much simpler.</p> Ruby master - Feature #19422 (Assigned): Make `--enabled-shared` mandatory on macOShttps://redmine.ruby-lang.org/issues/194222023-02-07T08:14:26Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<p>From the troubles around linker on macOS, I propose <code>--enable-shared</code> option mandatory on macOS.<br>
This patch enables the option by default, and abort if <code>--disable-shared</code> option is given explicitly.</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git i/configure.ac w/configure.ac
index 7db2ab5257c..923ac7d1199 100644
</span><span class="gd">--- i/configure.ac
</span><span class="gi">+++ w/configure.ac
</span><span class="p">@@ -504,6 +504,11 @@</span> AS_CASE(["$target_os"],
rb_cv_binary_elf=no
: ${enable_shared=yes}
],
<span class="gi">+[darwin*], [
+ AS_IF([test "${enable_shared=yes}" = no], [
+ AC_MSG_ERROR([--disable-shared is not supported on this platform])
+ ])
+],
</span> [hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
AC_PROG_LN_S
<span class="p">@@ -3055,14 +3060,7 @@</span> AC_SUBST(EXTOBJS)
: ${LDFLAGS=""}
: ${LIBPATHENV=DYLD_FALLBACK_LIBRARY_PATH}
: ${PRELOADENV=DYLD_INSERT_LIBRARIES}
<span class="gd">- AS_IF([test x"$enable_shared" = xyes], [
- # Resolve symbols from libruby.dylib when --enable-shared
- EXTDLDFLAGS='$(LIBRUBYARG_SHARED)'
- ], [test "x$EXTSTATIC" = x], [
- # When building exts as bundles, a mach-o bundle needs to know its loader
- # program to bind symbols from the ruby executable
- EXTDLDFLAGS="-bundle_loader '\$(BUILTRUBY)'"
- ])
</span><span class="gi">+ EXTDLDFLAGS='$(LIBRUBYARG_SHARED)'
</span> rb_cv_dlopen=yes],
[aix*], [ : ${LDSHARED='$(CC)'}
AS_IF([test "$GCC" = yes], [
<span class="p">@@ -3356,10 +3354,6 @@</span> AS_IF([test x"$cross_compiling" = xyes], [
AC_SUBST(XRUBY_RUBYLIBDIR)
AC_SUBST(XRUBY_RUBYHDRDIR)
PREP='$(arch)-fake.rb'
<span class="gd">- AS_CASE(["$enable_shared:$EXTSTATIC:$target_os"], [no::darwin*], [
- # darwin target requires miniruby for linking ext bundles
- PREP="$PREP"' miniruby$(EXEEXT)'
- ])
</span> RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
RUNRUBY='$(RUNRUBY_COMMAND)'
XRUBY='$(MINIRUBY)'
</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 - Feature #19325 (Assigned): YJIT: Windows support lacking.https://redmine.ruby-lang.org/issues/193252023-01-08T18:09:41Zdsisnero (Dominic Sisneros)dsisnero@gmail.com
<p>Ruby's support on windows has always been second class. With some of the recent decisions, windows support is falling even more behind. Recent developments in mjit and yjit that exclude windows are two glaring issues that should be corrected. Googling 'percent of windows vs other operating systems' and it shows windows has a share of 76%. Ceding that users to python and other programming languages has to be one of the reasons python continues get more market share from ruby. With rust having first class windows support and threading support, is there a reason why yjit is not able to work on windows? Also, windows compiler support has matured enough and vcpkg support has evolved enough that it seems it should be possible to finally get a ruby version without having to use msys2. Even Crystal language has a version that runs on windows without needing msys2.</p> Ruby master - Feature #19317 (Assigned): Unicode ICU Full case mappinghttps://redmine.ruby-lang.org/issues/193172023-01-06T15:05:39Znoraj (Alexandre ZANNI)
<p>As announced in <a href="https://docs.ruby-lang.org/en/master/case_mapping_rdoc.html#label-Default+Case+Mapping" class="external">Case Mapping</a>, Ruby support for Unicode case mapping is not complete yet.</p>
<p>Unicode supports in Ruby is pretty awesome, it works by default nearly everywhere, things are implemented the right way and works as expected by the UTRs.</p>
<p>But some features are still missing.</p>
<p>To reach <a href="https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#full-language-specific-case-mapping" class="external">ICU Full Case Mapping support</a>, a few points need to be enhanced.</p>
<a name="context-sensitive-case-mapping"></a>
<h3 >context-sensitive case mapping<a href="#context-sensitive-case-mapping" class="wiki-anchor">¶</a></h3>
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> cf. <a href="https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf" class="external">Table 3-17 (Context Specification for Casing) of the Unicode standard</a> and <a href="https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt" class="external">ucd/SpecialCasing.txt</a>.</li>
</ul>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="s2">"ΣΣ"</span><span class="p">.</span><span class="nf">downcase</span> <span class="c1"># returns σσ instead of σς</span>
</code></pre>
<p>Output examples in ECMAScript:</p>
<pre><code>Σ ➡️ σ
Σa ➡️ σa
aΣ ➡️ aς
aΣa ➡️ aσa
ΣA ➡️ σa
aΣ a ➡️ aς a
Σ1 ➡️ σ1
aΣ1 ➡️ aς1
ΣΣ ➡️ σς
</code></pre>
<a name="language-sensitive-case-mapping"></a>
<h2 >language-sensitive case mapping<a href="#language-sensitive-case-mapping" class="wiki-anchor">¶</a></h2>
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> Lithuanian rules</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" checked disabled> Turkish and Azeri</li>
</ul>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="s2">"I"</span><span class="p">.</span><span class="nf">downcase</span> <span class="c1"># => "i"</span>
<span class="s2">"I"</span><span class="p">.</span><span class="nf">downcase</span><span class="p">(</span><span class="ss">:turkic</span><span class="p">)</span> <span class="c1"># => "ı"</span>
<span class="s2">"I</span><span class="se">\u</span><span class="s2">0307"</span><span class="p">.</span><span class="nf">upcase</span> <span class="c1"># => "İ"</span>
<span class="s2">"I</span><span class="se">\u</span><span class="s2">0307"</span><span class="p">.</span><span class="nf">upcase</span><span class="p">(</span><span class="ss">:lithuanian</span><span class="p">)</span> <span class="c1"># => "İ" instead of "I"</span>
</code></pre>
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> using some standard locale / language codes</li>
</ul>
<p>Also, it's true that for now there are only a few language-sensitive rules (for Lithuanian, Turkish and Azeri) but why:</p>
<ul>
<li>adding a <code>:turkic</code> symbol and not a <code>:azeri</code>?</li>
<li>using full english arbitrary (why <code>turkic</code> and not <code>turkish</code>?) language name rather than some <a href="https://unicode-org.github.io/icu/userguide/locale/" class="external">ICU locale IDs</a>?
<ul>
<li>Language code ISO-639 standard</li>
<li>Script code Unicode ISO 15924 Registry</li>
<li>country code ISO-3166 standard</li>
</ul>
</li>
</ul>
<p>So I would rather see something like that</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="s2">"placeholder"</span><span class="p">.</span><span class="nf">upcase</span><span class="p">(</span><span class="ss">locale: :tr_TR</span><span class="p">)</span>
<span class="s2">"placeholder"</span><span class="p">.</span><span class="nf">upcase</span><span class="p">(</span><span class="ss">lang: :tr</span><span class="p">)</span>
</code></pre> Ruby master - Feature #19171 (Open): Update Unicode data to Unicode Version 15.1https://redmine.ruby-lang.org/issues/191712022-12-02T07:59:33Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<p>According to <a href="http://blog.unicode.org/2022/11/the-unicode-standard-2023-release.html" class="external">http://blog.unicode.org/2022/11/the-unicode-standard-2023-release.html</a>, Unicode plans to release Version 15.1 in September 2023. According to <a href="https://www.unicode.org/versions/beta.html" class="external">https://www.unicode.org/versions/beta.html</a>, public alpha review starts Feb. 7, 2023, and ends April 4, 2023. Because alpha review may not include all the files we use, it may be difficult for us to participate.</p>
<p>Public beta review is planned to start May 23, 2023, ending July 4, 2023. At this point, we should be able to test things.</p> Ruby master - Misc #19122 (Open): Use MADV_DONTNEED instead of MADV_FREE when freeing a Fiber's s...https://redmine.ruby-lang.org/issues/191222022-11-11T16:06:08Zsmcgivern (Sean McGivern)
<p>I'd like to propose that Ruby stops using MADV_FREE when freeing a Fiber's stack, and switches to using MADV_DONTNEED even when MADV_FREE is supported.</p>
<p>MADV_FREE is used in one place in the Ruby codebase, when freeing the stack of a freed Fiber: <a href="https://git.ruby-lang.org/ruby.git/tree/cont.c#n683" class="external">https://git.ruby-lang.org/ruby.git/tree/cont.c#n683</a></p>
<p>The comment for <code>fiber_pool_stack_free</code> says:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="c1">// We advise the operating system that the stack memory pages are no longer being used.</span>
<span class="c1">// This introduce some performance overhead but allows system to relaim memory when there is pressure.</span>
</code></pre>
<p>Where possible (i.e. on Linux 4.5 and later), <code>fiber_pool_stack_free</code> uses <code>MADV_FREE</code> over <code>MADV_DONTNEED</code>. This has the side effect that memory statistics such as RSS will not reduce until and unless the OS actually reclaims that memory. If that doesn't happen, then the reported memory usage via RSS will be much higher than the 'real' memory usage.</p>
<p>If this was pervasive throughtout the Ruby codebase then that would be one thing, but currently this is just for Fiber. This means that:</p>
<ol>
<li>A program that doesn't use Fiber will have somewhat reliable RSS statistics on recent Linux.</li>
<li>A program that heavily uses Fiber (such as something using Async::HTTP) will see an inflated RSS statistic.</li>
</ol>
<p>Go made a similar change to the one I'm proposing here for similar reasons: <a href="https://github.com/golang/go/issues/42330" class="external">https://github.com/golang/go/issues/42330</a></p>
<blockquote>
<p>While <code>MADV_FREE</code> is somewhat faster than <code>MADV_DONTNEED</code>, it doesn't affect many of the statistics that <code>MADV_DONTNEED</code> does until the memory is actually reclaimed. This generally leads to poor user experience, like confusing stats in <code>top</code> and other monitoring tools; and bad integration with management systems that respond to memory usage.<br>
[...]<br>
I propose we change the default to prefer <code>MADV_DONTNEED</code> over <code>MADV_FREE</code>, to favor user-friendliness and minimal surprise over performance. I think it's become clear that Linux's implementation of <code>MADV_FREE</code> ultimately doesn't meet our needs.</p>
</blockquote>
<p>As an aside, MADV_FREE was not used in Ruby 3.1 (<a href="https://bugs.ruby-lang.org/issues/19101" class="external">https://bugs.ruby-lang.org/issues/19101</a>), and I haven't found any bugs filed about this behaviour other than that one.</p> Ruby master - Feature #19077 (Open): Introduce `Hash#dup` copy on write.https://redmine.ruby-lang.org/issues/190772022-10-22T21:55:25Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p>Pull Request: <a href="https://github.com/ruby/ruby/pull/6613" class="external">https://github.com/ruby/ruby/pull/6613</a>.</p> Ruby master - Feature #19057 (Assigned): Hide implementation of `rb_io_t`.https://redmine.ruby-lang.org/issues/190572022-10-15T01:54:57Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p>In order to make improvements to the IO implementation like <a href="https://bugs.ruby-lang.org/issues/18455" class="external">https://bugs.ruby-lang.org/issues/18455</a>, we need to add new fields to <code>struct rb_io_t</code>.</p>
<p>By the way, ending types in <code>_t</code> is not recommended by POSIX, so I'm also trying to rename the internal implementation to drop <code>_t</code> where possible during this conversion.</p>
<p>Anyway, we should try to hide the implementation of <code>struct rb_io</code>. Ideally, we don't expose any of it, but the problem is backwards compatibility.</p>
<p>So, in order to remain backwards compatibility, we should expose some fields of <code>struct rb_io</code>, the most commonly used one is <code>fd</code> and <code>mode</code>, but several others are commonly used.</p>
<p>There are many fields which should not be exposed because they are implementation details.</p>
<a name="Current-proposal"></a>
<h2 >Current proposal<a href="#Current-proposal" class="wiki-anchor">¶</a></h2>
<p>The current proposed change <a href="https://github.com/ruby/ruby/pull/6511" class="external">https://github.com/ruby/ruby/pull/6511</a> creates two structs:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="c1">// include/ruby/io.h</span>
<span class="cp">#ifndef RB_IO_T
</span><span class="k">struct</span> <span class="n">rb_io</span> <span class="p">{</span>
<span class="kt">int</span> <span class="n">fd</span><span class="p">;</span>
<span class="c1">// ... public fields ...</span>
<span class="p">};</span>
<span class="cp">#else
</span><span class="k">struct</span> <span class="n">rb_io</span><span class="p">;</span>
<span class="cp">#endif
</span>
<span class="c1">// internal/io.h</span>
<span class="cp">#define RB_IO_T
</span><span class="k">struct</span> <span class="n">rb_io</span> <span class="p">{</span>
<span class="kt">int</span> <span class="n">fd</span><span class="p">;</span>
<span class="c1">// ... public fields ...</span>
<span class="c1">// ... private fields ...</span>
<span class="p">};</span>
</code></pre>
<p>However, we are not 100% confident this is safe according to the C specification. My experience is not sufficiently wide to say this is safe in practice, but it does look okay to both myself, and <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/772">@Eregon (Benoit Daloze)</a> + <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/73">@tenderlovemaking (Aaron Patterson)</a> have both given some kind of approval.</p>
<p>That being said, maybe it's not safe.</p>
<p>There are two alternatives:</p>
<a name="Hide-all-details"></a>
<h2 >Hide all details<a href="#Hide-all-details" class="wiki-anchor">¶</a></h2>
<p>We can make public <code>struct rb_io</code> completely invisible.</p>
<pre><code class="c syntaxhl" data-language="c"><span class="c1">// include/ruby/io.h</span>
<span class="cp">#define RB_IO_HIDDEN
</span><span class="k">struct</span> <span class="n">rb_io</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">rb_ioptr_descriptor</span><span class="p">(</span><span class="k">struct</span> <span class="n">rb_io</span> <span class="o">*</span><span class="n">ioptr</span><span class="p">);</span> <span class="c1">// accessor for previously visible state.</span>
<span class="c1">// internal/io.h</span>
<span class="k">struct</span> <span class="n">rb_io</span> <span class="p">{</span>
<span class="c1">// ... all fields ...</span>
<span class="p">};</span>
</code></pre>
<p>This would only be forwards compatible, and code would need to feature detect like this:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="cp">#ifdef RB_IO_HIDDEN
#define RB_IOPTR_DESCRIPTOR rb_ioptr_descriptor
#else
#define RB_IOPTR_DESCRIPTOR(ioptr) rb_ioptr_descriptor(ioptr)
#endif
</span></code></pre>
<a name="Nested-public-interface"></a>
<h2 >Nested public interface<a href="#Nested-public-interface" class="wiki-anchor">¶</a></h2>
<p>Alternatively, we can nest the public fields into the private struct:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="c1">// include/ruby/io.h</span>
<span class="k">struct</span> <span class="n">rb_io_public</span> <span class="p">{</span>
<span class="kt">int</span> <span class="n">fd</span><span class="p">;</span>
<span class="c1">// ... public fields ...</span>
<span class="p">};</span>
<span class="c1">// internal/io.h</span>
<span class="cp">#define RB_IO_T
</span><span class="k">struct</span> <span class="n">rb_io</span> <span class="p">{</span>
<span class="k">struct</span> <span class="n">rb_io_public</span> <span class="n">public</span><span class="p">;</span>
<span class="c1">// ... private fields ...</span>
<span class="p">};</span>
</code></pre>
<a name="Considerations"></a>
<h2 >Considerations<a href="#Considerations" class="wiki-anchor">¶</a></h2>
<p>I personally think the "Hide all details" implementation is the best, but it's also the lest compatible. This is also what we are ultimately aiming for, whether we decide to take an intermediate "compatibility step" is up to us.</p>
<p>I think "Nested public interface" is messy and introduces more complexity, but it might be slightly better defined than the "Current proposal" which might create undefined behaviour. That being said, all the tests are passing.</p> Ruby master - Feature #19056 (Open): Introduce `Fiber.annotation` for attaching messages to fibers.https://redmine.ruby-lang.org/issues/190562022-10-14T23:09:31Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p>It's useful to know what a fiber is doing especially when they have a temporal execution (i.e. sockets connecting vs connected, binding vs accepting, queue popping, etc)</p>
<p>Let's introduce <code>Fiber.annotate</code> and <code>Fiber#annotation</code> for logging a short message attached to Fibers.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">Fiber</span><span class="p">.</span><span class="nf">annotate</span> <span class="s2">"Counting to 10"</span>
<span class="mi">10</span><span class="p">.</span><span class="nf">times</span><span class="p">{</span><span class="o">|</span><span class="no">I</span><span class="o">|</span> <span class="nb">puts</span> <span class="no">I</span><span class="p">}</span>
<span class="c1"># Fiber.current.annotation => "Counting to 10"</span>
</code></pre>
<p>Pull Request: <a href="https://github.com/ruby/ruby/pull/6554" class="external">https://github.com/ruby/ruby/pull/6554</a></p> 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 - Misc #18761 (Open): provide an example wasm projecthttps://redmine.ruby-lang.org/issues/187612022-04-30T19:25:46Zgrosser (Michael Grosser)michael@grosser.it
<p>Neither the release notes nor the wasm/README.md include any runnable examples.<br>
Please provide a docker image that can be used to generate a wasm binary (even if it's just "hello world"),<br>
to show how this is supposed to work.</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 - Feature #18459 (Assigned): IRB autocomplete dropdown colour optionshttps://redmine.ruby-lang.org/issues/184592022-01-04T19:28:54Zjohansenjaa (Joseph Johansen)
<p>It would be great to be able to specify bg/fg colours for the new autocomplete dropdown in irb in ruby 3.1. This could help for accessibility purposes, or for anyone who just wants to make it look more personalised for their terminal 😎</p>
<p>Perhaps irbrc could do the trick?</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">IRB</span><span class="p">.</span><span class="nf">conf</span><span class="p">[</span><span class="ss">:AUTOCOMPLETE</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
<span class="no">BG_COLOR</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="no">FG_COLOR</span><span class="p">:</span> <span class="mi">15</span><span class="p">,</span>
<span class="p">}</span>
</code></pre> Ruby master - Feature #18450 (Assigned): Force break in prettyprinthttps://redmine.ruby-lang.org/issues/184502021-12-29T13:16:58Zfirasalkhalil (Firas al-Khalil)
<a name="Abstract"></a>
<h1 >Abstract<a href="#Abstract" class="wiki-anchor">¶</a></h1>
<p>Support force-breaking a group in the std's <a href="https://github.com/ruby/prettyprint" class="external">prettyprint</a></p>
<a name="Background"></a>
<h1 >Background<a href="#Background" class="wiki-anchor">¶</a></h1>
<p>There is a need to forcibly break a group and transform breakables into<br>
newlines. The library doesn't provide this possibility, directly, through<br>
its public API.</p>
<a name="Proposal"></a>
<h1 >Proposal<a href="#Proposal" class="wiki-anchor">¶</a></h1>
<p>Add a single convenience function to the library's public class <code>PrettyPrint</code></p>
<a name="Implementation"></a>
<h1 >Implementation<a href="#Implementation" class="wiki-anchor">¶</a></h1>
<p>An implementation was submitted to the project's github repository as a<br>
<a href="https://github.com/ruby/prettyprint/pull/2" class="external">pull request</a>.</p>
<p>Here's the patch:</p>
<pre><code>diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb
index 188c2e6..1d675a7 100644
--- a/lib/prettyprint.rb
+++ b/lib/prettyprint.rb
@@ -236,6 +236,14 @@ class PrettyPrint
end
end
+ # This says "force a line break here".
+ #
+ # It will force the current group's "breakables" to break.
+ def break
+ breakable
+ current_group.break
+ end
+
# Groups line break hints added in the block. The line break hints are all
# to be used or not.
#
diff --git a/test/test_prettyprint.rb b/test/test_prettyprint.rb
index 27e7198..cf889d1 100644
--- a/test/test_prettyprint.rb
+++ b/test/test_prettyprint.rb
@@ -518,4 +518,31 @@ End
end
+
+class Break < Test::Unit::TestCase # :nodoc:
+ def format()
+ PrettyPrint.format(''.dup) {|q|
+ q.group {
+ q.text 'abc'
+ q.breakable
+ q.text 'def'
+ q.group {
+ q.break
+ q.text 'ghi'
+ }
+ q.breakable
+ q.text 'jkl'
+ }
+ }
+ end
+
+ def test_00_04
+ expected = <<'End'.chomp
+abc def
+ghi jkl
+End
+ assert_equal(expected, format())
+ end
+end
+
</code></pre>
<a name="Evaluation"></a>
<h1 >Evaluation<a href="#Evaluation" class="wiki-anchor">¶</a></h1>
<p>It's a simple implementation with no caveats.</p>
<a name="Discussion"></a>
<h1 >Discussion<a href="#Discussion" class="wiki-anchor">¶</a></h1>
<p>Even though it's a simple functionality, and the implementation is straightforward,<br>
getting to this point is not that obvious. This is why it might be helpful for other<br>
users who face such a need.</p>
<p>Indeed, an issue was <a href="https://github.com/ruby/prettyprint/issues/1" class="external">opened</a> not so long ago,<br>
and the proposed solution worked but not quite as expected. The provided implementation<br>
works as expected without tampering with the API's internals, and it's proven in production<br>
environment.</p>
<a name="Summary"></a>
<h1 >Summary<a href="#Summary" class="wiki-anchor">¶</a></h1>
<p>This is a feature request for the <code>prettyprint</code> library: adding support for <em>force breaking</em><br>
a group. An implementation is provided as both a patch and a PR on github.</p> Ruby master - Feature #18439 (Assigned): YJIT: Support Microsoft x86 calling conventionhttps://redmine.ruby-lang.org/issues/184392021-12-27T08:47:04Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<p>I heard that supporting YJIT for VC++ needs mmap from k0kubun-san, so I implemented tiny mmap emulation on Windows and committed it to master.<br>
And, I found we need more changes to actually enabled YJIT for VC++, at least:</p>
<ul>
<li>YJIT requires <code>OPT_DIRECT_THREADED_CODE</code> or <code>OPT_CALL_THREADED_CODE</code> in <code>rb_yjit_compile_iseq()</code>. Really?</li>
<li>Maybe ABI deffers between VC++ and YJIT's expectation.</li>
</ul>
<p>Can I get support to fix above?</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 - Feature #18227 (Open): Static class initialization.https://redmine.ruby-lang.org/issues/182272021-09-27T03:49:35Zioquatix (Samuel Williams)samuel@oriontransfer.net
<p>As a follow on from <a href="https://bugs.ruby-lang.org/issues/18189" class="external">https://bugs.ruby-lang.org/issues/18189</a> I would like to propose some kind of static class initialization. I'll investigate whether it's possible and create a PR.</p> 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 #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 - Misc #17720 (Assigned): Cirrus CI to check non-x86_64 architecture cases by own mac...https://redmine.ruby-lang.org/issues/177202021-03-12T17:50:05Zjaruga (Jun Aruga)
<p>Hello!</p>
<p>This ticket is related to the tickets <a class="issue tracker-5 status-5 priority-4 priority-default closed" title="Misc: Enabling ARM 64/32-bit cases by Drone CI (Closed)" href="https://redmine.ruby-lang.org/issues/16234">#16234</a> <a class="issue tracker-5 status-5 priority-4 priority-default closed" title="Misc: Enabling IBM PowerPC/Z cases in Travis CI (Closed)" href="https://redmine.ruby-lang.org/issues/16360">#16360</a>. But I opened a new ticket because it is related to general non-x86_64 architecture CI cases.</p>
<p>I have a suggestion.</p>
<p>I see the <code>.travis.yml</code> was removed [1], and I also saw another open source project remove their <code>.travis.yml</code> because they could not get the credits to continue to run Travis [2]. I feel Travis is not really a possible option for every open source project for now.</p>
<p>While we have RubyCI, I think we still have a motivation to run a CI on non-x86_64 architectures at a pull-request timing. So, I investigated alternative CI. When checking GitHub Actions, I do not feel it will happen soon on GitHub Actions [3]. Then I found an interesting CI called "Cirrus CI", that might enable us to run CI on non-x86_64 architectures such as Mac M1 (arm) ppc64le and s390x beyond the cloud.</p>
<p>Cirrus CI has 2 types of features: "cloud" and "persistent workers". I see the Cirrus CI "cloud" feature has been used in the QEMU and podman projects [4][5]. It has a unique freeBSD host. However the remarkable feature for the Ruby project is the "persistent workers" [6] announced a few months ago, that is beyond the cloud. Because this feature enables us to use our own machines as a CI running host. You can see the examples running the CI with the machines such as Mac M1, iPhone, ppc64le and s390x on the page [6]. Maybe the used machine does not even have the global static IP. You can see other articles [7][8] too.</p>
<p>I can see some benefits to start Cirrus CI for the Ruby project.</p>
<ul>
<li>Possibly we can check Mac M1 (arm), ppc64le, s390x cases using machines used in RubyCI [9] and someone's machine such as @ReiOdaira's ppc64le/s390x machines at the pull-request timing.</li>
<li>When we face the CI issue, we can login to the machine and use the interactive debugging tool such as gdb to fix it.</li>
<li>The config file is YAML format and it has the matrix feature [10]. We are familiar with the YAML and matrix.</li>
</ul>
<p>What do you think? Positive or negative?<br>
Thank you.</p>
<p>[1] ruby removed .travis.yml: <a href="https://github.com/ruby/ruby/commit/6b978d542704a5614af5e9375c4b31b8d2618652" class="external">https://github.com/ruby/ruby/commit/6b978d542704a5614af5e9375c4b31b8d2618652</a><br>
[2] simde removed .travis.yml: <a href="https://github.com/simd-everywhere/simde/commit/17a27e7f2c3114225899f2ace14010cbbb2139b5" class="external">https://github.com/simd-everywhere/simde/commit/17a27e7f2c3114225899f2ace14010cbbb2139b5</a><br>
[3] GitHub Actions and ppc64le: <a href="https://github.community/t/self-hosted-runner-on-ppc64el-architecture/155337" class="external">https://github.community/t/self-hosted-runner-on-ppc64el-architecture/155337</a><br>
[4] QEMU: <a href="https://gitlab.com/qemu-project/qemu/-/blob/master/.cirrus.yml" class="external">https://gitlab.com/qemu-project/qemu/-/blob/master/.cirrus.yml</a><br>
[5] Podman: <a href="https://github.com/containers/podman/blob/master/.cirrus.yml" class="external">https://github.com/containers/podman/blob/master/.cirrus.yml</a><br>
[6] The issue ticket of Persistent Workers: <a href="https://github.com/cirruslabs/cirrus-ci-docs/issues/263#issuecomment-746900845" class="external">https://github.com/cirruslabs/cirrus-ci-docs/issues/263#issuecomment-746900845</a><br>
[7] Persistent Workers blog: <a href="https://medium.com/cirruslabs/announcing-public-beta-of-cirrus-ci-persistent-workers-7327a38004be" class="external">https://medium.com/cirruslabs/announcing-public-beta-of-cirrus-ci-persistent-workers-7327a38004be</a><br>
[8] Persistent Workers guide: <a href="https://cirrus-ci.org/guide/persistent-workers/" class="external">https://cirrus-ci.org/guide/persistent-workers/</a><br>
[9] RubyCI: <a href="https://rubyci.org/" class="external">https://rubyci.org/</a><br>
[10] Cirrus CI matrix feature: <a href="https://cirrus-ci.org/guide/writing-tasks/#matrix-modification" class="external">https://cirrus-ci.org/guide/writing-tasks/#matrix-modification</a></p> Ruby master - Feature #17684 (Assigned): Remove `--disable-gems` from release version of Rubyhttps://redmine.ruby-lang.org/issues/176842021-03-10T12:51:46Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<p>In my understand, <code>--disable-gems</code> is only debugging feature for ruby-core team.</p>
<p>But some users enabled its option in test environment for performance or etc. So, <code>--disable-gems</code> option is wrong usage for some users.</p>
<ul>
<li><a href="https://github.com/rubygems/bundler/issues/7487#issuecomment-569901549" class="external">https://github.com/rubygems/bundler/issues/7487#issuecomment-569901549</a></li>
<li><a href="https://github.com/rubygems/rubygems/pull/4440#issue-587031184" class="external">https://github.com/rubygems/rubygems/pull/4440#issue-587031184</a></li>
</ul>
<p>We should remove it from package version of ruby.</p> Ruby master - Misc #17569 (Open): `uri` lib maintainershiphttps://redmine.ruby-lang.org/issues/175692021-01-22T15:48:33Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<p>I’d like to merge <a href="https://github.com/ruby/uri/pull/15" class="external">https://github.com/ruby/uri/pull/15</a> but it is an API change. I would release v1.0.0. <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/271">@akr (Akira Tanaka)</a> is the official maintainer of <code>uri</code>… Is he still interested in this role? Otherwise we could put “Ruby core team” in the listing…</p> Ruby master - Feature #17525 (Open): Implement Happy Eyeballs Version 2 (RFC8305) in Socket.tcphttps://redmine.ruby-lang.org/issues/175252021-01-10T13:17:37ZGlass_saga (Masaki Matsushita)glass.saga@gmail.com
<p><a href="https://github.com/ruby/ruby/pull/4038" class="external">https://github.com/ruby/ruby/pull/4038</a></p>
<p>This change implements Happy Eyeballs Version 2 (RFC8305) in Socket.tcp.<br>
It enables fallback from IPv6 to IPv4 without a long waiting time.</p> Ruby master - Feature #17473 (Open): Make Pathname to embedded class of Rubyhttps://redmine.ruby-lang.org/issues/174732020-12-26T12:00:42Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<p>pathname is one of most useful utility class of Ruby. I'm happy to use Pathname without require it.</p>
<p>Any thought?</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 - Feature #17297 (Assigned): Feature: Introduce Pathname.mktmpdirhttps://redmine.ruby-lang.org/issues/172972020-10-30T15:09:41Zschneems (Richard Schneeman)
<p>When I want to create a tmpdir I often want to manipulate it as a pathname. By introducing Pathname.mktmpdir I can get this behavior.</p>
<p>Currently I must:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">Dir</span><span class="p">.</span><span class="nf">mktmpdir</span> <span class="k">do</span> <span class="o">|</span><span class="n">dir</span><span class="o">|</span>
<span class="n">dir</span> <span class="o">=</span> <span class="no">Pathname</span><span class="p">(</span><span class="n">dir</span><span class="p">)</span>
<span class="c1"># ... code</span>
<span class="k">end</span>
</code></pre>
<p>I would like to be able to instead:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">Pathname</span><span class="p">.</span><span class="nf">mktmpdir</span> <span class="k">do</span> <span class="o">|</span><span class="n">dir</span><span class="o">|</span>
<span class="c1"># ... code</span>
<span class="k">end</span>
</code></pre>
<p>Diff:</p>
<pre><code>$ git diff master
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index e6fb90277d..ec32e7d611 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -597,3 +597,20 @@ def rmtree
end
end
+class Pathname # * tmpdir *
+ # Creates a tmp directory and wraps the returned path in a Pathname object.
+ #
+ # See Dir.mktmpdir
+ def self.mktmpdir
+ require 'tmpdir' unless defined?(Dir.mktmpdir)
+ if block_given?
+ Dir.mktmpdir do |dir|
+ dir = self.new(dir)
+ yield dir
+ end
+ else
+ self.new(Dir.mktmpdir)
+ end
+ end
+end
+
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 43cef4849f..8edcccf666 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -1272,6 +1272,14 @@ def test_s_glob_3args
}
end
+ def test_mktmpdir
+ Pathname.mktmpdir do |dir|
+ assert_equal Pathname(dir), dir
+ assert dir.directory?
+ assert dir.exist?
+ end
+ end
+
def test_s_getwd
wd = Pathname.getwd
assert_kind_of(Pathname, wd)
</code></pre>
<p>Github link: <a href="https://github.com/ruby/ruby/pull/3709" class="external">https://github.com/ruby/ruby/pull/3709</a></p> Ruby master - Feature #17296 (Assigned): Feature: Pathname#chmod use FileUtils.chmod instead of Filehttps://redmine.ruby-lang.org/issues/172962020-10-30T15:08:09Zschneems (Richard Schneeman)
<p>The <code>FileUtils.chmod</code> provides the same numerical interface as <code>File.chmod</code> and it also includes a "symbolic mode" interface. With this patch you'll be able to run this code:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">Pathname</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s2">"bin/compile"</span><span class="p">).</span><span class="nf">chmod</span><span class="p">(</span><span class="s2">"+x"</span><span class="p">)</span>
</code></pre>
<p>I believe that this is backwards compatible with the existing implementation and all changes are an extension. The only difference between File.chmod and FileUtils.chmod I could find is they have different return values and the previous implementation of <code>Pathname#chmod</code> returned the result of the <code>File.chmod</code> call. From the docs <code>File.chmod</code> returns the number of files modified, since we're only ever able to pass in a maximum of one file through this interface, the return value will always be a <code>1</code> or an exception if the file does not exist.</p>
<p>I checked and the exceptions when the file does not exist match:</p>
<pre><code>irb(main):004:0> File.chmod(0444, "doesnotexist.txt")
Traceback (most recent call last):
6: from /Users/rschneeman/.rubies/ruby-2.7.2/bin/irb:23:in `<main>'
5: from /Users/rschneeman/.rubies/ruby-2.7.2/bin/irb:23:in `load'
4: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
3: from (irb):3
2: from (irb):4:in `rescue in irb_binding'
1: from (irb):4:in `chmod'
Errno::ENOENT (No such file or directory @ apply2files - doesnotexist.txt)
irb(main):005:0> FileUtils.chmod(0444, "doesnotexist.txt")
Traceback (most recent call last):
10: from /Users/rschneeman/.rubies/ruby-2.7.2/bin/irb:23:in `<main>'
9: from /Users/rschneeman/.rubies/ruby-2.7.2/bin/irb:23:in `load'
8: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
7: from (irb):4
6: from (irb):5:in `rescue in irb_binding'
5: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/2.7.0/fileutils.rb:1016:in `chmod'
4: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/2.7.0/fileutils.rb:1016:in `each'
3: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/2.7.0/fileutils.rb:1017:in `block in chmod'
2: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/2.7.0/fileutils.rb:1346:in `chmod'
1: from /Users/rschneeman/.rubies/ruby-2.7.2/lib/ruby/2.7.0/fileutils.rb:1346:in `chmod'
Errno::ENOENT (No such file or directory @ apply2files - doesnotexist.txt)
</code></pre>
<p>If you're open to changing the interface of the return value my preference would be to return <code>self</code> from this method so that it can be chained. Otherwise this current patch is a smaller change.</p>
<p>Diff:</p>
<pre><code>$ git diff master
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index e6fb90277d..cb6e32d9ac 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -585,6 +585,15 @@ def mkpath
nil
end
+ # Changes file permissions.
+ #
+ # See FileUtils.chmod
+ def chmod(mode)
+ require 'fileutils'
+ FileUtils.chmod(mode, self)
+ return 1
+ end
+
# Recursively deletes a directory, including all directories beneath it.
#
# See FileUtils.rm_r
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index f71cec1b25..6778d4f102 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -12,7 +12,6 @@ static ID id_binwrite;
static ID id_birthtime;
static ID id_blockdev_p;
static ID id_chardev_p;
-static ID id_chmod;
static ID id_chown;
static ID id_ctime;
static ID id_directory_p;
@@ -552,20 +551,6 @@ path_mtime(VALUE self)
return rb_funcall(rb_cFile, id_mtime, 1, get_strpath(self));
}
-/*
- * call-seq:
- * pathname.chmod(mode_int) -> integer
- *
- * Changes file permissions.
- *
- * See File.chmod.
- */
-static VALUE
-path_chmod(VALUE self, VALUE mode)
-{
- return rb_funcall(rb_cFile, id_chmod, 2, mode, get_strpath(self));
-}
-
/*
* call-seq:
* pathname.lchmod(mode_int) -> integer
@@ -1448,7 +1433,6 @@ path_f_pathname(VALUE self, VALUE str)
* - #birthtime
* - #ctime
* - #mtime
- * - #chmod(mode)
* - #lchmod(mode)
* - #chown(owner, group)
* - #lchown(owner, group)
@@ -1495,6 +1479,7 @@ path_f_pathname(VALUE self, VALUE str)
* === Utilities
*
* These methods are a mixture of Find, FileUtils, and others:
+ * - #chmod(mode)
* - #find(&block)
* - #mkpath
* - #rmtree
@@ -1542,7 +1527,6 @@ Init_pathname(void)
rb_define_method(rb_cPathname, "birthtime", path_birthtime, 0);
rb_define_method(rb_cPathname, "ctime", path_ctime, 0);
rb_define_method(rb_cPathname, "mtime", path_mtime, 0);
- rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
rb_define_method(rb_cPathname, "lchmod", path_lchmod, 1);
rb_define_method(rb_cPathname, "chown", path_chown, 2);
rb_define_method(rb_cPathname, "lchown", path_lchown, 2);
@@ -1618,7 +1602,6 @@ InitVM_pathname(void)
id_birthtime = rb_intern("birthtime");
id_blockdev_p = rb_intern("blockdev?");
id_chardev_p = rb_intern("chardev?");
- id_chmod = rb_intern("chmod");
id_chown = rb_intern("chown");
id_ctime = rb_intern("ctime");
id_directory_p = rb_intern("directory?");
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 43cef4849f..5673691231 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -823,6 +823,11 @@ def test_chmod
path.chmod(0444)
assert_equal(0444, path.stat.mode & 0777)
path.chmod(old)
+
+ skip "Windows has different symbolic mode" if /mswin|mingw/ =~ RUBY_PLATFORM
+ path.chmod("u=wrx,g=rx,o=x")
+ assert_equal(0751, path.stat.mode & 0777)
+ path.chmod(old)
}
end
</code></pre>
<p>Github link: <a href="https://github.com/ruby/ruby/pull/3708" class="external">https://github.com/ruby/ruby/pull/3708</a></p> Ruby master - Feature #17295 (Assigned): Feature: Create a directory and file with Pathname#touchhttps://redmine.ruby-lang.org/issues/172952020-10-30T15:06:39Zschneems (Richard Schneeman)
<p>Right now if a developer wants to create a file and is not sure if the path exists yet or not they must:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">Pathname</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s2">"/a/b/c/d.txt"</span><span class="p">).</span><span class="nf">tap</span> <span class="p">{</span><span class="o">|</span><span class="nb">p</span><span class="o">|</span> <span class="nb">p</span><span class="p">.</span><span class="nf">dirname</span><span class="p">.</span><span class="nf">mkpath</span><span class="p">;</span> <span class="no">FileUtils</span><span class="p">.</span><span class="nf">touch</span><span class="p">(</span><span class="nb">p</span><span class="p">)}</span>
</code></pre>
<p>After this patch a developer can instead call:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">Pathname</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s2">"/a/b/c/d.txt"</span><span class="p">).</span><span class="nf">touch</span>
</code></pre>
<p>An alternative name for this behavior could be <code>mkfile</code> but I think it is confusing to have a <code>mkfile</code> and a <code>mkpath</code> where one creates a directory and one creates a file.</p>
<p>Diff:</p>
<pre><code>$ git diff master
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index e6fb90277d..2ed02a6633 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -585,6 +585,27 @@ def mkpath
nil
end
+ # Creates a file and the full path to the file including any intermediate directories that don't yet
+ # exist.
+ #
+ # Example:
+ #
+ # Dir.exist?("/a/b/c") # => false
+ #
+ # p = Pathname.new("/a/b/c/d.txt")
+ # p.file? => false
+ # p.touch
+ # p.file? => true
+ #
+ # Dir.exist?("/a/b/c") # => true
+ def touch
+ require 'fileutils'
+ dirname.mkpath
+
+ FileUtils.touch(self)
+ self
+ end
+
# Recursively deletes a directory, including all directories beneath it.
#
# See FileUtils.rm_r
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 43cef4849f..3c518cc3da 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -1394,6 +1394,14 @@ def test_mkpath
}
end
+ def test_touch
+ with_tmpchdir('rubytest-pathname') {|dir|
+ Pathname("a/b/c/d.txt").touch
+ assert_file.directory?("a/b/c")
+ assert_file.file?("a/b/c/d.txt")
+ }
+ end
+
def test_rmtree
with_tmpchdir('rubytest-pathname') {|dir|
Pathname("a/b/c/d").mkpath
</code></pre>
<p>Github link: <a href="https://github.com/ruby/ruby/pull/3706" class="external">https://github.com/ruby/ruby/pull/3706</a></p> Ruby master - Feature #17294 (Assigned): Feature: Allow method chaining with Pathname#mkpath Path...https://redmine.ruby-lang.org/issues/172942020-10-30T15:04:06Zschneems (Richard Schneeman)
<p>Currently in my code when I want to create a pathname object and create a path at the same time I must use tap</p>
<pre><code>path = Pathname.new("/tmp/new").tap(&:mkpath)
</code></pre>
<p>I think it would be cleaner to be able to chain on the results of these methods instead:</p>
<pre><code>path = Pathname.new("/tmp/new").mkpath
</code></pre>
<p>This is a change in return value but after research on github I do not believe many (if any) are relying on the current behavior to return nil <a href="https://github.com/search?l=&p=1&q=.mkpath+language%3ARuby&ref=advsearch&type=Code" class="external">https://github.com/search?l=&p=1&q=.mkpath+language%3ARuby&ref=advsearch&type=Code</a>.</p>
<p>Here is my diff:</p>
<pre><code>$ git diff master schneems/return-self-pathname
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index e6fb90277d..f1eb1e00ae 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -582,7 +582,7 @@ class Pathname # * FileUtils *
def mkpath
require 'fileutils'
FileUtils.mkpath(@path)
- nil
+ self
end
# Recursively deletes a directory, including all directories beneath it.
@@ -593,7 +593,7 @@ def rmtree
# File::Path provides "mkpath" and "rmtree".
require 'fileutils'
FileUtils.rm_r(@path)
- nil
+ self
end
end
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 43cef4849f..149fe15c3a 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -1389,7 +1389,8 @@ def test_find
def test_mkpath
with_tmpchdir('rubytest-pathname') {|dir|
- Pathname("a/b/c/d").mkpath
+ path = Pathname("a/b/c/d")
+ assert_equal(path, path.mkpath)
assert_file.directory?("a/b/c/d")
}
end
@@ -1398,7 +1399,8 @@ def test_rmtree
with_tmpchdir('rubytest-pathname') {|dir|
Pathname("a/b/c/d").mkpath
assert_file.exist?("a/b/c/d")
- Pathname("a").rmtree
+ path = Pathname("a")
+ assert_equal(path, path.rmtree)
assert_file.not_exist?("a")
}
end
</code></pre>
<p>Github PR: <a href="https://github.com/ruby/ruby/pull/3705" class="external">https://github.com/ruby/ruby/pull/3705</a>. If accepted I will make a pr to update the tests here as well <a href="https://github.com/ruby/rbs/blob/b0dee64fdd00cc41c0729fa2c239fc2dcb9c3b18/test/stdlib/Pathname_test.rb#L456-L463" class="external">https://github.com/ruby/rbs/blob/b0dee64fdd00cc41c0729fa2c239fc2dcb9c3b18/test/stdlib/Pathname_test.rb#L456-L463</a>.</p> Ruby master - Feature #17173 (Open): open-uri で ciphers を設定したいhttps://redmine.ruby-lang.org/issues/171732020-09-16T04:55:19Zznz (Kazuhiro NISHIYAMA)
<p>Debian GNU/Linux 10 (buster) の OpenSSL 1.1.1d の環境だと <a href="https://www.famitsu.com" class="external">https://www.famitsu.com</a> で <code>dh key too small</code> になってつながらないのですが、 <code>ciphers</code> に <code>DEFAULT:!DH</code> を設定するとつながるので、 <code>open-uri</code> 経由でも <code>ciphers</code> を設定したいです。</p>
<p>curl での確認:</p>
<pre><code>% curl --head https://www.famitsu.com/
curl: (35) error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small
zsh: exit 35 curl --head https://www.famitsu.com/
% curl --ciphers 'DEFAULT:!DH' --head https://www.famitsu.com/
HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Wed, 16 Sep 2020 04:48:25 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
Accept-Ranges: bytes
Vary: Accept-Encoding
Strict-Transport-Security: max-age=60
</code></pre>
<p>ruby での確認:</p>
<pre><code>% ruby -r open-uri -e 'open("https://www.famitsu.com/")'
Traceback (most recent call last):
13: from -e:1:in `<main>'
12: from /usr/lib/ruby/2.5.0/open-uri.rb:35:in `open'
11: from /usr/lib/ruby/2.5.0/open-uri.rb:735:in `open'
10: from /usr/lib/ruby/2.5.0/open-uri.rb:165:in `open_uri'
9: from /usr/lib/ruby/2.5.0/open-uri.rb:224:in `open_loop'
8: from /usr/lib/ruby/2.5.0/open-uri.rb:224:in `catch'
7: from /usr/lib/ruby/2.5.0/open-uri.rb:226:in `block in open_loop'
6: from /usr/lib/ruby/2.5.0/open-uri.rb:755:in `buffer_open'
5: from /usr/lib/ruby/2.5.0/open-uri.rb:337:in `open_http'
4: from /usr/lib/ruby/2.5.0/net/http.rb:909:in `start'
3: from /usr/lib/ruby/2.5.0/net/http.rb:920:in `do_start'
2: from /usr/lib/ruby/2.5.0/net/http.rb:985:in `connect'
1: from /usr/lib/ruby/2.5.0/net/protocol.rb:44:in `ssl_socket_connect'
/usr/lib/ruby/2.5.0/net/protocol.rb:44:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: dh key too small (OpenSSL::SSL::SSLError)
zsh: exit 1 ruby -r open-uri -e 'open("https://www.famitsu.com/")'
% ruby -r net/http -e 'http=Net::HTTP.new("www.famitsu.com", 443); http.use_ssl=true; http.ciphers="DEFAULT:!DH"; p http.get("/")'
#<Net::HTTPOK 200 OK readbody=true>
</code></pre>
<p><a href="https://www.ssllabs.com/ssltest/analyze.html?d=www.famitsu.com" class="external">https://www.ssllabs.com/ssltest/analyze.html?d=www.famitsu.com</a> によると Cipher Suites は</p>
<pre><code># TLS 1.2 (suites in server-preferred order)
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x9f) DH 1024 bits FS WEAK 256
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x9e) DH 1024 bits FS WEAK 128
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x6b) DH 1024 bits FS WEAK 256
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x67) DH 1024 bits FS WEAK 128
TLS_RSA_WITH_AES_256_GCM_SHA384 (0x9d) WEAK 256
TLS_RSA_WITH_AES_128_GCM_SHA256 (0x9c) WEAK 128
TLS_RSA_WITH_AES_256_CBC_SHA256 (0x3d) WEAK 256
TLS_RSA_WITH_AES_128_CBC_SHA256 (0x3c) WEAK 128
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) ECDH secp384r1 (eq. 7680 bits RSA) FS 256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) ECDH secp384r1 (eq. 7680 bits RSA) FS 128
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (0xc028) ECDH secp384r1 (eq. 7680 bits RSA) FS WEAK 256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (0xc027) ECDH secp384r1 (eq. 7680 bits RSA) FS WEAK 128
</code></pre>
<p>となっていて、 Handshake Simulation では</p>
<pre><code>Chrome 80 / Win 10 R RSA 2048 (SHA256) TLS 1.2 TLS_RSA_WITH_AES_256_GCM_SHA384 No FS
Firefox 73 / Win 10 R RSA 2048 (SHA256) TLS 1.2 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ECDH secp256r1 FS
OpenSSL 1.1.1c R RSA 2048 (SHA256) TLS 1.2 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 DH 1024 FS
</code></pre>
<p>のようになっていて、 <code>TLS_DHE_RSA_WITH_AES_256_GCM_SHA384</code> が選ばれて DH 1024 bit を拒否するクライアントからは繋らない設定になっているサーバーがあるようです。(<code>dh key too small</code> で web 検索すると同様の設定のサーバーは他にもあるようです。)</p> Ruby master - Misc #17154 (Open): Update Pathname Documentation to Clarify Expected Behaviorhttps://redmine.ruby-lang.org/issues/171542020-09-05T02:29:29Zresperat (Ralph Esperat)
<p>I would like to suggest adding a sentence to the documentation for <a href="https://ruby-doc.org/stdlib-2.7.1/libdoc/pathname/rdoc/Pathname.html" class="external">Pathname</a> to make clear the unusual behavior of <code>Pathname#+</code> when an absolute path is included in the arguments. In such a situation, <code>Pathname#+</code> drops the paths prior to the last absolute path which I understand to be the intended behavior, but it is not obviously intended, only showing up tangentially as an example in the documentation.</p>
<pre><code>p3 = p1 + "/etc/passwd" # Pathname:/etc/passwd
</code></pre>
<p>The Pathname documentation states that " <strong>All functionality</strong> from File, FileTest, and some from Dir and FileUtils is included, <strong>in an unsurprising way</strong> ..." and later when referring to core methods such as <code>Pathname#+</code> "These methods are <strong>effectively manipulating a String</strong> , because that's all a path is." However, similar uses of both <a href="https://ruby-doc.org/core-2.7.1/File.html" class="external">File</a> and <a href="https://ruby-doc.org/core-2.7.1/String.html" class="external">String</a> would produce the expected result of including all of the arguments:</p>
<pre><code>s1 = "/usr"
s2 = s1 + "/etc/passwd" # "/usr/etc/passwd"
f1 = File.new("/usr" + "/etc/passwd") # (No such file or directory @ rb_sysopen - /usr/etc/passwd)
</code></pre>
<p>A bug report was previously filed to "fix" this functionality (<a class="issue tracker-1 status-6 priority-4 priority-default closed" title="Status: Rejected" href="https://redmine.ruby-lang.org/issues/15564">Bug #15564: Pathname#+(pathpart) returns pathpart when pathpart is absolute</a>), not understanding it to be intentional. Other common help websites such as <a href="https://stackoverflow.com/questions/12464361/concatenating-absolute-paths-with-the-pathname-class" class="external">Stack Overflow</a> also show users who do not expect this behavior from this method. Adding a statement to the documentation for the <a href="https://ruby-doc.org/stdlib-2.7.1/libdoc/pathname/rdoc/Pathname.html#method-i-2B" class="external">Pathname#+</a> method will make it clear to users exactly what to expect and that this is the intended behavior. I would suggest simply the following, the first sentence of which is already present:</p>
<p><code>Appends a pathname fragment to self to produce a new Pathname object. If an absolute path is provided as any of the arguments, discards all arguments prior to the last absolute path provided.</code></p>
<p>I appreciate your consideration of this request.</p>
<p>ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]</p> Ruby master - Misc #17137 (Assigned): Cooperation on maintaining official docker ruby imageshttps://redmine.ruby-lang.org/issues/171372020-08-31T19:52:31Zdeivid (David Rodríguez)
<p>It was pointed out to me at <a href="https://github.com/docker-library/ruby/issues/323" class="external">https://github.com/docker-library/ruby/issues/323</a> that the ruby-core team has started maintaining their own docker images at <a href="https://github.com/ruby/ruby-docker-images" class="external">https://github.com/ruby/ruby-docker-images</a>, and that the base Dockerfiles were initially started from the official docker images.</p>
<p>The maintainers of the official images would be interesting in collaborating on maintaining these images. Maybe merging the projects would be a nice idea from an end user point of view. I'm guessing there's a reason why <a href="https://github.com/ruby/ruby-docker-images" class="external">https://github.com/ruby/ruby-docker-images</a> was started as a separate project, but maybe any improvements over the official project could be merged back. The obvious new feature that I see in the README is the ability to build development images of specific revisions.</p>
<p>Anyways, I mentioned the approach of the docker folks to hsbt and he told me to open a ticket here. So here it is!</p>
<p>Regards!</p> Ruby master - Feature #16985 (Open): Improve `pp` for `Hash` and `String`https://redmine.ruby-lang.org/issues/169852020-06-25T17:28:06Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<p>Could we improve <code>pp</code> for <code>Hash</code> and <code>String</code>:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">pp</span><span class="p">({</span><span class="ss">hello: </span><span class="s1">'My name is "Marc-André"'</span><span class="p">})</span>
<span class="c1"># =></span>
<span class="p">{</span><span class="ss">hello: </span><span class="s1">'My name is "Marc-André"'</span><span class="p">}</span>
<span class="c1"># instead of</span>
<span class="p">{</span><span class="ss">:hello</span><span class="o">=></span><span class="s2">"My name is </span><span class="se">\"</span><span class="s2">Marc-André</span><span class="se">\"</span><span class="s2">"</span><span class="p">}</span>
</code></pre>
<p>If any key is non-symbol, they would continue to be output as <code><key> => <value></code>. If a string contains single quotes, or characters that need escaping (e.g. <code>"\n"</code>), current format would be used.</p>
<p>I'll gladly provide a PR if this is deemed acceptable.</p>
<p>I would even like this for <code>String#inspect</code> and <code>Hash#inspect</code> but it's not clear if this could lead to much incompatibility (maybe test suites?)</p> Ruby master - Feature #16937 (Assigned): Add DNS over HTTP to Resolvhttps://redmine.ruby-lang.org/issues/169372020-06-07T23:46:44Zdrbrain (Eric Hodel)drbrain@segment7.net
<p>This adds a DNS over HTTP resolver at Resolv::DoH</p>
<p>It obeys RFC8484 with respect to Cache-Control and Age behavior, but does not use HTTP2 as ruby does not have an HTTP2 client.</p>
<p>It does not allow configuration of the Net::HTTP instance beyond timeouts, but I am willing to add more configuration if this is desired.</p> Ruby master - Feature #16833 (Open): Add Enumerable#empty?https://redmine.ruby-lang.org/issues/168332020-05-06T14:09:02Zf3ndot (Justin Bull)
<p>It was surprising to me that Enumerator, something mixed into Array, does not include <code>#empty?</code>. I think it is reasonable to assume people may have to guard iterating and other logic based on the emptiness of an enumerator, such was my case.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"> <span class="c1"># pretend there's convoluted enumerator logic to produce this structure</span>
<span class="n">table_rows</span> <span class="o">=</span> <span class="p">[{</span> <span class="ss">data: </span><span class="p">[</span><span class="s1">'First'</span><span class="p">,</span> <span class="s1">'Second'</span><span class="p">,</span> <span class="s1">'Third'</span><span class="p">],</span> <span class="ss">config: </span><span class="p">{}</span> <span class="p">},</span> <span class="p">{</span> <span class="ss">data: </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="ss">config: </span><span class="p">{</span> <span class="ss">color: </span><span class="s1">'red'</span> <span class="p">}</span> <span class="p">}].</span><span class="nf">to_enum</span>
<span class="k">return</span> <span class="k">if</span> <span class="n">table_rows</span><span class="p">.</span><span class="nf">empty?</span>
<span class="n">table_header</span> <span class="o">=</span> <span class="n">table_rows</span><span class="p">.</span><span class="nf">first</span><span class="p">[</span><span class="ss">:data</span><span class="p">]</span> <span class="c1"># requires an empty guard</span>
<span class="c1"># ...</span>
</code></pre>
<p>I propose that it simply behaves as <code>#take(1).to_a.empty?</code> instead of aliasing to something like <code>#none?</code> because of falsey elements or <code>#size == 0</code> because of potential <code>nil</code> returns:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="p">[].</span><span class="nf">to_enum</span><span class="p">.</span><span class="nf">empty?</span> <span class="c1"># => true</span>
<span class="p">[</span><span class="kp">false</span><span class="p">].</span><span class="nf">to_enum</span><span class="p">.</span><span class="nf">empty?</span> <span class="c1"># => false</span>
<span class="p">[</span><span class="kp">nil</span><span class="p">].</span><span class="nf">to_enum</span><span class="p">.</span><span class="nf">empty?</span> <span class="c1"># => false</span>
<span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nf">to_enum</span><span class="p">.</span><span class="nf">empty?</span> <span class="c1"># => false</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="mi">3</span><span class="p">].</span><span class="nf">to_enum</span><span class="p">.</span><span class="nf">empty?</span> <span class="c1"># => false</span>
</code></pre> Ruby master - Feature #16657 (Assigned): Don't ship bundled gems as .gem files as well as in expa...https://redmine.ruby-lang.org/issues/166572020-02-27T06:50:02Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>Working at <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Extensions Do Not Compile on Mingw64 with mingw32-make (Closed)" href="https://redmine.ruby-lang.org/issues/16651">#16651</a>, I wonder why the release tarball ships with the bundled gem in form of .gem packages as well as the expanded sources. It would be nice, if one option is chosen. Ideally just the .gem packages, because these are vanilla upstream packages installable via RubyGems without rbinstall magic.</p> Ruby master - Misc #16512 (Assigned): Improving `www.ruby-lang.org` reference by merging with `ru...https://redmine.ruby-lang.org/issues/165122020-01-16T08:38:13Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/710">@zverok (Victor Shepelev)</a> prepared better-looking reference pages at <code>rubyreferences.github.io</code>. I think there's room for improvement of reference pages on <code>www.ruby-lang.org</code>. <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/572">@hsbt (Hiroshi SHIBATA)</a> Is there a chance to work with?</p>
<p>Matz.</p> Ruby master - Misc #16188 (Open): What are the performance implications of the new keyword argume...https://redmine.ruby-lang.org/issues/161882019-09-29T18:27:43ZEregon (Benoit Daloze)
<p>In <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: "Real" keyword argument (Closed)" href="https://redmine.ruby-lang.org/issues/14183">#14183</a>, keyword arguments became further separated from positional arguments.</p>
<p>Contrary to the original design though, keyword and positional arguments are not fully separated for methods not accepting keyword arguments.<br>
Example: <code>foo(key: :value)</code> will <code>def foo(hash)</code> will pass a positional argument.<br>
This is of course better for compatibility, but I wonder what are the performance implications.</p>
<p>The block argument is completely separate in all versions, so no need to concern ourselves about that.</p>
<p>In Ruby <= 2.6:</p>
<ul>
<li>The caller never needs to know about the callee's arguments, it can just take all arguments and pass them as an array.<br>
The last argument might be used to extract keyword, but this is all done at the callee side.</li>
<li>Splitting kwargs composed of Symbol and non-Symbol keys can be fairly expensive, but it is a rare occurrence.<br>
If inlining the callee and kwargs are all passed as a literal Hash at the call site, there shouldn't be any overhead compared to positional arguments once JIT'ed.</li>
</ul>
<p>In Ruby 2.7:</p>
<ul>
<li>The caller needs to pass positional and keyword arguments separately, at least when calling a method accepting kwargs.<br>
But, if it calls a methods not accepting kwargs, then the "kwargs" (e.g. <code>foo(key: :value)</code>) should be treated just like a final Hash positional argument.</li>
<li>(If we had complete separation, then we could always pass positional and keyword arguments separately, so the caller could once again ignore the callee)</li>
</ul>
<p>How is the logic implemented in MRI for 2.7?</p>
<p>Specializing the caller for a given callee is a well-known technique.<br>
However, it becomes more difficult if different methods are called from the same callsite (polymorphic call), especially if one accepts kwargs and another does not.<br>
In that case, I think we will see a performance cost to this approach, by having to pass arguments differently based on the method to be called.</p>
<p>What about delegation using <code>ruby2_keywords</code>?<br>
Which checks does that add (compared to 2.6) in the merged approach with the Hash flag?</p> Ruby master - Feature #16012 (Assigned): Add a (small) test-install suite?https://redmine.ruby-lang.org/issues/160122019-07-19T14:27:56ZMSP-Greg (Greg L)
<p>At various times there has been discussion about whether testing should require <code>make install</code>. Although I prefer to do testing using install (vs build), I see it as a choice, and not a requirement.</p>
<p>From time to time various issues have arisen that cannot be found with 'build' testing. Often, these issues cause CI test failure with master/trunk/ruby-head in external repos. Sometimes people blame 'Core', other times Travis, or rvm. Regardless, it doesn't look good.</p>
<p>So, might a small set of tests that check install functionality be added? It may need to be two separate (but equivalent) scripts. One for *nix, one for Windows.</p>
<p>In ruby-loco, I'm using a ps1 script to check that CLI bin files work. As soon as the update is pushed here, I'll add a test for nested bundler commands...</p> Ruby master - Feature #15628 (Assigned): init_inetsock_internal should fallback to IPv4 if IPv6 i...https://redmine.ruby-lang.org/issues/156282019-02-28T11:51:17Zsonalkr132 (Aditya Prakash)
<p>Hi,</p>
<p>This is not really bug but more of a missing feature. Let me layout steps to reproduce what I am trying to achieve:</p>
<ul>
<li>Add local entries for <code>example.com</code>
</li>
</ul>
<pre><code>$ echo "::1 example.com www.example.com
127.0.0.1 example.com www.example.com" | sudo tee --append /etc/hosts
</code></pre>
<ul>
<li>Add rule to <code>DROP</code> ipv6 packets: <code>sudo ip6tables -P INPUT DROP</code>
</li>
<li>Start a server: <code>ruby -rwebrick -e 'WEBrick::HTTPServer.new(Port: 8000).start'</code>
</li>
<li>Making request using Net:HTTP with timeout (<code>Net::OpenTimeout</code>) after after 60 seconds: <code>ruby -rnet/http -e "Net::HTTP.get(URI('http://example.com:8000'))"</code>
</li>
</ul>
<p>As far as I understand, <a href="https://github.com/ruby/ruby/blob/4444025d16ae1a586eee6a0ac9bdd09e33833f3c/ext/socket/ipsocket.c#L42" class="external">init_inetsock_internal</a> needs to fallback to ipv4 for Net::HTTP.get to work. IPv6 route being broke is expected and hence, <a href="https://tools.ietf.org/html/rfc8305" class="external">RFC8305</a> recommends fallback to IPv4.<br>
Support for IPv6 fallback is spotty across languages and http clients, for example, <a href="https://github.com/golang/go/blob/master/src/net/dial.go#L47" class="external">golang supports it</a> but python doesn't, making request with <code>curl</code> works but <code>wget</code> hangs.</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 - Misc #15487 (Assigned): Clarify default gems maintanance policyhttps://redmine.ruby-lang.org/issues/154872018-12-29T12:30:23Zzverok (Victor Shepelev)zverok.offline@gmail.com
<p>In addition to <a class="issue tracker-5 status-7 priority-4 priority-default closed" title="Misc: Default gems README.md (Feedback)" href="https://redmine.ruby-lang.org/issues/15486">#15486</a>, I'd like to raise the question of the general <em>maintanance policy</em> for "default" Ruby gems, in particular:</p>
<ul>
<li>who is responsible for each gem and how they should be contacted?</li>
<li>what are goals and policies for gems code quality and documentation?</li>
<li>where do default gems are discussed?</li>
<li>what are some promises/guarantees default gems maintainers try to fulfill?</li>
</ul>
<p>The most demonstrative example I'd like to point is <code>json</code> gem:</p>
<ul>
<li>The source at <a href="https://github.com/ruby/json" class="external">ruby/json</a> is NOT authoritative as far as I can tell, the authoritative one is <a href="https://github.com/flori/json" class="external">flori/json</a>
</li>
<li>The gem still holds signs of the times it was independent (<code>Pure</code> and <code>Ext</code> JSON implementations, but <code>Pure</code> is not copied into the <code>ruby/lib</code> on releases, rendering standard docs pretty weird), and has NO mention it is THE json gem of Ruby</li>
<li>The gem seems unmaintained, considering the amount of <a href="https://github.com/flori/json/pulls" class="external">PRs</a> and <a href="https://github.com/flori/json/issues" class="external">issues</a>, lot of them without any reaction for months</li>
<li>When I tried to update JSON docs, in <a href="https://bugs.ruby-lang.org/issues/14581" class="external">core tracker issue</a> I was asked to make a PR to "upstream repository", but there, the PRs (<a href="https://github.com/flori/json/pull/347" class="external">#347</a>, <a href="https://github.com/flori/json/pull/349" class="external">#349</a>) was simply ignored; Ruby 2.6 was released without new docs, despite the fact PRs were made at <strong>March</strong> and require almost no code review (unlike even some promising optimization PRs, that were also hanging there since Feb/Mar)</li>
</ul>
<p>It is just one unfortunate case (TBH, my experience with contributing to other libraries, like <code>csv</code> and <code>psych</code> was much smoother), but it demonstrates some common lack of transparency in maintaining of Ruby's standard library</p> Ruby master - Feature #15408 (Open): Deprecate object_id and _id2refhttps://redmine.ruby-lang.org/issues/154082018-12-13T00:53:26Zheadius (Charles Nutter)headius@headius.com
<p>Ruby currently provides the object_id method to get a "identifier" for a given object. According to the documentation, this ID is the same for every object_id call against a given object, and guaranteed not to be the same as any other active (i.e. alive) object. However, no guarantee is made about the ID being reused for a future object after the original has been garbage collected.</p>
<p>As a result, object_id can't be used to uniquely identify any object that might be garbage collected, since that ID may be associated with a completely different object in the future.</p>
<p>Ruby also provides a method to go from an object_id to the object reference itself: ObjectSpace._id2ref. This method has been in Ruby for decades and is often used to implement a weak hashmap from ID to reference, since holding the ID will not keep the object alive. However due to the problems with object_id not actually being unique, it's possible for _id2ref to return a different object than originally had that ID as object slots are reused in the heap.</p>
<p>The only way to implement object_id safely (with idempotency guarantees) would be to assign to all objects a monotonically-increasing ID. Alternatively, this ID could be assigned lazily only for those objects on which the code calls object_id. JRuby implements object_id in this way currently.</p>
<p>The only way to implement _id2ref safely would be to have a mapping in memory from those monotonically-increasing IDs to the actual objects. This would have to be a weak mapping to prevent the objects from being garbage collected. JRuby currently only supports _id2ref via a flag, since the additional overhead of weakly tracking every requested object_id is extremely high. An alternative for MRI would be to implement _id2ref as a heap scan, as it is implemented in Rubinius. This would make it entirely unpractical due to the cost of scanning the heap for every ID lookup.</p>
<p>I propose that both methods should immediately be deprecated for removal in Ruby 3.0.</p>
<ul>
<li>They do not do what people expect.</li>
<li>They cannot reliably do what they claim to do.</li>
<li>They eventually lead to difficult-to-diagnose bugs in every possible use case.</li>
</ul>
<p>Put simply, both methods have always been broken in MRI and making them unbroken would render them useless.</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 #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 - Misc #14917 (Assigned): Add RDoc documents to tar ballhttps://redmine.ruby-lang.org/issues/149172018-07-18T04:08:50Zaycabta (aycabta .)aycabta@gmail.com
<p>I guess that distribution packages should include RDoc documents' files because RDoc documents installation step needs too long time.</p>
<p>There is the other reason. RDoc sometimes fails during "generating RDoc documentation" phase of installation.</p>
<p>Some case examples:</p>
<ul>
<li><a href="https://bugs.ruby-lang.org/issues/11494" class="external">https://bugs.ruby-lang.org/issues/11494</a></li>
<li><a href="https://bugs.ruby-lang.org/issues/14663" class="external">https://bugs.ruby-lang.org/issues/14663</a></li>
<li><a href="https://bugs.ruby-lang.org/issues/14874" class="external">https://bugs.ruby-lang.org/issues/14874</a></li>
<li><a href="https://bugs.ruby-lang.org/issues/11514" class="external">https://bugs.ruby-lang.org/issues/11514</a></li>
</ul>
<p>Maybe, generating RDoc documentation is so heavy task for low memory situation, and other tasks are lighter than it.</p> Ruby master - Feature #14737 (Assigned): Split default gems into separate directory structurehttps://redmine.ruby-lang.org/issues/147372018-05-04T10:38:57Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>On Fedora, we are using operating_system.rb <a href="https://src.fedoraproject.org/rpms/ruby/blob/master/f/operating_system.rb" class="external">1</a>, <a href="https://src.fedoraproject.org/rpms/ruby/blob/f27/f/operating_system.rb" class="external">2</a> to setup various RubyGems paths. Unfortunately, if we change Gem.default_dir (which we want to point into user home directory on Fedora), then this also changes location for default gems (!!), which are later not discovered by RubyGems <a href="https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org/message/RZUUKFMNKRB6TGKCQT3FLZYANP5WLEKN/" class="external">3</a>. It was not been a big deal for use, since we used to unbundle the gems shipped in Ruby, but with the gemification of StdLib, unbundlig becomes unsustainable (it is more work, but mainly it is incompatible change).</p>
<p>To fix this issue, I modified the operating_system.rb to behave similarly to what Arch does <a href="https://wiki.archlinux.org/index.php/ruby" class="external">4</a>, i.e. we started to inject "--user-install" option <a href="https://src.fedoraproject.org/rpms/ruby/blob/master/f/operating_system.rb" class="external">1</a>. Unfortunately, this revealed the RubyGems are not respecting their own interfaces and I had to fix at least one of them along the way to make it work <a href="https://github.com/rubygems/rubygems/pull/2116" class="external">6</a>. Apparently, using the "--user-install" option itself has some drawbacks and what is worse, it is not respected by Bundler, which was recently pointed out <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1574594" class="external">5</a>.</p>
<p>When I was fixing RubyGems <a href="https://github.com/rubygems/rubygems/pull/2116" class="external">6</a>, I just realized how the default gems are hacked up and how much is the original RubyGems configurability broken by this. This leads me to the proposal: <strong>Could we please install default gems into different directory then the other, user installed, gems?</strong> Since RubyGems were always designed to support various gem directory structures, the directory structure for default gems would become just other directory directory structure and would not collide with overrides in operating_system.rb, letting the distributions to override what was always designed to be overridable.</p>
<p>BTW I believe that one nice side effect of this change would be simplification of RubyGems code base. The default gems would live in "default_gems" directory, their .gemspec files could be in standard "default_gems/specifications" directory and we could forget about "default_gems/specifications/defaults", etc.</p>
<p>BTW2 I could fill this against RubyGems, but the default gems are Ruby stuff IMO, so I think this is appropriate tracker.</p> 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 #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 - Feature #13847 (Assigned): Gem activated problem for default gemshttps://redmine.ruby-lang.org/issues/138472017-08-29T08:53:45Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<p>If you try to use some default gems with a fixed version using Bundler, there are cases where the current RubyGems/Bundler/Ruby specification can not be used with the version specified by the user.</p>
<p>For example</p>
<pre><code>$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
$ gem list | grep openssl
openssl (2.0.5, 2.0.4, default: 2.0.3)
</code></pre>
<p>In the environment such as <code>require 'openssl'</code>, the version that is activated when openssl is searched with openssl is the version found first, ie 2.0.5.</p>
<pre><code>$ ruby -ropenssl -e 'p OpenSSL::VERSION'
"2.0.5"
</code></pre>
<p>At this time, for example, suppose the user really wants to use openssl 2.0.4 and wrote the following Gemfile.</p>
<pre><code>> cat Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
gem 'openssl', '2.0.4'
</code></pre>
<p>Unfortunately, since rubygems has required openssl before the bundler runs it will result in an activated error like this:</p>
<pre><code>> bundle exec ruby -ropenssl -e 'p OpenSSL::VERSION'
/path/to/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:317:in `check_for_activated_spec!': You have already activated openssl 2.0.5, but your Gemfile requires openssl 2.0.4. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
</code></pre>
<p>This problem can be avoided by bundling it as a vendoring library under bundler's repository if it is a default gem implemented with pure ruby.</p>
<p><a href="Https://github.com/bundler/bundler/blob/master/lib/bundler/vendor/fileutils/lib/fileutils.rb" class="external">Https://github.com/bundler/bundler/blob/master/lib/bundler/vendor/fileutils/lib/fileutils.rb</a></p>
<p>In the case of bundler, by separating the namespace as <code>Bundler::FileUtils</code>, even the version specified by the user is made available without conflict at the time of activate. However, this method can not be used with C extension library.</p>
<p>Since we want to use json/psych from the bundler team with rubygems/bundler to serialize data, we need about whether we can implement a way to avoid some kind of C extension on Ruby itself.</p>
<p>I discussed with <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/7068">@indirect (André Arko)</a> who is maintainer of RubyGems/Bundler. We can resolve this problem like following feature of ruby.</p>
<pre><code>require_for_bundler 'json', '2.0.2'
</code></pre>
<p>When we declared above <code>require_for_bundler</code>, We put a json-2.0.2 to placed in a namespace like <code>Bundler::JSON</code>. There were similar issues in the past as well.</p>
<p><a href="https://bugs.ruby-lang.org/issues/10320" class="external">https://bugs.ruby-lang.org/issues/10320</a></p>
<p>I think that the way of writing <code>require 'json', version: '2.0.2', into: :Bundler</code> which extended the method like this issue seems like that. Also, in this use case, it seems to be enough to use <code>require 'json', version: :default, into: :Bundler</code> which forces the use of default gem.</p>
<p>Matz, How do you think about this feature?</p> Ruby master - Feature #13696 (Open): Add exchange and noreplace options to File.renamehttps://redmine.ruby-lang.org/issues/136962017-06-29T03:07:38ZGlass_saga (Masaki Matsushita)glass.saga@gmail.com
<p>renameat2(2) introduced in linux kernel 3.15 takes following flags.</p>
<pre><code>RENAME_EXCHANGE: Atomically exchange oldpath and newpath.
RENAME_NOREPLACE: Don't overwrite newpath of the rename. Return an error if newpath already exists.
</code></pre>
<p>This change makes <code>File.rename</code> take these flags as keyword arguments.</p>
<p>Example:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="no">File</span><span class="p">.</span><span class="nf">write</span><span class="p">(</span><span class="s2">"hoge"</span><span class="p">,</span> <span class="s2">"hoge"</span><span class="p">)</span>
<span class="no">File</span><span class="p">.</span><span class="nf">write</span><span class="p">(</span><span class="s2">"fuga"</span><span class="p">,</span> <span class="s2">"fuga"</span><span class="p">)</span>
<span class="no">File</span><span class="p">.</span><span class="nf">rename</span><span class="p">(</span><span class="s2">"hoge"</span><span class="p">,</span> <span class="s2">"fuga"</span><span class="p">,</span> <span class="ss">exchange: </span><span class="kp">true</span><span class="p">)</span> <span class="c1"># atomically exchanged</span>
<span class="no">File</span><span class="p">.</span><span class="nf">read</span><span class="p">(</span><span class="s2">"fuga"</span><span class="p">)</span> <span class="c1">#=> "hoge"</span>
<span class="no">File</span><span class="p">.</span><span class="nf">rename</span><span class="p">(</span><span class="s2">"hoge"</span><span class="p">,</span> <span class="s2">"fuga"</span><span class="p">,</span> <span class="ss">noreplace: </span><span class="kp">true</span><span class="p">)</span> <span class="c1">#=> File exists @ syserr_fail2_in - fuga (Errno::EEXIST)</span>
</code></pre> 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 - Feature #13604 (Assigned): Exposing alternative interface of readlinehttps://redmine.ruby-lang.org/issues/136042017-05-27T10:01:41Zgraywolf (Gray Wolf)
<p>GNU Readline has multiple modes of operation. At the moment, the readline extension only supports typical, <code>Readline.readline</code> mode. However, there is also alternative callback-based interface which is also useful.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require_relative</span> <span class="s1">'readline'</span>
<span class="no">PROMPT</span> <span class="o">=</span> <span class="s2">"rltest$ "</span>
<span class="vg">$running</span> <span class="o">=</span> <span class="kp">true</span>
<span class="vg">$sigwinch_received</span> <span class="o">=</span> <span class="kp">false</span>
<span class="no">Readline</span><span class="p">.</span><span class="nf">handler_install</span><span class="p">(</span><span class="no">PROMPT</span><span class="p">,</span> <span class="ss">add_hist: </span><span class="kp">true</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">line</span><span class="o">|</span>
<span class="c1"># Can use ^D (stty eof) or `exit' to exit.</span>
<span class="k">if</span> <span class="o">!</span><span class="n">line</span> <span class="o">||</span> <span class="n">line</span> <span class="o">==</span> <span class="s2">"exit"</span>
<span class="nb">puts</span> <span class="k">unless</span> <span class="n">line</span>
<span class="nb">puts</span> <span class="s2">"exit"</span>
<span class="no">Readline</span><span class="p">.</span><span class="nf">handler_remove</span>
<span class="vg">$running</span> <span class="o">=</span> <span class="kp">false</span>
<span class="k">else</span>
<span class="nb">puts</span> <span class="s2">"input line: </span><span class="si">#{</span><span class="n">line</span><span class="si">}</span><span class="s2">"</span>
<span class="k">end</span>
<span class="k">end</span>
<span class="no">Signal</span><span class="p">.</span><span class="nf">trap</span><span class="p">(</span><span class="s1">'SIGWINCH'</span><span class="p">)</span> <span class="p">{</span> <span class="vg">$sigwinch_received</span> <span class="o">=</span> <span class="kp">true</span> <span class="p">}</span>
<span class="k">while</span> <span class="vg">$running</span> <span class="k">do</span>
<span class="n">rs</span> <span class="o">=</span> <span class="no">IO</span><span class="p">.</span><span class="nf">select</span><span class="p">([</span><span class="vg">$stdin</span><span class="p">])</span>
<span class="k">if</span> <span class="vg">$sigwinch_received</span>
<span class="no">Readline</span><span class="p">.</span><span class="nf">resize_terminal</span>
<span class="vg">$sigwinch_received</span> <span class="o">=</span> <span class="kp">false</span>
<span class="k">end</span>
<span class="no">Readline</span><span class="p">.</span><span class="nf">read_char</span> <span class="k">if</span> <span class="n">r</span> <span class="o">=</span> <span class="n">rs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">end</span>
<span class="nb">puts</span> <span class="s2">"rltest: Event loop has exited"</span>
</code></pre>
<p>Patch adding support for this is attached. This is my first try at contributing to ruby, so please tell me what I did wrong (I'm sure something, C is not my strong language).</p> Ruby master - Feature #13508 (Assigned): How remove/refactor code related mathn library.https://redmine.ruby-lang.org/issues/135082017-04-25T07:23:26Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<p>I removed mathn library at r58413 and r58432.</p>
<p>I have some concerns related mathn library. This issue is reminder for this concern.</p>
<ol>
<li>Still remains conditions for mathn loaded. ex. <a href="https://github.com/ruby/ruby/blob/trunk/array.c#L5755" class="external">https://github.com/ruby/ruby/blob/trunk/array.c#L5755</a>
</li>
<li>{complex,rational}.c have {nucomp,nurat}_canonicalization methods for mathn.</li>
<li>lib/cmath.rb have workaround code for mathn see. <a href="https://github.com/ruby/ruby/blob/trunk/lib/cmath.rb#L27" class="external">https://github.com/ruby/ruby/blob/trunk/lib/cmath.rb#L27</a>
</li>
</ol>
<p>I continue to discuss concerns to <a class="user active user-mention" href="https://redmine.ruby-lang.org/users/482">@mrkn (Kenta Murata)</a></p> Ruby master - Feature #13385 (Open): [PATCH] Make Resolv::DNS::Name validation similar to host an...https://redmine.ruby-lang.org/issues/133852017-03-29T09:17:33Zpavel.mikhailyuk@gmail.com (Pavel Mikhailyuk)
<a name="Abstract"></a>
<h1 >Abstract<a href="#Abstract" class="wiki-anchor">¶</a></h1>
<p>Add validations similar to <strong>host</strong> and <strong>dig</strong> commands to <code>Resolv::DNS::Name.create</code></p>
<a name="Background"></a>
<h1 >Background<a href="#Background" class="wiki-anchor">¶</a></h1>
<p><code>Resolv::DNS::Name.create(str)</code> does not make any domain name validation.<br>
So it returns false positive results for queries like</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="n">pry</span><span class="p">(</span><span class="n">main</span><span class="p">)</span><span class="o">></span> <span class="no">Resolv</span><span class="o">::</span><span class="no">DNS</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">getresources</span><span class="p">(</span><span class="s1">'.gmail....com'</span><span class="p">,</span> <span class="no">Resolv</span><span class="o">::</span><span class="no">DNS</span><span class="o">::</span><span class="no">Resource</span><span class="o">::</span><span class="no">IN</span><span class="o">::</span><span class="no">MX</span><span class="p">)</span>
<span class="o">=></span> <span class="p">[</span><span class="c1">#<Resolv::DNS::Resource::IN::MX:0x007fc3107ecf68 @exchange=#<Resolv::DNS::Name: alt1.gmail-smtp-in.l.google.com.>, @preference=10, @ttl=3600>,</span>
<span class="c1">#<Resolv::DNS::Resource::IN::MX:0x007fc313013730 @exchange=#<Resolv::DNS::Name: alt2.gmail-smtp-in.l.google.com.>, @preference=20, @ttl=3600>,</span>
<span class="c1">#<Resolv::DNS::Resource::IN::MX:0x007fc313011f20 @exchange=#<Resolv::DNS::Name: gmail-smtp-in.l.google.com.>, @preference=5, @ttl=3600>,</span>
<span class="c1">#<Resolv::DNS::Resource::IN::MX:0x007fc313010a30 @exchange=#<Resolv::DNS::Name: alt4.gmail-smtp-in.l.google.com.>, @preference=40, @ttl=3600>,</span>
<span class="c1">#<Resolv::DNS::Resource::IN::MX:0x007fc313012858 @exchange=#<Resolv::DNS::Name: alt3.gmail-smtp-in.l.google.com.>, @preference=30, @ttl=3600>]</span>
</code></pre>
<p>while</p>
<pre><code class="text syntaxhl" data-language="text">~ dig .gmail....com MX
dig: '.gmail....com' is not a legal name (empty label)
</code></pre>
<p>I added basic RFC validations in <code>Resolv::DNS::Label.split</code> to get <code>ArgumentError</code> with messages similar to <strong>host</strong> and <strong>dig</strong> commands.</p>
<a name="Pull-request"></a>
<h1 >Pull request<a href="#Pull-request" class="wiki-anchor">¶</a></h1>
<p><a href="https://github.com/ruby/ruby/pull/1551" class="external">https://github.com/ruby/ruby/pull/1551</a></p> Ruby master - Feature #13047 (Assigned): Use String literal instead of `String#+` for multiline p...https://redmine.ruby-lang.org/issues/130472016-12-17T14:21:49Zmtsmfm (Fumiaki Matsushima)mtsmfm@gmail.com
<p>Multiline pretty-printing of multiline strings is introduced. (<a href="https://bugs.ruby-lang.org/issues/12664" class="external">https://bugs.ruby-lang.org/issues/12664</a>)</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="o">></span> <span class="n">pp</span> <span class="s2">"bundler.rb"</span><span class="o">=></span> <span class="s2">"module Bundler</span><span class="se">\n</span><span class="s2"> BundlerError = Class.new(Exception)</span><span class="se">\n</span><span class="s2"> def self.setup</span><span class="se">\n</span><span class="s2"> end</span><span class="se">\n</span><span class="s2">end</span><span class="se">\n</span><span class="s2">"</span>
<span class="p">{</span><span class="s2">"bundler.rb"</span><span class="o">=></span>
<span class="s2">"module Bundler</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span>
<span class="s2">" BundlerError = Class.new(Exception)</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span>
<span class="s2">" def self.setup</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span>
<span class="s2">" end</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span>
<span class="s2">"end</span><span class="se">\n</span><span class="s2">"</span><span class="p">}</span>
</code></pre>
<p>It is awesome but we can use String literal instead of <code>String#+</code>:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="o">></span> <span class="n">pp</span> <span class="s2">"bundler.rb"</span><span class="o">=></span> <span class="s2">"module Bundler</span><span class="se">\n</span><span class="s2"> BundlerError = Class.new(Exception)</span><span class="se">\n</span><span class="s2"> def self.setup</span><span class="se">\n</span><span class="s2"> end</span><span class="se">\n</span><span class="s2">end</span><span class="se">\n</span><span class="s2">"</span>
<span class="p">{</span><span class="s2">"bundler.rb"</span><span class="o">=></span>
<span class="s2">"module Bundler</span><span class="se">\n</span><span class="s2">"</span> <span class="p">\</span>
<span class="s2">" BundlerError = Class.new(Exception)</span><span class="se">\n</span><span class="s2">"</span> <span class="p">\</span>
<span class="s2">" def self.setup</span><span class="se">\n</span><span class="s2">"</span> <span class="p">\</span>
<span class="s2">" end</span><span class="se">\n</span><span class="s2">"</span> <span class="p">\</span>
<span class="s2">"end</span><span class="se">\n</span><span class="s2">"</span><span class="p">}</span>
</code></pre>
<p>It seems that <code>pp</code> want to output evaluable snippet but we can override <code>String#+</code> so it may not work well.</p>
<p>Non-broken String will be:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="o">></span> <span class="n">pp</span> <span class="s2">"bundler.rb"</span><span class="o">=></span> <span class="s2">"module Bundler</span><span class="se">\n</span><span class="s2">end</span><span class="se">\n</span><span class="s2">"</span>
<span class="p">{</span><span class="s2">"bundler.rb"</span><span class="o">=></span> <span class="s2">"module Bundler</span><span class="se">\n</span><span class="s2">"</span> <span class="s2">"end</span><span class="se">\n</span><span class="s2">"</span><span class="p">}</span>
</code></pre>
<p>How do you think?</p>
<hr>
<p>I tried to write patch but I can't find a way to append "" to broken line only by current PP's API.</p> Ruby master - Feature #12656 (Assigned): Expand short paths with File.expand_pathhttps://redmine.ruby-lang.org/issues/126562016-08-04T20:06:47Zdavispuh (Dāvis Mosāns)
<p>Currently File.expand_path expands short path only if it's last part.</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">puts</span> <span class="no">File</span><span class="p">.</span><span class="nf">expand_path</span><span class="p">(</span><span class="s1">'C:/VERYLO~1'</span><span class="p">)</span>
<span class="nb">puts</span> <span class="no">File</span><span class="p">.</span><span class="nf">expand_path</span><span class="p">(</span><span class="s1">'C:/VERYLO~1/OTHERL~1'</span><span class="p">)</span>
</code></pre>
<p>Produces</p>
<pre><code>C:/VeryLongName12345
C:/VERYLO~1/OtherLongName54321
</code></pre>
<p>With attached patch it will always be long path</p>
<pre><code>C:/VeryLongName12345
C:/VeryLongName12345/OtherLongName54321
</code></pre>
<p>This also fixes TestDir#test_glob test because it was failing due short path.</p> Ruby master - Feature #12639 (Assigned): Speed up require in RubyGems by 5xhttps://redmine.ruby-lang.org/issues/126392016-07-31T01:05:41Zsegiddins (Samuel Giddins)segiddins@segiddins.me
<p>This patch makes requiring an already-loaded file approximated 5x faster when the RubyGems mixin for require is present.<br>
Benchmarked via the following script:</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="nb">require</span> <span class="s2">"rubygems"</span>
<span class="nb">require</span> <span class="s2">"benchmark/ips"</span>
<span class="no">Benchmark</span><span class="p">.</span><span class="nf">ips</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">"ruby"</span><span class="p">)</span> <span class="p">{</span> <span class="n">gem_original_require</span> <span class="s2">"rubygems"</span> <span class="p">}</span>
<span class="n">x</span><span class="p">.</span><span class="nf">report</span><span class="p">(</span><span class="s2">"rubygems"</span><span class="p">)</span> <span class="p">{</span> <span class="nb">require</span> <span class="s2">"rubygems"</span> <span class="p">}</span>
<span class="n">x</span><span class="p">.</span><span class="nf">compare!</span>
<span class="k">end</span>
</code></pre>
<p>I understand that it's not ideal to add new global functions, and I'd appreciate guidance on where else I could expose this functionality to ruby code.</p>
<p>Thanks :)</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 - Feature #12497 (Assigned): GMP version of divmod may be slowerhttps://redmine.ruby-lang.org/issues/124972016-06-16T17:04:12Zmame (Yusuke Endoh)mame@ruby-lang.org
<p><a href="https://benchmarksgame.alioth.debian.org/u64q/program.php?test=pidigits&lang=yarv&id=3" class="external">The benchmark program <code>pidigits.rb</code></a> runs faster if USE_GMP is disabled for divmod.</p>
<pre><code>$ time ./miniruby.orig pidigits.rb 10000 > /dev/null
real 0m5.932s
user 0m5.740s
sys 0m0.188s
</code></pre>
<pre><code>$ time ./miniruby.patched pidigits.rb 10000 > /dev/null
real 0m3.212s
user 0m3.056s
sys 0m0.152s
</code></pre>
<pre><code>diff --git a/bignum.c b/bignum.c
index 767659d..33a172e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -2813,12 +2813,6 @@ rb_big_divrem_gmp(VALUE x, VALUE y)
static void
bary_divmod_branch(BDIGIT *qds, size_t qn, BDIGIT *rds, size_t rn, const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
{
-#ifdef USE_GMP
- if (GMP_DIV_DIGITS < xn) {
- bary_divmod_gmp(qds, qn, rds, rn, xds, xn, yds, yn);
- return;
- }
-#endif
bary_divmod_normal(qds, qn, rds, rn, xds, xn, yds, yn);
}
</code></pre>
<p>We can possibly tune performance.</p> 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 #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 - Feature #11312 (Open): Add Resolv::DNS::Resource::IN::SPFhttps://redmine.ruby-lang.org/issues/113122015-06-26T18:58:49Zpostmodern (Hal Brodigan)postmodern.mod3@gmail.com
<p>The SPF type record (RFC4408 Section 3.1.1) is quite common now. The resolv library should probably support it. As a workaround I monkey patched in the resource class:</p>
<pre><code>class Resolv::DNS::Resource::IN::SPF < Resolv::DNS::Resource::IN::TXT
# resolv.rb doesn't define an SPF resource type.
TypeValue = 99
ClassValue = Resolv::DNS::Resource::IN::ClassValue
Resolv::DNS::Resource::ClassHash[[TypeValue, ClassValue]] = self
end
</code></pre>
<p>I could formalize my monkeypatch into an actual patch. I would just need to know whether SPF should be listed in the <code>ClassInsensitiveTypes</code> array.</p> Ruby master - Feature #10637 (Assigned): Puppet orchestration on vagrant fails with Error: Non-HT...https://redmine.ruby-lang.org/issues/106372014-12-23T18:59:56Zeshenayo (Eshe Pickett)eshe.pickett@gmail.com
<p>I encountered this issue while bringing up a VM using vagrant with virtualbox. I am using puppet to do some provisioning</p>
<p>==> default: Notice: Downloading from <a href="https://forge.puppetlabs.com" class="external">https://forge.puppetlabs.com</a> ...<br>
==> default: Error: Non-HTTP proxy URI: https://[proxy]:[port]/ class is: URI::HTTPS<br>
==> default: Error: Try 'puppet help module install' for usage<br>
==> default: Notice: Preparing to install into /etc/puppet/modules ...<br>
==> default: Notice: Downloading from <a href="https://forge.puppetlabs.com" class="external">https://forge.puppetlabs.com</a> ...<br>
==> default: Error: Non-HTTP proxy URI: https://[proxy]:[port]/ class is: URI::HTTPS<br>
==> default: Error: Try 'puppet help module install' for usage</p>
<p>I put in the print out to see what class in the above output</p>
<p>Puppet is using https to download modules, and it hits the open_http function</p>
<p>def OpenURI.open_http(buf, target, proxy, options) # :nodoc:<br>
if proxy<br>
proxy_uri, proxy_user, proxy_pass = proxy<br>
raise "Non-HTTP proxy URI: #{proxy_uri} class is: #{proxy_uri.class}" if proxy_uri.class != URI::HTTP<br>
end</p>
<p>I am new to ruby, so am unsure if this is the expected behavior. I have a work around, I set https_proxy to use the http_proxy, however, this is not by any means a permanent solution. Alternatively, I could change the ruby code to allow both HTTP and HTTPS URIs, please advise.</p> Ruby master - Feature #10459 (Assigned): [PATCH] rfc3339 method for Timehttps://redmine.ruby-lang.org/issues/104592014-10-30T11:12:16ZAntiarchitect (Andrey Voronkov)voronkovaa@gmail.com
<p>Alias for iso8601 method for compatibility with DateTime (Ruby on Rails).</p> Ruby master - Feature #10129 (Assigned): More descriptive error message for failed net/http requestshttps://redmine.ruby-lang.org/issues/101292014-08-13T22:34:43Zxshay (Xavier Shay)contact@xaviershay.com
<p>Hello,<br>
I would like to propose the following patch:</p>
<p>Before</p>
<pre><code>2.1.2 :003 > Net::HTTP.get(URI.parse("https://arsrtrtrstsrt.com/arstr"))
SocketError: getaddrinfo: nodename nor servname provided, or not known
</code></pre>
<p>After</p>
<pre><code>2.1.2 :003 > Net::HTTP.get(URI.parse("https://arsrtrtrstsrt.com/arstr"))
SocketError: Failed to open TCP connection to arsrtrtrstsrt.com:443 (getaddrinfo: nodename nor servname provided, or not known)
</code></pre>
<p>I have an implementation with test at <a href="https://github.com/ruby/ruby/pull/700" class="external">https://github.com/ruby/ruby/pull/700</a></p>
<p>Thank you for your consideration,<br>
Xavier</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 #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 - Feature #8948 (Assigned): Frozen regexhttps://redmine.ruby-lang.org/issues/89482013-09-25T04:02:37Zsawa (Tsuyoshi Sawada)
<p>=begin<br>
I see that frozen string was accepted for Ruby 2.1, and frozen array and hash are proposed in <a href="https://bugs.ruby-lang.org/issues/8909" class="external">https://bugs.ruby-lang.org/issues/8909</a>. I feel there is even more use case for a frozen regex, i.e., a regex literal that generates a regex only once. It is frequent to have a regex within a frequently repeated portion of code, and generating the same regex each time is a waste of resource. At the moment, we can have a code like:</p>
<pre><code>class Foo
RE1 = /pattern1/
RE2 = /pattern1/
RE3 = /pattern1/
def classify
case self
when RE1 then 1
when RE2 then 2
when RE3 then 3
else 4
end
end
end
</code></pre>
<p>but suppose we have a frozen <code>Regexp</code> literal <code>//f</code>. Then we can write like:</p>
<pre><code>class Foo
def classify
case self
when /pattern1/f then 1
when /pattern1/f then 2
when /pattern1/f then 3
else 4
end
end
end
</code></pre>
<p>=end</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 - Feature #8083 (Assigned): Exit status is limited to one-byte values which is invali...https://redmine.ruby-lang.org/issues/80832013-03-13T19:00:42Zrutsky (Vladimir Rutsky)rutsky.vladimir@gmail.com
<p>=begin<br>
Windows uses 32-bit process exit codes so Ruby incorrectly truncates them to one byte:</p>
<p>C:\Ruby193\bin>ruby -e "system('C:\windows\system32\cmd.exe /c exit 255'); puts $?.exitstatus"<br>
255</p>
<p>C:\Ruby193\bin>ruby -e "system('C:\windows\system32\cmd.exe /c exit 256'); puts $?.exitstatus"<br>
0</p>
<p>C:\Ruby193\bin>ruby -e "system('C:\windows\system32\cmd.exe /c exit 257'); puts $?.exitstatus"<br>
1</p>
<p>Similar code works correctly in Python:</p>
<p>C:\Python27>python -c "import subprocess; print subprocess.call('C:\windows\system32\cmd.exe /c exit 255')"<br>
255</p>
<p>C:\Python27>python -c "import subprocess; print subprocess.call('C:\windows\system32\cmd.exe /c exit 256')"<br>
256</p>
<p>C:\Python27>python -c "import subprocess; print subprocess.call('C:\windows\system32\cmd.exe /c exit 257')"<br>
257<br>
=end</p> 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 #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 - Feature #7412 (Assigned): Pathname#relative_path_from does not support mixed direct...https://redmine.ruby-lang.org/issues/74122012-11-20T20:15:24Z7er (Syver Enstad)syver.enstad@gmail.com
<p>=begin<br>
The support for mixing backslashes and forward slashes in the pathname module in the standard library seems to be broken on windows</p>
<pre><code>require 'pathname'
base = Pathname.new("c:\\")
filepath = Pathname.new("c:/foo/bar/file.ext")
base.relative_path_from(filepath)
</code></pre>
<p>raises <code>ArgumentError: different prefix: "c:\\" and "c:/foo/bar/file.ext"</code></p>
<p>Changing filepath to contain backslashes fixes the problem</p>
<pre><code>filepath = Pathname.new("c:\\foo\\bar\\file.ext")
base.relative_path_from(filepath)
</code></pre>
<p><code>=> #<Pathname:../../..></code><br>
=end</p> Ruby master - Feature #7362 (Assigned): Adding Pathname#start_with?https://redmine.ruby-lang.org/issues/73622012-11-15T22:38:40Zaef (Alexander E. Fischer)aef@raxys.net
<p>If a Pathname starts with another Pathname, that means that the former Pathname lies below the latter Pathname, as long as both Pathnames are interpreted from the same location or both are given as absolute.</p>
<p>Therefore I would like to see a method #start_with? just like the one on String but for Pathnames.</p>
<p>If you like the idea, just tell me. I will provide a patch then.</p> Ruby master - Feature #7148 (Assigned): Improved Tempfile w/o DelegateClasshttps://redmine.ruby-lang.org/issues/71482012-10-12T14:04:07ZGlass_saga (Masaki Matsushita)glass.saga@gmail.com
<p>I propose improved <code>Tempfile</code> without <code>DelegateClass()</code>.<br>
Present <code>Tempfile</code> has following problems.</p>
<ol>
<li>
<p>confusing inspect</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">t</span> <span class="o">=</span> <span class="no">Tempfile</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span> <span class="c1">#=> #<File:/tmp/foo20121012-6762-12w11to></span>
<span class="n">t</span><span class="p">.</span><span class="nf">is_a?</span> <span class="no">File</span> <span class="c1">#=> false</span>
</code></pre>
</li>
<li>
<p><code>#dup</code> doesn't duplicate <code>IO</code></p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">t</span> <span class="o">=</span> <span class="no">Tempfile</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
<span class="n">t</span><span class="p">.</span><span class="nf">dup</span><span class="p">.</span><span class="nf">close</span>
<span class="n">t</span><span class="p">.</span><span class="nf">read</span> <span class="c1">#=> IOError: closed stream</span>
</code></pre>
</li>
<li>
<p>finalizer performs unlink even when it has been duplicated</p>
<pre><code class="ruby syntaxhl" data-language="ruby"><span class="n">t</span> <span class="o">=</span> <span class="no">Tempfile</span><span class="p">.</span><span class="nf">new</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
<span class="n">path</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="nf">path</span> <span class="c1">#=> "/tmp/foo20121012-7533-1q537gq"</span>
<span class="no">File</span><span class="p">.</span><span class="nf">exist?</span> <span class="n">path</span> <span class="c1">#=> true</span>
<span class="n">tt</span> <span class="o">=</span> <span class="n">t</span><span class="p">.</span><span class="nf">dup</span>
<span class="n">t</span> <span class="o">=</span> <span class="kp">nil</span>
<span class="no">GC</span><span class="p">.</span><span class="nf">start</span>
<span class="no">File</span><span class="p">.</span><span class="nf">exist?</span> <span class="n">path</span> <span class="c1">#=> false</span>
</code></pre>
</li>
</ol>
<p>I think these problems caused by using <code>DelegateClass()</code>.<br>
Therefore, I made a patch to resolve the problems.<br>
The patched Tempfile class is a subclass of File.</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> Ruby master - Feature #5617 (Assigned): Allow install RubyGems into dediceted directoryhttps://redmine.ruby-lang.org/issues/56172011-11-11T22:12:09Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<p>Hello,</p>
<p>I would like to propose my patch, which allows to optionally install RubyGems library into dedicated directory, out of the default Ruby directory structure. This should enable to easily share one RubyGems library by more Ruby implementations and avoids code duplication. I did this patch since Fedora prohibits duplication of system libraries [1], which would be the case if MRI and JRuby are installed in parallel.</p>
<p>Thank you for considering this patch.</p>
<p>Vit</p>
<p>[1] <a href="https://fedoraproject.org/wiki/Packaging:Guidelines#Duplication_of_system_libraries" class="external">https://fedoraproject.org/wiki/Packaging:Guidelines#Duplication_of_system_libraries</a></p> Ruby master - Feature #3608 (Assigned): Enhancing Pathname#each_child to be lazyhttps://redmine.ruby-lang.org/issues/36082010-07-24T10:27:14Ztaw (Tomasz Wegrzanowski)Tomasz.Wegrzanowski@gmail.com
<p>=begin<br>
Right now it lists entire directory, then yields<br>
every element, that is x.each_child(&b) means x.children.each(&b).</p>
<p>This is too slow for directories mounted over networked file systems etc.,<br>
and there is currently no way to get lazy behaviour, other than leaving<br>
convenient #each_child/#children API and moving to lower level.</p>
<p>With this patch:</p>
<ul>
<li>#children is eager like before, no change here</li>
<li>#each_child becomes lazy</li>
<li>#each_child without block returns lazy enumerator,<br>
so it can be used like this dir.each_child.find(&:symlink?)<br>
without losing laziness.</li>
</ul>
<p>Patch is against trunk. pathname.rb was in lib/ not ext/pathname/lib/<br>
before, but it works either way.</p>
<p>The part to return enumerator when called without a block wouldn't<br>
work in 1.8. If backport is desired, that line would need to be thrown<br>
away, and #children would need to build result array instead<br>
of calling each_child(with_directory).to_a - this would be straightforward.<br>
=end</p> Ruby master - Feature #2631 (Assigned): Allow IO#reopen to take a blockhttps://redmine.ruby-lang.org/issues/26312010-01-23T00:55:49Zdjberg96 (Daniel Berger)
<p>=begin<br>
Please allow IO#reopen to accept a block. This would allow users to temporarily redirect output without having to manually reset the file descriptor. For example:</p>
<p>require 'mkmf'</p>
<a name="stdout-redirected-within-block-only"></a>
<h1 >stdout redirected within block only<a href="#stdout-redirected-within-block-only" class="wiki-anchor">¶</a></h1>
<p>$stdout.reopen('/dev/null') do<br>
if have_header('foo.h')<br>
# Do stuff<br>
end<br>
end</p>
<a name="stdout-now-back-to-its-former-setting"></a>
<h1 >stdout now back to its former setting<a href="#stdout-now-back-to-its-former-setting" class="wiki-anchor">¶</a></h1>
<p>I believe this is both convenient and intuitive when one considers the IO.open also takes a block.</p>
<p>Regards,</p>
<p>Dan<br>
=end</p> Ruby master - Feature #1644 (Assigned): recv on inherited socket wrapped in TCPSocket does not re...https://redmine.ruby-lang.org/issues/16442009-06-17T14:37:54Zkntuaf (Kedar H)knutaf@gmail.com
<p>=begin<br>
On Windows, if you try to wrap an existing winsock socket that was inherited from a parent process into a TCPSocket, any calls to recv on this socket in the child process will not retrieve any data.</p>
<p>This is because the inherited socket is not a member of the internal "socklist" structure in win32.c. rb_w32_select filters out all sockets that are not in this internal list, prior to calling ws2_32!select.</p>
<p>One good solution is for TCPSocket.for_fd to make sure to insert its argument into the socklist structure so that subsequent Winsock functions wrapped by Ruby will work as though the socket were created by this Ruby process. Another possible solution is to expose another method, something like TCPSocket.from_new_fd.<br>
=end</p>