Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

EOF on stdin is not handled correctly (busy loop, mem leak) #32

eriksoe opened this Issue Oct 31, 2010 · 3 comments


None yet
2 participants

eriksoe commented Oct 31, 2010

In FDDriverInstance, in the run() function in the anonymous Thread class, EOF is handled by sending EOF signal to finish(), then allocating nother 1K buffer and repeating.
This busy loop means that on EOF, we have both a 100% CPU condition and (unless the receiver keeps up) a rapidly-growing-memory footprint issue.


eriksoe commented Oct 31, 2010

Should the Thread.run() method simply return after calling finish(-1,_)?


krestenkrab commented Oct 31, 2010

Feel free to write a succested fix :-). Seems like you already have it sorted out.


eriksoe commented Nov 4, 2010

Yes, except that the finish(-1,_) line wasn't called at all; EOF is not signalled with an exception.
Fixed now.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment