From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68918 invoked by alias); 1 Oct 2015 21:13:11 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 68887 invoked by uid 48); 1 Oct 2015 21:13:06 -0000 From: "paulo.cesar.pereira.de.andrade at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug malloc/19048] New: Avoid corruption of free_list Date: Thu, 01 Oct 2015 21:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: malloc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: paulo.cesar.pereira.de.andrade at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00024.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=19048 Bug ID: 19048 Summary: Avoid corruption of free_list Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: malloc Assignee: unassigned at sourceware dot org Reporter: paulo.cesar.pereira.de.andrade at gmail dot com Target Milestone: --- Created attachment 8666 --> https://sourceware.org/bugzilla/attachment.cgi?id=8666&action=edit 0001-Avoid-corruption-of-free_list.patch When a thread leaves, arena_thread_freeres is called, the malloc arena associated with the thread is added to the head of free_list, and free_list set to the arena of the exiting thread. A common problem can be described as: 1. thread "t1" uses arena "a" 2. thread "t2" uses arena "a" 3. "t1" exit, making: a->next_free = free_list; free_list = a; 4. "t2" exits, but since free_list == a, it ends with free_list->next_free = free_list; When a program has several short lived threads, and most commonly when there are more threads than arenas, one arena will end up being used by most threads, causing significant contention. -- You are receiving this mail because: You are on the CC list for the bug.