This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/9957] malloc hook accesses aren't thread-safe
- From: "krebbel1 at de dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 16 Mar 2009 14:35:45 -0000
- Subject: [Bug libc/9957] malloc hook accesses aren't thread-safe
- References: <20090316123937.9957.krebbel1@de.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From krebbel1 at de dot ibm dot com 2009-03-16 14:35 -------
(In reply to comment #2)
> The hooks are not thread-safe. Period. What are you trying to fix?
Due to your comment (from several years ago) to rev 1.86:
"Make access to ..._hook pointers thread-safe." I assumed that these hooks
originally were intended to be thread-safe and I really think they should.
> If anything, the variables should be marked volatile. You can try that.
Yes "volatile" would also prevent GCC from optimizing here but I think it goes
beyond what we actually need. "volatile" basically disables every optimization
wrt that variable. I think the inline assembly exactly expresses what happens
here and is a more subtle way to fix the problem.
Unfortunately I am not able to come up with a testcase. A customer just provided
a core dump of a program which crashes due to the __malloc_hook variable set to
NULL while trying to invoke it. The customer is already testing a similar patch
and runs without problems for a week by now. The customer code does not set the
__malloc_hook variable itself so I can just assume that the modification comes
from within libc.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
http://sourceware.org/bugzilla/show_bug.cgi?id=9957
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.