paulfloyd / freebsd_valgrind

Git repo used to Upstream the FreeBSD Port of Valgrind
GNU General Public License v2.0
15 stars 4 forks source link

memcheck -- unhandled syscall 570, sysctlbyname, FreeBSD 12.2 #143

Closed nbriggs closed 3 years ago

nbriggs commented 3 years ago

valgrind version, from git:

commit 508da5c74a57a4c9c94a6b43ae7dcf0fe8a529c6 (HEAD -> freebsd, origin/freebsd, origin/HEAD)
Date:   Thu Oct 15 21:56:12 2020 +0200

ran into this report trying to memcheck an application on FreeBSD 12.2-RELEASE:

SYSCALL[9368,1](570) --9368-- WARNING: unhandled x86-freebsd syscall: 570
--9368-- You may be able to write your own handler.
--9368-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--9368-- Nevertheless we consider this a bug.  Please report
--9368-- it at http://valgrind.org/support/bug_reports.html.
 --> [pre-fail] Failure(0x4e) 

570 is sysctlbyname.

Looks as though you have that under an #if (FREEBSD_VERS >= FREEBSD_13) ?

paulfloyd commented 3 years ago

This will be an easy fix. The syscall is already implemented, I just need to get the right version macros.

nbriggs commented 3 years ago

Yeah, I thought so, looking at what is there. Judging by the man pages, sysctlbyname has been there since FreeBSD 2.2.5

paulfloyd commented 3 years ago

It's an old interface, but only recently made into a syscall.

For 12.2 syscalls go up to 575 https://github.com/freebsd/freebsd/blob/release/12.2.0/sys/kern/syscalls.master

I'll probably upgrade my main machine to 12.2 soonish. In the meantime I'll fix this and test on a VM.

nbriggs commented 3 years ago

Huh. Yeah, I just looked at the 12.1.0 to 12.2.0 changes in sys/kern/syscalls.master

paulfloyd commented 3 years ago

Should be fixed with this:

To github.com:paulfloyd/freebsd_valgrind.git 854352d2e..b040f7bcc freebsd -> freebsd

I still get about 70 fails om amd64 (due to clang 10)

nbriggs commented 3 years ago

Yes, it's no longer reporting the unhandled syscall. Thanks.