This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug malloc/19182] New: malloc deadlock between ptmalloc_lock_all and _int_new_arena
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 28 Oct 2015 19:29:26 +0000
- Subject: [Bug malloc/19182] New: malloc deadlock between ptmalloc_lock_all and _int_new_arena
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19182
Bug ID: 19182
Summary: malloc deadlock between ptmalloc_lock_all and
_int_new_arena
Product: glibc
Version: 2.23
Status: NEW
Severity: normal
Priority: P2
Component: malloc
Assignee: unassigned at sourceware dot org
Reporter: fweimer at redhat dot com
Target Milestone: ---
Flags: security-
ptmalloc_lock_all acquires list_lock, then arena locks. _int_new_arena
acquires an arena lock, then list_lock. This is a potential deadlock.
I think we can use a separate lock in ptmalloc_lock_all because this function
does not access any of the arena fields protected by list_lock.
There is also this bit which cannot be right.
/* Suspend the thread until the `atfork' handlers have completed.
By that time, the hooks will have been reset as well, so that
mALLOc() can be used again. */
(void) mutex_lock (&list_lock);
(void) mutex_unlock (&list_lock);
--
You are receiving this mail because:
You are on the CC list for the bug.