Patches: Browse | Submit New | Admin

[#17960] sys-proctable leaks dir handles from yield in certain circumstances

Date:
2008-02-11 15:06
Priority:
3
Submitted By:
Patrick Hurley (phurley)
Assigned To:
Daniel Berger (djberg96)
Category:
sys-proctable
State:
Closed
Summary:
sys-proctable leaks dir handles from yield in certain circumstances

Detailed description
I am using sys-proctable in long running process in the following way:

# a little more complicated, but this will trigger the bug
Sys::ProcTable.ps do |pt|
  break if pt.cmdline.match(/ruby/)
end

which was preventing the closedir from being called in proctable_ps
(linux.c). I wrapped the body of proctable_ps into a new function,
proctable_body and use rb_ensure to ensure that even crazy people like
me don't leak dir handles.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2014-02-26 17:16
Sender: Daniel Berger

Transferred this issue to github.
Date: 2009-02-25 15:09
Sender: Daniel Berger

Well, the Solaris and Linux versions no longer need to worry
about this since they're now pure Ruby. The other platforms on
the other hand...
Date: 2008-06-07 12:53
Sender: Daniel Berger

I need to revisit this....
Date: 2008-02-12 06:07
Sender: Daniel Berger

Applied in CVS (except for the part where the pid and dirhandle
were reversed in the argument order). Will be part of the 0.8.0
release once I get similar logic applied to the other platforms.

Thanks,

Dan

Date: 2008-02-11 21:10
Sender: Daniel Berger

Attaching the patch... :)

Dan

Attached Files:

Name Description Download
sys-proctable.patch Patch to ensure dirhandle is closed on Linux Download

Changes:

Field Old Value Date By
close_date2014-02-26 17:162014-02-26 17:16djberg96
status_idOpen2014-02-26 17:16djberg96
status_idClosed2008-06-07 12:53djberg96
status_idOpen2008-02-12 06:07djberg96
resolution_idNone2008-02-12 06:07djberg96
close_date2008-02-12 06:072008-02-12 06:07djberg96
File Added3357: sys-proctable.patch2008-02-11 21:10djberg96