This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: strange problem in libc: free invalid pointer, but valgrind doesn't show it.
- From: "Linda A. Walsh" <gcc at tlinx dot org>
- To: "libc-help at sourceware dot org" <libc-help at sourceware dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 12 Aug 2014 03:01:00 -0700
- Subject: Re: strange problem in libc: free invalid pointer, but valgrind doesn't show it.
- Authentication-results: sourceware.org; auth=none
- References: <53E9DBC8 dot 7080205 at tlinx dot org>
I added a call to the print statement before the assignment.
When not in vg, it gets ugly:
FMG:rfrsh:sc(0)<W(696);sw={0/1;1},s/c={0/1;1}
fields_sz=3, vals=2147483636,2147483637,2147483637,
col_samp_dat_sz=3, vals=2147483630,2147483637,2147483637,
samples[0].D_sz=-1162167622,
vals=2147483620,2147483637,2147483637,...doesn't stop.
When in vg it looks normal:
FMG:rfrsh:sc(0)<W(696);sw={0/1;1},s/c={0/1;1}
fields_sz=3, vals=2147483636,2147483637,2147483637,
col_samp_dat_sz=3, vals=2147483630,2147483637,2147483637,
samples[0].D_sz=0, vals=
samples[0].D_sz=3, vals=2147483630,2147483637,2147483637,
---
So it looks like it doesn't like me assigning to a val array not of the
same size? But it works on vg?
I have an idea of how to work around this, but shouldn't the
l-value "array" pick up it's size from the r-value "array" (C++ valarray)?
FWIW, no value in samples "should" have a data array(D) w/sz=0, so
I'm guessing that fixing that should stop this from happening.
If the space on a valarray needs to be pre-declared, then that's
the problem. If not, then dunno.
Cheers, and sorry for the bother if it's a language-cockpit error...