Skip to content

Valgrind reports source and destination overlap in memcpy_chk in cpuinfo_linux_parse_cpulist #331

@lifang-zhang

Description

@lifang-zhang

When running a program that depends on ONNX Runtime (which includes cpuinfo) under Valgrind, I encounter the following error originating from cpulist.c:

==3397093== Source and destination overlap in memcpy_chk(0x1ffefff8b0, 0x1ffefff8b0, 5)
==3397093== at 0x48517A0: __memcpy_chk (vg_replace_strmem.c:1723)
==3397093== by 0x5BB2405: memmove (string_fortified.h:36)
==3397093== by 0x5BB2405: cpuinfo_linux_parse_cpulist (cpulist.c:227)
...

It appears that memmove is being called with the same source and destination pointers in cpuinfo_linux_parse_cpulist, which triggers this warning in Valgrind. Could you please take a look and suggest a fix? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions