[RADIATOR] Memory leak with Perl Script to get via SNMP the client IP from Cisco AP 1100

Gerard Alcorlo Bofill galcorlo at cesca.cat
Fri Feb 25 07:23:31 CST 2011


Hello,

thanks Christian and Heikki for your advise.

I've done some short code with the timeout but every time this code is
executed Radiator restarts.

I'm trying to remove the timeout at the end of the "important things".

Do you know why when I execute this Radiator exits?


sub {

&main::log($main::LOG_DEBUG, "||| wait 5 segons |||" . time);

my $referencia={};
$referencia->{moment} = &Radius::Select::add_timeout(time + 5,
   sub {
      my ($mimateix) = @_;

      &main::log($main::LOG_DEBUG, "== do important things ==");

      &Radius::Select::remove_timeout($mimateix->{moment});
      &main::log($main::LOG_DEBUG, time. ">>> Finished <<<");
   }
, $referencia);
}


--
Gerard

Al 24/02/11 23:27, En/na Heikki Vatiainen ha escrit:
> On 02/24/2011 11:00 AM, Gerard Alcorlo Bofill wrote:
> 
>> sorry for resending the same question. But I sent this question at the
>> end of another mail with a not related subject, (Re: [RADIATOR]
>> Assigning IP's directly from the Radius server), and maybe that's de
>> reason because no one could help me.
> 
> Or maybe we got scared of threads :)
> 
>> I'm using a home made PostProcessingHook. But it's suffering a memory
>> leak. Could someone take a look at my script? I'm not an expert on perl
>> and I'm using a thread to do non active waiting...
> 
> I would try replacing the thread with add_timeout function. Then you do
> not have to use threads and can use the same timing support that rest of
> Radiator uses.
> 
> grep for add_timeout in Radius/ directory for examples. The function
> lives in Select.pm.
> 
>> What's wrong on this script?
> 
> Hard to say. If you can replace threads with add_timeout, then we could
> at least know if the leak is a side effect from using threads or not. I
> really do not know how Perl's memory management works with threads.
> 
> Thanks!
> 


More information about the radiator mailing list