clementfarabet / async

An async framework for Lua/Torch.
116 stars 35 forks source link

New leak, on process spawn #12

Open clementfarabet opened 10 years ago

clementfarabet commented 10 years ago

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

soumith commented 10 years ago

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.

clementfarabet commented 10 years ago

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.

soumith commented 10 years ago

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" notifications@github.com 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 .