I have a FreeBSD application that calls sctp_recvmsg() and sctp_sendx(). Attempting to run this application under valgrind results in an endless loop of the following and a non-functioning program: > sctp_recvmsg error: Function not implemented > --86035-- WARNING: unhandled amd64-freebsd syscall: 474 > --86035-- You may be able to write your own handler. > --86035-- Read the file README_MISSING_SYSCALL_OR_IOCTL. > --86035-- Nevertheless we consider this a bug. Please report > --86035-- it at http://valgrind.org/support/bug_reports.html. Implementing a handler for 474 results in a similar spew for syscall: 472, which is the sctp_sendmsg variant.
I attempted to implement handlers for both syscalls, resulting in the program running successfully without any errors or warnings. What is the best way to submit my patch for your consideration? I can attach a diff, but the attachment instructions pointed me to gitlab for merge requests, where I couldn't find the valgrind project.
You nan just click on “add attachment” on this page.
Valgrind does not use gitlab, it uses sourceware.org as its central repo, so the comment on the upload patch page does not apply.
Created attachment 154519 [details] Patch to add sctp_generic_sendmsg/recvmsg handlers
My initial impression is that this looks good. I'll have a go at finding a testcase and adding these syscalls to scalar.
I tried running one of the sctp stress tests (though not as a stress test) from /usr/src but it failed. I need to investigate more.
Should be fixed with commit 5b524084061b9d6d40d30cf41e2da70bce4682e0 (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Thu Dec 22 23:08:45 2022 +0100 Bug 462830 - WARNING: unhandled amd64-freebsd syscall: 474 Add syscall wrappers for sctp_generic_recvmsg and sctp_generic_sendmsg on FreeBSD. Can you confirm that this works?
I updated my valgrind-devel port to reference GH_TAGNAME=5b524084 and ran the application under valgrind. No complaints about the unhandled syscalls. Comparing the changes, I see that my patch wasn't quite right. Thank you for doing the additional work necessary to get this fixed properly upstream!