Leak triggger found

Mika Raento mikie at iki.fi
Fri Oct 6 08:43:15 UTC 2006


I now find 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"); };
         last unless($@);

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.


More information about the Djabberd mailing list