Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
os: StartProcess fails to keep Files alive after converting to uintptr array #34858
As noted during discussion of #34810, os.StartProcess fails to use runtime.KeepAlive to ensure attr.Files stays alive past the call to syscall.StartProcess. As a consquence, the os.Files might be garbage collected, and the FDs can be reclaimed before they're used.
Below is a proof of concept of this issue (it fails most runs, but not always):