Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal.trap with invalid signal should raise ArgumentError #2774

Closed
djberg96 opened this issue Nov 8, 2022 · 2 comments
Closed

Signal.trap with invalid signal should raise ArgumentError #2774

djberg96 opened this issue Nov 8, 2022 · 2 comments

Comments

@djberg96
Copy link
Contributor

djberg96 commented Nov 8, 2022

truffleruby 22.3.0, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]

The snippet Signal.trap(999999) should raise "invalid signal number (999999) (ArgumentError)". However, TruffleRuby is currently bombing out with such a snippet:

<internal:core> core/signal.rb:61:in 'trap': TruffleRuby doesn't have a case for the org.truffleruby.core.VMPrimitiveNodesFactory$VMWatchSignalNodeFactory$VMWatchSignalNodeGen node with values of type org.truffleruby.language.Nil java.lang.Boolean=false org.truffleruby.core.string.ImmutableRubyString (TypeError)
	from org.truffleruby.core.VMPrimitiveNodesFactory$VMWatchSignalNodeFactory$VMWatchSignalNodeGen.executeAndSpecialize(VMPrimitiveNodesFactory.java:1118)
	from org.truffleruby.core.VMPrimitiveNodesFactory$VMWatchSignalNodeFactory$VMWatchSignalNodeGen.execute(VMPrimitiveNodesFactory.java:1057)
	from org.truffleruby.language.locals.WriteLocalVariableNode.execute(WriteLocalVariableNode.java:28)
	from org.truffleruby.language.RubyNode.doExecuteVoid(RubyNode.java:63)
	from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:34)
	from org.truffleruby.language.control.IfNode.execute(IfNode.java:39)
	from org.truffleruby.language.RubyNode.doExecuteVoid(RubyNode.java:63)
	from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:34)
	from org.truffleruby.language.RubyMethodRootNode.execute(RubyMethodRootNode.java:65)
	from (irb):1:in '<top (required)>'
	from <internal:core> core/kernel.rb:407:in 'loop'
	from <internal:core> core/throw_catch.rb:36:in 'catch'
	from <internal:core> core/throw_catch.rb:36:in 'catch'
	from /Users/dberger/.rbenv/versions/truffleruby-22.3.0/lib/gems/gems/irb-1.3.5/exe/irb:11:in '<top (required)>'
	from <internal:core> core/kernel.rb:376:in 'load'
	from <internal:core> core/kernel.rb:376:in ''load'
	from /Users/dberger/.rbenv/versions/truffleruby-22.3.0/bin/irb:42:in '<main>'
@andrykonchin
Copy link
Member

Thank you for reporting!

It can be easily reproduced and fixed.

@andrykonchin
Copy link
Member

Fixed in ecaebce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants