[#122258] [Ruby Misc#21367] Remove link to ruby-doc.org from www.ruby-lang.org/en/documentation/ — "p8 (Petrik de Heus) via ruby-core" <ruby-core@...>
Issue #21367 has been reported by p8 (Petrik de Heus).
11 messages
2025/05/23
[ruby-core:122301] [Ruby Bug#21373] "Illegal instruction: 4" when raising SystemStackError after rescuing
From:
"Ethan (Ethan -) via ruby-core" <ruby-core@...>
Date:
2025-05-27 03:56:45 UTC
List:
ruby-core #122301
Issue #21373 has been updated by Ethan (Ethan -).
Ah, I missed that one. Can close this duplicate, I think.
----------------------------------------
Bug #21373: "Illegal instruction: 4" when raising SystemStackError after rescuing
https://bugs.ruby-lang.org/issues/21373#change-113445
* Author: Ethan (Ethan -)
* Status: Open
* ruby -v: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-darwin22]
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
I overflowed the stack in a test - this was rescued and tests continued, but when the next test also overflowed the stack, instead of handling the exception, ruby exited with "Illegal instruction: 4", exit code 132, and no other output (no stack trace or dump).
A minimal reproduction follows. The C method JSON::Ext::Generator::GeneratorMethods::Hash#to_json alternates with X#to_json on the stack; this does not reproduce without the C method.
This is on macos and does not reproduce on linux.
```ruby
require 'json'
class X
def to_json(*args)
{'data' => self}.to_json(*args)
end
end
# raise and rescue once works fine
begin
JSON.dump(X.new)
rescue SystemStackError
end
# upon overflowing stack a second time, ruby exits abnormally
# with "Illegal instruction: 4" instead of SystemStackError
JSON.dump(X.new)
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/