Leak triggger found

Mika Raento mikie at iki.fi
Fri Oct 6 09:43:05 UTC 2006


Hi

(sorry if you get this twice-my mail client wasn't able to tell
me whether it got sent or not, and I've received nothing from the
list)

I have now found what triggered the leak. I had added a simple
retry to the MySQL authentication that looked like:

sub get_password {
	...
     my $dbh = $self->{'mysql_dbh'};
	...
     my $retries=0;
     while($retries<4) {
         eval { ($username, $password) =
$dbh->selectrow_array("$sql_username $sql_where"); };
         $retries++;
         last unless($@);
         $self->open_db;
     }
	...

Now the astute reader may easily notice that I fail to use the newly
opened database handle in the retry: instead it loops four times, fails,
and works the next time around. But after this djabberd also starts
to leak memory at around 20 MB a minute.

I tried a simple testcase that did something similar in a standalone
perl script, but that doesn't leak. So there's some interaction of
the mysql library, djabberd and/or Danga::Socket. I at least would
want to figure out what's happening before using this in production.

So I can trigger the leak and run any of note_arena/check_arena and
gladiator stuff, if somebody with slightly more knowledge of those
would have the time to help decipher the output.

Cheers,
	Mika




More information about the Djabberd mailing list