[Spice-devel] [PATCH spice-server] ci: Workaround bug in Valgrind detecting memcpy instead of memmove

Christophe Fergeau cfergeau at redhat.com
Tue Apr 17 07:22:37 UTC 2018


On Mon, Apr 16, 2018 at 02:07:57PM -0400, Frediano Ziglio wrote:
> > 
> > On Mon, Apr 16, 2018 at 05:02:33PM +0100, Frediano Ziglio wrote:
> > > Due to a bug in current packaged Valgrind check-valgrind is failing
> > > with:
> > > 
> > > ==17986== Source and destination overlap in memcpy_chk(0x72c060, 0x72c068,
> > > 33)
> > > ==17986==    at 0x4C344F0: __memcpy_chk (vg_replace_strmem.c:1581)
> > > ==17986==    by 0x40E7E9: check_vmc_error_message
> > > (test-stream-device.c:166)
> > > ==17986==    by 0x40EFD4: test_stream_device_format_after_data
> > > (test-stream-device.c:349)
> > > ==17986==    by 0x7A012E9: test_case_run (gtestutils.c:2157)
> > > ==17986==    by 0x7A012E9: g_test_run_suite_internal (gtestutils.c:2241)
> > > ==17986==    by 0x7A0121A: g_test_run_suite_internal (gtestutils.c:2253)
> > > ==17986==    by 0x7A014C1: g_test_run_suite (gtestutils.c:2329)
> > > ==17986==    by 0x7A014E0: g_test_run (gtestutils.c:1594)
> > > ==17986==    by 0x40951A: main (test-stream-device.c:410)
> > > ==17986==
> > > 
> > > Note that source code calls memmove instead of memcpy (memmove
> > > supports overlapping).
> > > Disable call to __memmove_chk to avoid the issue.
> > 
> > __memcpy_chk? Not clear how this is achieved from the log. By disabling
> > _FORTIFY_SOURCE I assume?
> > 
> > Christophe
> > 
> 
> The bug is this:
> 

I'd add in the log that in the CI, we build with _FORTIFY_SOURCE by
default, which turns memmove into __memmove_chk, which is wrongly
turned into __memcpy_chk when running under valgrind, and that setting
FORTIFY_SOURCE to 0 prevents the use of __memmove_chk, and avoids
triggering the valgrind bug.
But hopefully the fedora fix will come soon? Can you add the exact name
of the buggy valgrind package so that it's easier later to check whether
this was fixed or not?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180417/edd0eea1/attachment-0001.sig>


More information about the Spice-devel mailing list