I've seen this error sometimes but never found it helpful, since the
culprit has never been thread/monitor related, so it just adds noise.
Right now I'm seeing an issue in CI where we seem to be crashing during
ensure and showing a weird backtrace:
```
#<Thread:0x000055821d7a73b8 /home/runner/work/rubygems/rubygems/lib/rubygems/request_set.rb:167 run> terminated with exception (report_on_exception is true):
/home/runner/work/rubygems/rubygems/lib/rubygems/platform.rb:141:in `==': undefined local variable or method `to_a' for false:FalseClass (NameError)
Did you mean? to_s
from /home/runner/work/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb:168:in `!='
from /home/runner/work/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb:168:in `require'
from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:441:in `block in ensure_subdirectories'
from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:437:in `each'
from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:437:in `ensure_subdirectories'
from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:413:in `ensure_gem_subdirectories'
from /home/runner/work/rubygems/rubygems/lib/rubygems/resolver/specification.rb:110:in `download'
from /home/runner/work/rubygems/rubygems/lib/rubygems/request_set.rb:173:in `block (2 levels) in install'
```
Let's get this out of the picture in case that helps clarify the
culprit.
https://github.com/rubygems/rubygems/commit/87ce40b70e
Otherwise we get
```
✗ rake TEST=test/rubygems/test_project_sanity.rb
Loaded suite /Users/deivid/.gem/ruby/3.2.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
E
============================================================================================================================================================================================================
Error: test_manifest_is_up_to_date(TestProjectSanity):
RuntimeError: There was an error running `rake check_manifest`: /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake (Gem::GemNotFoundException)
from /Users/deivid/.asdf/installs/ruby/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems.rb:282:in `activate_bin_path'
from /Users/deivid/.asdf/installs/ruby/3.2.1/bin/rake:25:in `<main>'
/Users/deivid/Code/rubygems/rubygems/test/rubygems/test_project_sanity.rb:27:in `test_manifest_is_up_to_date'
24:
25: raise "Expected Manifest.txt to be up to date, but it's not. Run `rake update_manifest` to sync it."
26: else
=> 27: raise "There was an error running `rake check_manifest`: #{out}"
28: end
29: end
30: end
============================================================================================================================================================================================================
.
Finished in 0.188192 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 tests, 1 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
50% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10.63 tests/s, 5.31 assertions/s
rake aborted!
```
https://github.com/rubygems/rubygems/commit/29829933a6
This reverts commit cae4342dd5.
This is failing a lot of CIs and nobody is actively looking into fixing
it. Let me revert this until we have a solution to it.
This is useful for crash triaging. It also helps to hint extension
developers about the misuse of `rb_thread_call_without_gvl()`.
Example:
$ ./miniruby -e 'Ractor.new{Ractor.receive};
Thread.new{sleep}; Process.kill:SEGV,Process.pid'
<snip>
-- Threading information ---------------------------------------------------
Total ractor count: 2
Ruby thread count for this ractor: 2
In wmap_final_func, j is the number of elements + 1 (since j also
includes the length at the 0th index), so we should resize the buffer
to size j and the new length is j - 1.
String#unpack("C*") is equivalent to String#bytes and Array#inject {|a,b| a + b } is equivalent to Array#sum.
This is a minor enhancement in terms of speed and readability.