toddr / Net-Daemon

Read-only release history for Net-Daemon
http://metacpan.org/release/Net-Daemon
0 stars 0 forks source link

Leftover mappings from thread creation [rt.cpan.org #27981] #12

Open toddr opened 3 years ago

toddr commented 3 years ago

Migrated from rt.cpan.org#27981 (status was 'open')

Requestors:

Attachments:

From m.nooning@comcast.net on 2007-07-05 13:18:49 :

---------paste mnooning repy
Hello Kevin,

I suspect you are correct.

I also suspect I am about to be the bearer of bad news.

You see,  I do not know thread programming.  I have accepted baton in
maintaining Net::Daemon because the maintainer before me at already left
the project, and bugs were cropping up that needed fixed, and the
original author was no longer working with it either. 
One of the prior problems, now fixed thanks to some industrious and
knowledgeable others, was with threads programming.  I contacted the
original author who wrote me that the threads portion was put in after
he left the project.  So .... I am going to enter this as a bug at
rt.cpan.org and hope that someone (like you?) plus others, will come up
with ideas to fix it.

The last three bugs I fixed were really fixed because other people wrote
in ideas.  I just put it together.  I hope this will happen again here.

Thanks

---------end paste
------- paste: Kevin Vincent Sheehan wrote:
M,

First off, let me praise Net::Daemon in no uncertain terms. It let me
set up a  daemon to monitor 150 lab systems for temperature, performance
and let me  control idling them to keep our A/C from going out.  I'm not
even a good Perl programmer, and it only took me 2 days. :-)

Secondly, I think I've found a bug.  Running the daemon for some time
creates a very large VM footprint that consists of leftover mappings
from thread creation. (The daemon is contacted every 10 minutes).

I believe that the Daemon code fails to do a ->join() or ->detach() on
the  created threads.  Under 3 different distros (RHEL3, FC4, rPath) I
see the  thread exit (which cleans it up as far as the kernel is
concerned) but I don't  see the mappings torn down, so they collect over
time.  I simulated the problem with threads alone and see the same behavior.

ChildFunc for these distros uses the 'ithreads' method, which means that
 threads()->new() is called. I don't see the thread saved, and I don't
see  ->join() called anywhere.  ->detach() might be sufficient to
acheive the desired effect, but I've not tried it out on our systems. 
------- end paste

From matej.vela@carnet.hr on 2008-02-08 22:09:05 :

I can confirm that calling ->detach() is the correct solution since
the return value isn't used.  Here's a patch, with corresponding tests.

Thanks,

Matej

From m.nooning@comcast.net on 2008-02-09 18:22:36 :

Once again I am indebted for the work of others.  Thanks Matej!

I probably will not able to get to this maybe for a few weeks.  However,
I do plan on incorporating your work, testing on Windows and Linux, and
then releasing a new version.

Thanks to all of you out there for your work.

And also, thanks to any cpan tester who may be reading this.  I can only
feel confident of my work when a number of you, on different platforms,
have reported passing test results.

Thanks again,

mnooning

From m.nooning@comncast.net on 2008-02-23 22:48:48 :

Hello Matej Vela,

I am using Perl 5.8.8 from ActiveState.  I installed the latest threads 
- 1.69, and threads::shared - 1.17.

Are the tests supposed to run on a Windows 2K or above machine?  Neither 
ithread-detach.t, nor thread-detach, seem to work on Windows.  Do you 
have access to a Windows 2000 or XP machine?

The tests start, but give errors that I did not try to discern since I 
don't know threads programming, and I don't know if you intended them to 
be able to run on Windows.

Thanks

From mnooning@cpan.org on 2011-03-01 16:49:22 :

Please try Net-Daemon-0.46

I tried Net-Daemon-0.46 on Windows, Fedora Linux from a few months ago,
then updated the Fedora and it still passes, so it looks like version
0.46 is a winner.  Thank you very much for taking the time to report the
bug.

From mnooning@cpan.org on 2011-03-01 16:49:24 :

Please try Net-Daemon-0.46

I tried Net-Daemon-0.46 on Windows, Fedora Linux from a few months ago,
then updated the Fedora and it still passes, so it looks like version
0.46 is a winner.  Thank you very much for taking the time to report the
bug.

From mnooning@cpan.org on 2011-03-01 18:04:38 :

On Tue Mar 01 11:49:24 2011, MNOONING wrote:
> Please try Net-Daemon-0.46
> 
> I tried Net-Daemon-0.46 on Windows, Fedora Linux from a few months ago,
> then updated the Fedora and it still passes, so it looks like version
> 0.46 is a winner.  Thank you very much for taking the time to report the
> bug.
> 

By the way, the patch you submitted still cause various failures, so I
did not incorporate your patch.  I did not the patch on Linux.
toddr commented 3 years ago

Based on the current state of master I have attempted to do the spirit of what was asked however the test currently hangs. I have not investigated it further. Patches/Pulls welcome.