Project

General

Profile

Actions

Backport #2728

closed

ruby segfaults returning from dynamically defined method in ensure block

Added by Ethan (Ethan -) over 14 years ago. Updated over 5 years ago.

Status:
Closed
[ruby-core:28129]

Description

=begin
As best as I can work out, the conditions to reproduce this crash are:

  1. A begin/ensure block yields to a block passed by Enumerable (maybe passed by any compiled function?).
  2. Control is forced to the ensure block from 'break' being called from Enumerable.
  3. The ensure block contains a call to a dynamically defined method (created using define_method).
  4. The dynamically defined method runs.
  5. Instead of returning from the dynamically defined method, ruby segfaults (on windows XP), or bus errors (on OS X).

Happens on both Windows XP and Mac OS X (10.5.8). Script to reproduce and output are attached.
=end


Files

ensure_dynamic_method.rb (647 Bytes) ensure_dynamic_method.rb Script which will reproduce the crash. Ethan (Ethan -), 02/10/2010 01:26 AM
ensure_dynamic_method_osx.output (3.43 KB) ensure_dynamic_method_osx.output Output from script on OS X 10.5.8 Ethan (Ethan -), 02/10/2010 01:26 AM
ensure_dynamic_method_xp.output (1.27 KB) ensure_dynamic_method_xp.output Output from script on windows XP Ethan (Ethan -), 02/10/2010 01:26 AM

Related issues 1 (0 open1 closed)

Follows Ruby master - Bug #2729: `unexpected break' occurs when a proc is called in ensureClosedko1 (Koichi Sasada)02/10/2010Actions
Actions #1

Updated by kronos (Ivan Samsonov) over 14 years ago

=begin
It is reproducing on ruby 1.9.1p243 Mac OS X 1.6
=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Category set to core
  • Status changed from Open to Closed

=begin
Fixed in r26628.
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Status changed from Closed to Assigned
  • Assignee set to yugui (Yuki Sonoda)
  • Priority changed from 5 to Normal

=begin

=end

Actions #4

Updated by mame (Yusuke Endoh) over 14 years ago

  • Category set to core
  • Assignee changed from yugui (Yuki Sonoda) to ko1 (Koichi Sasada)
  • Priority changed from Normal to 5

=begin
r26628 caused new SEGV when executing rubyspec.
Though the detail is still under investigation, I temporarily reverted the commit.
It should not be backported to 1.9.1.

--
Yusuke Endoh
=end

Actions #5

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Description updated (diff)
  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0