This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10282] free() race in mcheck hooks
- From: "pasky at suse dot cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 15 Jun 2009 22:37:45 -0000
- Subject: [Bug libc/10282] free() race in mcheck hooks
- References: <20090614230415.10282.pasky@suse.cz>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From pasky at suse dot cz 2009-06-15 22:37 -------
Created an attachment (id=4001)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4001&action=view)
deadlock-free proposed patch
Revised patch; unfortunately, the ATOMIC_FASTBINS stuff makes the code fairly
ugly now... getting rid of the #if 0 bit might help a little.
Without this patch, this crashes in few tens of seconds on my four-core when
run with MALLOC_CHECK_=3:
/* compile with -fopenmp */
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
#pragma omp parallel num_threads(256)
while (1) {
void *ptr = malloc(rand() % 65536);
usleep((rand() % 100) * 100);
free(ptr);
usleep((rand() % 100) * 100);
}
return 0;
}
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #3996 is|0 |1
obsolete| |
http://sourceware.org/bugzilla/show_bug.cgi?id=10282
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.