Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Solved bug with memory leak in DBI perl modules used by Pand

  • Solved bug with memory leak in DBI perl modules used by Pand

    Posted by raul on July 11, 2006 at 14:53

    Pandora Server use DBI perl modules, that have a memory leak. This was identified as a known bug in several OS (Ubuntu, Debian, Suse Pro).

    Slerena has posted the solution in the sourceforge bugs tracker (https://sourceforge.net/tracker/index.php?func=detail&aid=1501805&group_id=155200&atid=794852):

    We have a elusive leak in DBI instrastructure that only happens in some kind
    of DBI modules. In SUSE Enterprise and RedHat Enterprise works fine, but we
    have problems in Ubuntu, Debian, Suse Pro, etc… This problem is now
    FIXED 🙂

    You need to patch and rebuild your DBI.xs from DBI sources. This problem was
    solved Jun 16th by Doru Theodor Petrescu.
    http://www.nntp.perl.org/group/perl.dbi.dev/4583

    Instructions:

    patch_dbi.patch

    diff -uBbr orig/DBI-1.51/DBI.xs DBI-1.51/DBI.xs
    — orig/DBI-1.51/DBI.xs 2006-06-06 12:49:13.000000000 +0300
    +++ DBI-1.51/DBI.xs 2006-06-12 16:26:52.000000000 +0300
    @@ -1069,6 +1069,8 @@
    SV *sv = av_shift(av);
    if (SvOK(sv))
    av_push(av, sv);
    + else
    + sv_free(sv); /* keep it leak-free by Doru Petrescu
    pdoru.dbi[at]from.ro */
    }
    }
    }

    Apply the patch:

    patch DBI.xs /tmp/patch_dbi.patch

    Build your DBI install

    root@abril:~/.cpan/build/DBI-1.51# perl Makefile.PL
    make
    make install

    Tested with debian and ubuntu and works fine !!, no more leaks !

    Sancho replied 18 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Sancho

    Administrator
    July 11, 2006 at 19:22
    2229 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    I’ll post the bugfix to debian package maintainer and posted in Ubuntu bug tracking system. The author or Perl DBI package is aware of the situation, so I imagine that solution for this problem will be fixed in the next major releases of all Linux Distros.