async icon indicating copy to clipboard operation
async copied to clipboard

New leak, on process spawn

Open clementfarabet opened this issue 11 years ago • 3 comments

here's a test that demonstrates it. Node idea where it comes from yet.

clementfarabet avatar Feb 14 '14 02:02 clementfarabet

From a glance, it looks like another reference counting issue. increases the refcount here luv_functions.c line 1367

But on killing the process with uv.process_kill it doesn't decrease the refcount. After killing a process, you have to explicitly close the handle with uv.close in https://github.com/clementfarabet/async/blob/master/async/process.lua line 24

I think that might fix it.

soumith avatar Feb 14 '14 02:02 soumith

You can't close it directly after, you need to wait for the onexit event, and then close it, which is how I'm doing it right now. I also close the stdin, stdout, and stderr.

clementfarabet avatar Feb 14 '14 04:02 clementfarabet

Ah OK. Then maybe check if onexit is getting generated when kill is called?

What about a test where you don't kill the process and it finished cleanly. Does it leak then as well? On Feb 14, 2014 9:44 AM, "Clement Farabet" [email protected] wrote:

You can't close it directly after, you need to wait for the onexit event, and then close it, which is how I'm doing it right now. I also close the stdin, stdout, and stderr.

Reply to this email directly or view it on GitHubhttps://github.com/clementfarabet/async/issues/12#issuecomment-35054280 .

soumith avatar Feb 14 '14 04:02 soumith