Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/hcsshim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.11.6
Choose a base ref
...
head repository: microsoft/hcsshim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.7
Choose a head ref
  • 1 commit
  • 1 file changed
  • 2 contributors

Commits on Jun 27, 2024

  1. Fix process handle leak when launching a job container (#2187)

    CreateProcess gives us back a handle to the newly created process.
    Previously, we ignored this handle, which meant it was leaking every
    time we created a new job container (or anything else that uses
    internal/exec in the future).
    
    Process handle leaks can be bad as an exited process is left as a
    "zombie" until all handles to it have closed, continuing to use memory.
    
    Fix this by closing the handle from CreateProcess.
    
    Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
    Co-authored-by: Kevin Parsons <kevpar@microsoft.com>
    yyatmsft and kevpar authored Jun 27, 2024
    Copy the full SHA
    6749c2f View commit details
Showing with 1 addition and 1 deletion.
  1. +1 −1 internal/exec/exec.go
2 changes: 1 addition & 1 deletion internal/exec/exec.go
Original file line number Diff line number Diff line change
@@ -209,8 +209,8 @@ func (e *Exec) Start() error {
if err != nil {
return fmt.Errorf("failed to create process: %w", err)
}
// Don't need the thread handle for anything.
defer func() {
_ = windows.CloseHandle(windows.Handle(pi.Process))
_ = windows.CloseHandle(windows.Handle(pi.Thread))
}()