moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.09k stars 182 forks source link

Resource leak spawning uname subprocess call on Darwin #592

Closed tmoschou closed 1 year ago

tmoschou commented 1 year ago

The uname command / subprocess spawned by vpnkit is not cleaned up / reaped appropriately. The result is a zombie subprocess which lingers in the process table.

This seems to be due to not calling Unix.close_process_in instead of close_in in src/bin/config/discover.ml

Screenshot of htop

Screen Shot 2022-08-14 at 5 24 14 pm

Output of ps -o pid,state,xstat,command -p 72041

  PID STAT XSTAT COMMAND
72041 Z        0 (uname)