RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1451308 - glibc: Fix valgrind reporting with check_pf when there is no ipv6 interface
Summary: glibc: Fix valgrind reporting with check_pf when there is no ipv6 interface
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Arjun Shankar
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks: 1594286 1710258
TreeView+ depends on / blocked
 
Reported: 2017-05-16 11:26 UTC by Deepu K S
Modified: 2023-09-07 18:52 UTC (History)
12 users (show)

Fixed In Version: glibc-2.17-296.el7
Doc Type: Bug Fix
Doc Text:
Cause: When running on a system with IPv6 disabled, a pointer used internally by the getaddrinfo function was deallocated and assigned the address of a statically allocated structure instead. Consequence: The runtime incorrectly attempted to deallocate this statically allocated memory at program exit. This led to a crash at program exit and/or an "invalid free" error when run under `valgrind'. Fix: getaddrinfo was fixed so that at program exit, it now only deallocates this memory if it is dynamically allocated. Result: Programs using getaddrinfo running on systems with IPv6 disabled no longer crash and/or show "invalid free" errors when run under `valgrind'.
Clone Of:
Environment:
Last Closed: 2020-03-31 19:08:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:0989 0 None None None 2020-03-31 19:08:56 UTC
Sourceware 17125 0 P2 RESOLVED posix/bug-ga2 fails when there is no ipv6 interface 2021-01-04 10:09:07 UTC

Description Deepu K S 2017-05-16 11:26:58 UTC
Description of problem:
posix/bug-ga2 fails when there is no ipv6 interface.

The test posix/bug-ga2 fails with the following error:

*** Error in `/root/src/upstream/glibc/build/posix/bug-ga2': free(): invalid pointer: 0x00007fe7ab1bc370 **
*

There is a known issue in libc 2.17 (https://sourceware.org/ml/libc-alpha/2014-07/msg00200.html) when the system doesn’t have ipv6 configured, libc points the noai6ai_cached to a static variable which later results in freeing an invalid pointer at exit.

Due to this, VALGRIND reports "Invalid free() / delete / delete[] / realloc()" error in c++ application.

log snippet from valgrind:
==33350== 1 errors in context 1 of 1:
==33350== Invalid free() / delete / delete[] / realloc()
==33350==    at 0x4C28CDD: free (vg_replace_malloc.c:530)
==33350==    by 0x57B80EB: __libc_freeres (in /usr/lib64/libc-2.17.so)
==33350==    by 0x4A22749: _vgnU_freeres (vg_preloaded.c:77)
==33350==    by 0x568BA0A: __run_exit_handlers (exit.c:92)


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 7.3
glibc-2.17-157.el7_3.1.x86_64

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:

*** Error in `/root/src/upstream/glibc/build/posix/bug-ga2': free(): invalid pointer: 0x00007fe7ab1bc370 ***


Expected results:
No fail.

Additional info:

Comment 5 Florian Weimer 2017-10-02 15:53:29 UTC
I looked at the upstream fix and it seems wrong.  After the fix, we need leak the memory instead if the cache pointer was allocated on the heap.

We should remove the statically allocate structure and always allocate it on the heap.  Things have changed since the code was written.  Today, (unused) IPv6 interfaces are the default, and the static allocation just wastes RSS.

Comment 16 Sergey Kolosov 2019-10-18 15:05:31 UTC
Verified, the bug reproduced in glibc-2.17-295.el7 and didn't in glibc-2.17-296.el7.

Comment 18 errata-xmlrpc 2020-03-31 19:08:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0989


Note You need to log in before you can comment on or make changes to this bug.