| Summary: | FreeBSD syscall arguments 7 and 8 incorrect. | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Paul Floyd <pjfloyd> |
| Component: | general | Assignee: | Paul Floyd <pjfloyd> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 3.25 GIT | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | FreeBSD | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Paul Floyd
2025-03-21 21:50:58 UTC
I wrote a little test based on scalar
#include "scalar.h"
int main(void)
{
SY(SYS_sendfile, 1000, 2, 3, 4, 5, 6, 7, 8);
return(0);
}
I can comment out the sfMayBlock - the syscall will fail so no question of blocking. That allows me to test both VG_(do_syscall) and
ML_(do_syscall_for_client_WRK).
On arm64 I get the right arguments in ktrace in both cases.
On both x86 and amd64 ML_(do_syscall_for_client_WRK) (with sfMayBlock) both look OK.
On x86 VG_(do_syscall) (without sfMayBlock) looks OK
On amd64 VG_(do_syscall) (without sfMayBlock) looks bad
74122 memcheck-amd64-free CALL sendfile(0x3e8,0x2,0x3,0x4,0x5,0x6,0x8<><invalid>8)
That last argument should be 7.
If I reverse the stack offsets used for a7 and a8 in do_syscall_WRK then I get good results.
No testcase. Not sure how to get Vallgrind to run under something like truss or ktrace. commit 5334917c8e0e44e6a98657050a66bc28fa638165 (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Sat Mar 22 08:15:35 2025 +0100 Bug 501850 - FreeBSD syscall arguments 7 and 8 incorrect. |