This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/9957] malloc hook accesses aren't thread-safe


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]