From 31b2cd38c5dcf4a0c51ca56ecdddf7461b8ac86c Mon Sep 17 00:00:00 2001 From: Chris Seaton Date: Tue, 14 Jun 2022 16:08:36 +0100 Subject: Include JIT information in crash reports Since enabling YJIT or MJIT drastically changes what could go wrong at runtime, it's good to be front and center about whether they are enabled when dumping a crash report. Previously, `RUBY_DESCRIPTION` and the description printed when crashing can be different when a JIT is on. Introduce a new internal data global, `rb_dynamic_description`, and set it to be the same as `RUBY_DESCRIPTION` during initialization; use it when crashing. * version.c: Init_ruby_description(): Initialize and use `rb_dynamic_description`. * error.c: Change crash reports to use `rb_dynamic_description`. * ruby.c: Call `Init_ruby_description()` earlier. Slightly more work for when we exit right after printing the description but that was deemed acceptable. * include/ruby/version.h: Talk about how JIT info is not in `ruby_description`. * test/-ext-/bug_reporter/test_bug_reporter.rb: Remove handling for crash description being different from `RUBY_DESCRIPTION`. * test/ruby/test_rubyoptions.rb: ditto Co-authored-by: Nobuyoshi Nakada Co-authored-by: Alan Wu --- test/-ext-/bug_reporter/test_bug_reporter.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'test/-ext-/bug_reporter/test_bug_reporter.rb') diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb index 990b6a2cc5..6e955e2cbd 100644 --- a/test/-ext-/bug_reporter/test_bug_reporter.rb +++ b/test/-ext-/bug_reporter/test_bug_reporter.rb @@ -7,8 +7,6 @@ class TestBugReporter < Test::Unit::TestCase omit if ENV['RUBY_ON_BUG'] description = RUBY_DESCRIPTION - description = description.sub(/\+MJIT /, '') if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? - description = description.sub(/\+YJIT /, '') if defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled? expected_stderr = [ :*, /\[BUG\]\sSegmentation\sfault.*\n/, -- cgit v1.2.3