Bug 947444 - PerlIO dead-locks with threaded fork
Summary: PerlIO dead-locks with threaded fork
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: https://rt.perl.org/rt3/Public/Bug/Di...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-02 12:52 UTC by Petr Pisar
Modified: 2013-05-02 13:11 UTC (History)
11 users (show)

Fixed In Version: perl-5.16.3-270.fc20
Clone Of:
Environment:
Last Closed: 2013-05-02 13:11:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test case (1.71 KB, text/plain)
2013-04-02 12:52 UTC, Petr Pisar
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.