develooper Front page | perl.perl5.porters | Postings from February 2018

Re: Many new valgrind errors in blead in Cwd

Thread Previous
February 25, 2018 10:12
Re: Many new valgrind errors in blead in Cwd
Message ID:
On 25 February 2018 at 06:07, Karl Williamson <> wrote:
> Suddenly, 100 more testfiles now have valgrind errors in them.  They all
> appear to be like the one attached.
> But, memmove allows its arguments to be overlapping, so I don't understand
> why it is complaining

Not sure why you attached that. Here it is:

==14649== Source and destination overlap in memcpy_chk(0xffeffbeb0,
0xffeffbeb4, 16)
==14649==    at 0x4C35457: __memcpy_chk (in
==14649==    by 0x9A76488: memmove (string3.h:59)
==14649==    by 0x9A76488: bsd_realpath (Cwd.xs:128)
==14649==    by 0x9A76488: XS_Cwd_abs_path (Cwd.xs:594)
==14649==    by 0x1DADDF: Perl_pp_entersub (pp_hot.c:5216)
==14649==    by 0x1D1252: Perl_runops_standard (run.c:41)
==14649==    by 0x15AE25: S_run_body (perl.c:2755)
==14649==    by 0x15AE25: perl_run (perl.c:2671)
==14649==    by 0x134DAE: main (perlmain.c:122)

Could this be a valgrind error? It says it is invoking __memcpy_chk(),
and memcpy is documented as not allowing overlap.

A google on "valgrind memmove __memcpy_chk" finds various potentially
relevant references, including an older one that suggests that gcc may
"optimize" a memmove into a memcpy in some cases.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About