Project

General

Profile

Bug #11451

MRI crashes with 'Stack inconsistency error' when a method which yields is called recursively in a particular way

Added by alexdowad (Alex Dowad) almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
2.3.0dev, also present in 2.2.2
[ruby-core:<unknown>]

Description

Dear Ruby people,

How are you? The other day, someone reported that a gem I maintain was crashing under MRI 2.2.2. I traced it through with GDB, found where it was going wrong, and wrote a tiny little patch which makes the crash go away. (Yay!) Can you look at this and check that this patch won't cause any other problems?

Thanks,
Alex Dowad


Files

repro.rb (283 Bytes) repro.rb Minimal Ruby script for repro alexdowad (Alex Dowad), 08/17/2015 12:54 PM
0001-Fix-crash-caused-by-recursive-yield-to-blocks-with-d.patch (1.48 KB) 0001-Fix-crash-caused-by-recursive-yield-to-blocks-with-d.patch And here is the fix! alexdowad (Alex Dowad), 08/17/2015 12:55 PM

Related issues

Related to Ruby master - Bug #11071: Stack consistency error while using RSpec and TimecopClosedActions
#1

Updated by alexdowad (Alex Dowad) almost 5 years ago

Sorry, I forgot to say... THANKS to Xavier Shay for finding this problem!

#2

Updated by usa (Usaku NAKAMURA) almost 5 years ago

  • Related to Bug #11071: Stack consistency error while using RSpec and Timecop added
#3

Updated by nobu (Nobuyoshi Nakada) almost 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)
#4

Updated by ko1 (Koichi Sasada) almost 5 years ago

  • Status changed from Assigned to Closed

Applied in changeset r51651.


  • vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is stable after invoking a block. [Bug #11451]
  • test/ruby/test_yield.rb: add a test. This test script is given by Alex Dowad.
#5

Updated by ko1 (Koichi Sasada) almost 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED

Thank you for your reproducible script!

Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: DONE

Backported into ruby_2_2 branch at r52717.

Also available in: Atom PDF