-
Hello. I ran a program with a syntax error in Ruby 3.3, and it displayed a crash report from Prism. class Foo
def initialize(
true
end $ ruby --parser=prism main.rb
ruby: warning: The compiler based on the Prism parser is currently experimental and compatibility with the compiler based on parse.y is not yet complete. Please report any issues you find on the `ruby/prism` issue tracker.
main.rb: [BUG] A pm_missing_node_t should not exist in prism's AST.
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +PRISM [arm64-darwin22]
-- Crash Report log information --------------------------------------------
See Crash Report log file in one of the following locations:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:001dc0 DUMMY [FINISH]
-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1
-- C level backtrace information -------------------------------------------
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(rb_vm_bugreport+0xb4c) [0x1053eaae8]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(rb_bug_without_die+0xfc) [0x10522cf3c]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(rb_bug+0x1c) [0x1054dfa98]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node.cold.8+0x0) [0x1054df374]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node+0xa938) [0x1051dc41c]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node+0x3a2c) [0x1051d5510]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node+0xa418) [0x1051dbefc]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(rb_iseq_compile_prism_node+0xf8) [0x1051ca910]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_iseq_new_with_opt+0xf8) [0x10528f050]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_new_child_iseq+0x8c) [0x1051fa5e4]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node+0x16c8) [0x1051d31ac]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node+0x3a2c) [0x1051d5510]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(pm_compile_node+0xa418) [0x1051dbefc]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(rb_iseq_compile_prism_node+0xf8) [0x1051ca910]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(iseqw_s_compile_prism_compile+0xf0) [0x1052900f8]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(rb_iseq_new_main_prism+0xc8) [0x10528ffc8]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(ruby_process_options+0x1728) [0x105349288]
/Users/nasa/.rbenv/versions/3.3.0/lib/libruby.3.3.dylib(ruby_options+0xb4) [0x1052382f4]
/Users/nasa/.rbenv/versions/3.3.0/bin/ruby(main+0x64) [0x104b07f30]
-- Other runtime information -----------------------------------------------
* Loaded script: main.rb
* Loaded features:
0 enumerator.so
1 thread.rb
2 fiber.so
3 rational.so
4 complex.so
5 ruby2_keywords.rb
6 /Users/nasa/.rbenv/versions/3.3.0/lib/ruby/3.3.0/arm64-darwin22/enc/encdb.bundle
7 /Users/nasa/.rbenv/versions/3.3.0/lib/ruby/3.3.0/arm64-darwin22/enc/trans/transdb.bundle I am interested in testing Prism's error tolerance and its ergonomically designed error messages. I would be grateful if you could let me know if these features are in a phase where they can be tested with CRuby. I think Prism is fantastic. I am very pleased that such a parser has been developed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Thanks for opening this @k-nasa — unfortunately we didn't get out error messages properly handled before 3.3 went out, so it still crashes. If you were to run that on Ruby master, it would say:
I'm hoping to get it backported to Ruby 3.3.1, but at the moment you'll have to use |
Beta Was this translation helpful? Give feedback.
-
@k-nasa this issue should be fixed on |
Beta Was this translation helpful? Give feedback.
Thanks for opening this @k-nasa — unfortunately we didn't get out error messages properly handled before 3.3 went out, so it still crashes. If you were to run that on Ruby master, it would say:
I…