[Bug 30850] Invalid valgrind warnings after HeapReAlloc

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Jun 9 21:43:45 CDT 2012


http://bugs.winehq.org/show_bug.cgi?id=30850

Dan Kegel <dank at kegel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |testcase
                URL|http://www.gigasoft.com/PE7 |
                   |-Pro-Setup.exe              |
            Summary|Heap problem when running   |Invalid valgrind warnings
                   |Gigasoft ProEssentials      |after HeapReAlloc
                   |graph component?            |

--- Comment #4 from Dan Kegel <dank at kegel.com> 2012-06-09 21:43:45 CDT ---
Here's an even smaller testcase:

#include <windows.h>

int main(int argc, char **argv)
{
    void *p, *q, *r;
    p = HeapAlloc(GetProcessHeap(), 0, 8100);
    // Commenting out HeapReAlloc avoids valgrind warning
    q = HeapReAlloc(GetProcessHeap(), 0, p, 4100);
    // This heap operation generates spurious warnings under valgrind
    r = HeapAlloc(GetProcessHeap(), 0, 1234);
    return *(char *)q;
}

so it's pretty clearly a problem in our heap annotations... and happily
the problem is obvious: notify_realloc() was called after HEAP_ShrinkBlock
in one place, clobbering its annotations.  Reversing the order of the
calls fixes the problem.

Patch sent, 
http://www.winehq.org/pipermail/wine-patches/2012-June/114929.html

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list