Project

General

Profile

Actions

Bug #11404

closed

Segfault when 'throw' occurs while loading a Ruby source file [PATCH]

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

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-07-23 trunk 51355) [x86_64-linux]
[ruby-core:70169]

Description

Dear Ruby people,

Here is a fix for a segfault which can occur when requiring a Ruby source file inside a Timeout.timeout {} block. This may seem like a strange thing
to do, but it can easily happen unintentionally if you use libraries which 'autoload' their source files (like RSpec, Rails, etc).

I have observed this segfault in MRI 2.1.2 and 2.3.0.

Thanks,
Alex Dowad


Files

0001-load.c-avoid-segfault-when-throw-occurs-in-the-middl.patch (1.33 KB) 0001-load.c-avoid-segfault-when-throw-occurs-in-the-middl.patch Here is the fix! alexdowad (Alex Dowad), 07/29/2015 08:25 AM
test.rb (1.2 KB) test.rb Here is code for minimal repro alexdowad (Alex Dowad), 07/29/2015 08:25 AM
blah.rb (14 Bytes) blah.rb Also needed for repro alexdowad (Alex Dowad), 07/29/2015 08:25 AM
crash-dump.txt (13.2 KB) crash-dump.txt Debug output from segfault alexdowad (Alex Dowad), 07/29/2015 08:26 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #11481: Segmentation fault when thread is killed during `require`.ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0