From 5d33f787169bcc3594d2264726695d58c4a06899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Wed, 31 Jul 2019 23:00:15 +0900 Subject: fix tracepoint + backtrace SEGV PC modification in gc_event_hook_body was careless. There are (so to say) abnormal iseqs stored in the cfp. We have to check sanity before we touch the PC. This has not been fixed because there was no way to (ab)use the setup from pure-Ruby. However by using our official C APIs it is possible to touch such frame(s), resulting in SEGV. Fixes [Bug #14834]. --- test/-ext-/test_bug-14834.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/-ext-/test_bug-14834.rb (limited to 'test/-ext-') diff --git a/test/-ext-/test_bug-14834.rb b/test/-ext-/test_bug-14834.rb new file mode 100644 index 0000000000..a3623b8adc --- /dev/null +++ b/test/-ext-/test_bug-14834.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class Test_BUG_14834 < Test::Unit::TestCase + def test + assert_ruby_status [], <<~'end;', '[ruby-core:87449] [Bug #14834]' + require '-test-/bug_14834' + Bug.bug_14834 do + [123].group_by {} + end + end; + end +end -- cgit v1.2.3