Project

General

Profile

Actions

Bug #11451

closed

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

Added by alexdowad (Alex Dowad) over 9 years ago. Updated about 9 years ago.

Status:
Closed
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 1 (0 open1 closed)

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

Updated by alexdowad (Alex Dowad) over 9 years ago

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

Actions #2

Updated by usa (Usaku NAKAMURA) over 9 years ago

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

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

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

Updated by ko1 (Koichi Sasada) over 9 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.
Actions #5

Updated by ko1 (Koichi Sasada) over 9 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) about 9 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0