Skip Menu |

This queue is for tickets about the Sendmail-PMilter CPAN distribution.

Report information
The Basics
Id: 54794
Status: resolved
Priority: 0/
Queue: Sendmail-PMilter

People
Owner: pause [...] jubileegroup.co.uk
Requestors: misch [...] ati.land.cz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.97
Fixed in: 1.20_01



Subject: memory leak with ithreads dispatcher
ithread_dispatcher does not join() or detach() threads, so it creates memory leak with every accept() on incoming connection. Which means that program using Sendmail::PMilter can successfuly run for years when it does not receive any packets, but it starts eating memory with every new milter request :). Proposed change in Sendmail/PMilter.pm: - die "thread creation failed: $!\n" - unless (threads->create($child_sub, $socket)); + my $t = threads->create($child_sub, $socket) || die "thread creation failed: $!\n"; + $t->detach; # important Call to detach() is important as it frees thread memory as soon as the thread exits.
On Fri Feb 19 04:48:54 2010, http://mimon-cz.blogspot.com/ wrote: Show quoted text
> ithread_dispatcher does not join() or detach() threads, so it creates > memory leak with every accept() on incoming connection. > > Which means that program using Sendmail::PMilter can successfuly run
for Show quoted text
> years when it does not receive any packets, but it starts eating
memory Show quoted text
> with every new milter request :). > > Proposed change in Sendmail/PMilter.pm: > > - die "thread creation failed: $!\n" > - unless (threads->create($child_sub, $socket)); > > + my $t = threads->create($child_sub, $socket) || die > "thread creation failed: $!\n"; > + $t->detach; # important > > Call to detach() is important as it frees thread memory as soon as the > thread exits.
(This is a copy/paste form letter) Hello bug submitter to Sendmail::PMilter. As you may or may not be aware Sendmail::Pmilter is effectively orphaned. You've opened an issue against it which the current maintainer (me) doesn't have the time/want to solve. See http://search.cpan.org/~avar/Sendmail-PMilter- 0.98/lib/Sendmail/PMilter.pm#Maintenance for more details. But worry not, you can help solve it yourself if you're interested by patching the module in Git and asking for co-maint permission to upload a new version of the module. Even though your fix may seem trivial to you keep in mind that I'd still need to apply / *TEST* / release it. The testing step would require installing Sendmail and I have no interest in doing so ever again. The reason I'm the maintainer in the first place is that I spotted & patched a problem that needed to be solved and then got maintainer permission because the module was orphaned at the time. It's now orphaned again so if you need fixes to it you're going to have top step up and overtake it.
Hi, I'd like to take ownership of this and all other Sendmail::PMilter tickets. I have a current version with most of the fixes applied, updating the docs, thinking about version numbering etc and checking for compatibility with old versions at the moment with a view to releasing a fixed version later this year. OK with you?
Patched in version 1.21, not yet released and NOT TESTED.