Bug 629976
| Summary: | valgrind claims "Invalid free() ... below main" | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ed Santiago <santiago> | ||||
| Component: | glibc | Assignee: | Andreas Schwab <schwab> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 12 | CC: | caolanm, dodji, fweimer, jakub, roland, schwab | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | glibc-2.12.90-14 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2010-09-30 06:15:51 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Ed Santiago
2010-09-03 12:31:48 UTC
Update: this is not looking like a problem with valgrind, but I don't know where to refile. Message thread excerpted & summarized below.
-----------------------------------------------------------------------------
Date: Fri, 3 Sep 2010 14:57:12 +0200
From: Jakub Jelinek <jakub>
I don't think that is valgrind's fault, it looks like a ld.so/libc fault.
If it passes a memory allocated by ld.so's malloc, it shouldn't pass
that ever to free, not even in freeres.
valgrind free isn't the only one that doesn't like that sort of thing,
I bet glibc malloc wouldn't like it too, similarly other malloc
implementations.
------------------------------------------------------------------------------
Date: Fri, 3 Sep 2010 12:51:27 -0700 (PDT)
From: Roland McGrath <roland>
Indeed,
int main ()
{
__libc_freeres ();
return 0;
}
compiled with -ldw gets malloc trace crash.
------------------------------------------------------------------------------
Date: Fri, 3 Sep 2010 13:28:47 -0700 (PDT)
From: Roland McGrath <roland>
Any trivial DSO reproduces it if there is both a
DT_RUNPATH and a DT_NEEDED that needs it.
% cat freeres.c
int main ()
{
__libc_freeres ();
return 0;
}
% gcc -xc /dev/null -shared -o null.so
% gcc -xc /dev/null -shared -o rpath.so -Wl,null.so -Wl,--enable-new-dtags,-rpat
h,$PWD
% gcc -g -o fmh freeres.c ./rpath.so
% ./fmh
*** glibc detected *** ./fmh: free(): invalid pointer: 0x00007f0f649694d8 ***
*** Bug 631870 has been marked as a duplicate of this bug. *** glibc-2.12.90-13 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/glibc-2.12.90-13 glibc-2.12.90-13 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update glibc'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/glibc-2.12.90-13 glibc-2.12.90-14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update glibc'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/glibc-2.12.90-14 glibc-2.12.90-14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. |