Bug 470713 - Failure on the Yosys project: valgrind: m_libcfile.c:1802 (Bool vgPlain...
commit840ccb9915c675fd7db527107e6b38343fafdf86
authorPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 7 Jun 2023 20:27:08 +0000 (7 22:27 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 7 Jun 2023 20:27:08 +0000 (7 22:27 +0200)
tree648e0c1b463147df784cddffa92068eb6d603eef
parent453c7111133ce9dc5dce043e03b7b58efdbf46cd
Bug 470713 -  Failure on the Yosys project: valgrind: m_libcfile.c:1802 (Bool vgPlain_realpath(const HChar *, HChar *)): Assertion 'resolved' failed

    When using sysctl kern proc pathname with the pid of the guest or -1
    we need to intercept the call otherwise the syscall will return the path
    of the memcheck tool and not the path of the guest.

    This uses VG_(realpath), which asserts if it doesn't get valid
    input pointers.

    sysctl kern proc pathname can use a NULL pointer in order to
    determine the length of the path (so users can allocate the minumum
    necessary). The NULL pointer was being passed on to VG_(realpath)
    without being checked, resulting in an assert.
.gitignore
NEWS
coregrind/m_syswrap/syswrap-freebsd.c
memcheck/tests/freebsd/Makefile.am
memcheck/tests/freebsd/bug470713.cpp [new file with mode: 0644]
memcheck/tests/freebsd/bug470713.stderr.exp [new file with mode: 0644]
memcheck/tests/freebsd/bug470713.stdout.exp [new file with mode: 0644]
memcheck/tests/freebsd/bug470713.vgtest [new file with mode: 0644]