[PATCH] selftests: riscv: Bypass libc in inactive vector ptrace test

Paul Walmsley pjw at kernel.org
Wed Jul 8 00:16:52 PDT 2026


On Tue, 7 Jul 2026, Andrew Jones wrote:

> The ptrace_v_not_enabled test expects the child to reach its ebreak
> before it has used the vector extension. That is not guaranteed when
> using fork(), because libc may run child atfork handlers before
> returning to the test code. In those cases PTRACE_GETREGSET for
> NT_RISCV_VECTOR then succeeds instead of returning ENODATA for
> inactive vector state.
> 
> Use the raw clone syscall with SIGCHLD to keep fork-like semantics
> while bypassing libc's fork wrapper and atfork handler chain.
> 
> Cc: Andy Chiu <tchiu at tenstorrent.com>
> Assisted-by: Claude:claude-sonnet-4-6
> Signed-off-by: Andrew Jones <andrew.jones at oss.qualcomm.com>

Thanks, queued for v7.2-rc.

- Paul



More information about the linux-riscv mailing list