This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 9939
  MCheck is not thread safe - can report false errors on multi threaded apps Last modified: 2009-03-11 15:14
     Query page      Enter new bug
Bug#: 9939   Hardware:   Reporter: Wayne Johnson <wdtj@yahoo.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: WONTFIX   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 9939 depends on: Show dependency tree
Show dependency graph
Bug 9939 blocks:

Additional Comments:


Leave as RESOLVED WONTFIX
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2009-03-11 15:08
MCheck is not thread safe - can report false errors on multi threaded apps.  

mcheck.c uses the __malloc_hook (et al) feature of malloc.c & arena.c to
intercept memory requests.  During it's processing, it swaps the _hooks back to
their original values and recursively calls the memory request in order to do
the actual memory request.  While this hook is swapped out, another thread could
call the memory request and at that point get memory that bypassed mcheck.  This
memory will then be reported as corrupt if it is freed with the mcheck hook back
in place.

Possible fixes:
1) Add linkage to malloc.c's _int_malloc (el al) functions that would allow
mcheck to access the memory allocation without having to go through the code
implementing the hooks.

2) Change or add a new hook set that allows the hooker to wrapper the call, not
just intercept it.

3) Write a separate memory pool routine for use in mcheck.  (yuck).

------- Additional Comment #1 From Ulrich Drepper 2009-03-11 15:14 -------
This is by design.  This can never be changed without breaking various ABIs.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In