Merge pull request #9312 from jseba:jseba/specfile_keepalive

PiperOrigin-RevId: 559927487
This commit is contained in:
gVisor bot
2023-08-24 18:07:17 -07:00
+5
View File
@@ -293,6 +293,11 @@ func (b *Boot) Execute(_ context.Context, f *flag.FlagSet, args ...any) subcomma
// because the ReadSpecFromFile function seeks to the beginning
// of the file before reading.
util.Fatalf("callSelfAsNobody(%v): %v", args, callSelfAsNobody(args))
// This prevents the specFile finalizer from running and closed
// the specFD, which we have passed to ourselves when
// re-execing.
runtime.KeepAlive(specFile)
panic("unreachable")
}
}