PerlIO dead-locks with threaded fork
Bug #1346043 reported by
Luke Kim
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
perl (Fedora) |
Fix Released
|
Undecided
|
|||
perl (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This bug can be found on Fedora or Perl bug tracking system and fixed there.
https:/
https:/
I have same issue with Ubuntu 12.04.
Changed in perl (Fedora): | |
importance: | Unknown → Undecided |
status: | Unknown → Fix Released |
To post a comment you must log in.
Created attachment 730746
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 4da80956418bbe1 fdc23cad0b1cbb2 4cd7b87609 Mon Sep 17 00:00:00 2001 q?Patrik= 20H=C3= A4gglund? = <email address hidden>
From: =?UTF-8?
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.