Project

General

Profile

Actions

Bug #11481

closed

Segmentation fault when thread is killed during `require`.

Added by t-8ch (Thomas Weißschuh) almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[ruby-core:<unknown>]

Description

One of a library used by us executes open from uri-open in multiple thread in parallel under a timeout.
open-uri implicitly requires net/http. When the import machinery is killed during performing an import this will lead to a segfault further down the line.

I readily accept that it is very poor practice to do require in a loop which is suspect to uncatchable exceptions,
But unfortunately the user has no idea that requires are performed.

The test.rb script from the attachements triggers this bug. You may want to spawn less threads. The high number was chosen to improve the rate of triggering the bug.

We tested this on ruby 2.1.5p273 as shipped with debian Jessie. And ruby 2.2.3p173 from ArchLinux.


Files

backtrace (255 KB) backtrace Backtrace from the execution t-8ch (Thomas Weißschuh), 08/24/2015 12:49 PM
test.rb (231 Bytes) test.rb Script which demonstrates the bug t-8ch (Thomas Weißschuh), 08/24/2015 12:49 PM
backtrace.symbols (122 KB) backtrace.symbols Another backtrace including symbols t-8ch (Thomas Weißschuh), 08/25/2015 07:28 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #11404: Segfault when 'throw' occurs while loading a Ruby source file [PATCH]ClosedActions
Actions #2

Updated by nagachika (Tomoyuki Chikanaga) almost 7 years ago

  • Related to Bug #11404: Segfault when 'throw' occurs while loading a Ruby source file [PATCH] added
Actions #3

Updated by nagachika (Tomoyuki Chikanaga) almost 7 years ago

[But #11404] seems the similar issue and fixed on trunk.

Actions #4

Updated by nagachika (Tomoyuki Chikanaga) almost 7 years ago

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

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

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

r51292, r51439 and r51440 were backported into ruby_2_2 branch at r52655.

Updated by nagachika (Tomoyuki Chikanaga) over 6 years ago

Backport r51445 into ruby_2_2 branch at r52661 to suppress warning in CI.

Actions

Also available in: Atom PDF