public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug malloc/19048] New: Avoid corruption of free_list
@ 2015-10-01 21:13 paulo.cesar.pereira.de.andrade at gmail dot com
  2015-10-01 21:14 ` [Bug malloc/19048] " paulo.cesar.pereira.de.andrade at gmail dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: paulo.cesar.pereira.de.andrade at gmail dot com @ 2015-10-01 21:13 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-10-29 17:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 21:13 [Bug malloc/19048] New: Avoid corruption of free_list paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-01 21:14 ` [Bug malloc/19048] " paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-01 21:18 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-01 21:24 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-01 21:27 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-02 13:14 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-02 14:33 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-07 18:02 ` fweimer at redhat dot com
2015-10-08 15:59 ` fweimer at redhat dot com
2015-10-09 16:26 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-10-09 16:34 ` fweimer at redhat dot com
2015-10-12 11:30 ` [Bug malloc/19048] malloc: " fweimer at redhat dot com
2015-10-15  8:40 ` fweimer at redhat dot com
2015-10-15  8:45 ` [Bug malloc/19048] malloc: arena free list can become cyclic, increasing contention fweimer at redhat dot com
2015-10-15  8:46 ` fweimer at redhat dot com
2015-10-15  9:41 ` fweimer at redhat dot com
2015-10-28 20:37 ` cvs-commit at gcc dot gnu.org
2015-10-28 20:41 ` fweimer at redhat dot com
2015-10-29 17:10 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).