This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Initialize the entire obstack struct [BZ #17919]
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>, libc-alpha at sourceware dot org
- Date: Tue, 03 Feb 2015 11:30:17 -0500
- Subject: Re: [PATCH] Initialize the entire obstack struct [BZ #17919]
- Authentication-results: sourceware.org; auth=none
- References: <20150203145649 dot GG1528 at spoyarek dot pnq dot redhat dot com>
On 02/03/2015 09:56 AM, Siddhesh Poyarekar wrote:
> Hi,
>
> obstack_init does not completely initialize the obstack structure; it
> leaves out the padding bits and valgrind complains about it on s390x:
>
> ==15793== Memcheck, a memory error detector
> ==15793== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==15793== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==15793== Command: /root/obstack
> ==15793==
> ==15793== Conditional jump or move depends on uninitialised value(s)
> ==15793== at 0x403E48CA4E: obstack_free (in /lib64/libc-2.12.so)
> ==15793== by 0x8000072D: main (obstack.c:12)
> ==15793==
> ==15793==
> ==15793== HEAP SUMMARY:
> ==15793== in use at exit: 0 bytes in 0 blocks
> ==15793== total heap usage: 1 allocs, 1 frees, 4,064 bytes allocated
> ==15793==
> ==15793== All heap blocks were freed -- no leaks are possible
> ==15793==
> ==15793== For counts of detected and suppressed errors, rerun with: -v
> ==15793== Use --track-origins=yes to see where uninitialised values come from
> ==15793== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
Is this a valgrind bug, false positive in valgrind, or bug in glibc?
It clearly says we have a move that depends on an uninitizlied value,
so something read the value and tried to do something with it.
Cheers,
Carlos.