Bug 947444

Summary: PerlIO dead-locks with threaded fork
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: perlAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: cweyl, iarnell, jplesnik, kasal, lkundrak, mmaslano, perl-devel, ppisar, psabata, rc040203, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://rt.perl.org/rt3/Public/Bug/Display.html?id=106212
Whiteboard:
Fixed In Version: perl-5.16.3-270.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-02 13:11:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test case none

Description Petr Pisar 2013-04-02 12:52:22 UTC
Created attachment 730746 [details]
Test case

As reported to upstream, there is a possible dead lock when using fork from threads and PerlIO <https://rt.perl.org/rt3/Public/Bug/Display.html?id=106212>.

This has been fixed in commit:

From 4da80956418bbe1fdc23cad0b1cbb24cd7b87609 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Patrik=20H=C3=A4gglund?= <patrik.h.hagglund>
Date: Sat, 2 Feb 2013 20:21:05 +0100
Subject: [PATCH] PATCH [perl #106212] Add PL_perlio_mutex to
 atfork_lock/unlock

Using threads + fork() on Linux, and IO operations in the threads, the
PL_perlio_mutex may be left in a locked state at the call of fork(),
potentially leading to deadlock in the child process at subsequent IO
operations. (Threads are pre-empted and not continued in the child
process after the fork.)

Therefore, ensure that the PL_perlio_mutex is unlocked in the child
process, right after fork(), by using atfork_lock/unlock.

(The RT text gives ways to reproduce the problem, but are not easily
added to Perl's test suite)


Probably all Fedoras are affected.

Comment 1 Fedora Update System 2013-04-11 11:02:53 UTC
perl-5.16.3-262.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/perl-5.16.3-262.fc19

Comment 2 Fedora Update System 2013-04-11 11:10:11 UTC
perl-5.16.3-242.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/perl-5.16.3-242.fc18

Comment 3 Fedora Update System 2013-04-11 13:06:07 UTC
perl-5.14.4-225.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/perl-5.14.4-225.fc17

Comment 4 Fedora Update System 2013-04-20 19:15:07 UTC
perl-5.16.3-262.fc19, perl-Sys-Syslog-0.32-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2013-04-25 00:45:38 UTC
perl-5.16.3-242.fc18, perl-Sys-Syslog-0.32-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2013-04-27 00:11:08 UTC
perl-5.14.4-225.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.