summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Seaton <chris.seaton@shopify.com>2022-06-14 16:08:36 +0100
committerAlan Wu <XrXr@users.noreply.github.com>2022-06-20 17:18:29 -0400
commit31b2cd38c5dcf4a0c51ca56ecdddf7461b8ac86c (patch)
treed282ecaade8561f335ea1cbb1cc0246909b897e8 /include
parent5ca2335802b281f9a38b1d9b73b146b94ed0eed3 (diff)
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 <nobu@ruby-lang.org> Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5872
Diffstat (limited to 'include')
-rw-r--r--include/ruby/version.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/ruby/version.h b/include/ruby/version.h
index f10b58f9c7..18b3abc8d7 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -137,7 +137,8 @@ RUBY_EXTERN const int ruby_patchlevel;
/**
* This is what `ruby -v` prints to the standard error. Something like:
- * `"ruby 2.5.9p229 (2021-04-05 revision 67829) [x86_64-linux]"`
+ * `"ruby 2.5.9p229 (2021-04-05 revision 67829) [x86_64-linux]"`. This doesn't
+ * include runtime options like a JIT being enabled.
*/
RUBY_EXTERN const char ruby_description[];