serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibIPC: Do not leak the Core::File fd by default

Open SebastianZaha opened this issue 2 years ago • 0 comments

This prevents fd leaks when the user of the API forgets to pass CloseAfterSending to IPC::File. Since we are calling leak_fd in the constructor, we want it to also take care of closing.

After discovering a fd leak in headless-browser that was crashing the tests if the open file limit was 256, (PR #19853) I realized that WebContentView::notify_server_did_request_file was also leaking a fd. This would cause ladybird to silently crash / not load anymore after loading ulimit -a files from disk (256 or 2048 seem to be popular defaults).

SebastianZaha avatar Jul 10 '23 13:07 SebastianZaha