Bug 446401

Summary: unhandled series of rr-specific syscalls
Product: [Developer tools] valgrind Reporter: Jim Garrison <jim>
Component: generalAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: minor CC: p.e.c.melis
Priority: NOR    
Version: 3.18.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jim Garrison 2021-12-03 02:59:05 UTC
SUMMARY

Valgrind complains about unimplemented syscalls when it encounters system calls specific to rr (the record and replay framework)

STEPS TO REPRODUCE
1. I'm running portions of the Julia test suite under valgrind, following the instructions at https://docs.julialang.org/en/v1/devdocs/valgrind/#Running-the-Julia-test-suite-under-Valgrind (for the purposes here, `all` can be replaced by a much simpler set of tests, such as `tuple`).

OBSERVED RESULT

valgrind succeeds, but emits the following warning:

--114742-- WARNING: unhandled amd64-linux syscall: 1008
--114742-- You may be able to write your own handler.
--114742-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--114742-- Nevertheless we consider this a bug.  Please report
--114742-- it at http://valgrind.org/support/bug_reports.html.

The README_MISSING_SYSCALL_OR_IOCTL document instructs me to run `grep 1008 /usr/include/asm/unistd*.h`, but this turns up nothing.

Turns out, julia is making this syscall to determine whether it is running under rr: https://github.com/JuliaLang/julia/blob/ed9ad60f0ce7cad38870b2bf9eede5dd7a4b706f/test/runtests.jl#L17-L20

There are a number of rr-specific syscalls that valgrind might want to either handle, ignore, or display a *different*, more informative warning about: https://github.com/rr-debugger/rr/blob/b8566d29a78d798d547e520fcaaa217a241430e0/src/syscalls.py#L1736-L1747

EXPECTED RESULT

No warning emitted would be ideal.
Comment 1 Jim Garrison 2021-12-05 04:08:51 UTC
I found a more descriptive list of the rr-specific syscalls.  It seems it should be safe to ignore 1008, specifically, under Valgrind.

https://github.com/rr-debugger/rr/blob/878f756966c660a6e838cbf3516f953e586b9edc/src/preload/rrcalls.h#L68-L75