syscall: rawVforkSyscall works differently outside syscall package via go:link syscall.rawVforkSyscall #71892
Labels
BugReport
Issues describing a possible bug in the Go implementation.
compiler/runtime
Issues related to the Go compiler and/or runtime.
Go version
go version go1.24.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Trying to use
vfork
viarawVforkSyscall
outside of the syscall packageWhat did you see happen?
The program exited with exit code
253
and only printedstart
, it suggests the parent thread resumes at the point where child callsexit
, and continued toexit_group(253)
, which should never reach.If
testVfork
copied tosyscall
package (just for testing), and callsrawVforkSyscall
directly, the program exits normally as expected. There might be behaviour difference with the linker.Using
go tool objdump
, the above code generatesCALL syscall.rawVforkSyscall(SB)
while the function withinsyscall
package generatesCALL syscall.rawVforkSyscall.abi0(SB)
. However, linkingsyscall.rawVforkSyscall.abi0
viago:linkname
is not possible (relocation target syscall.rawVforkSyscall.abi0 not defined
).What did you expect to see?
The program exited with exit code
0
and printsstart
,finished
.The text was updated successfully, but these errors were encountered: