Re: [Dbdpg-general] Fwd: [sf-perl] Perl module"s END block clobbered (and stuff)

Re: [Dbdpg-general] Fwd: [sf-perl] Perl module"s END block clobbered (and stuff)

am 06.08.2003 22:47:42 von Rudy Lippan

On Wed, 6 Aug 2003, Paul Makepeace wrote:
> On Mon, Aug 04, 2003 at 01:30:46PM -0400, Rudy Lippan wrote:
> > On Mon, 4 Aug 2003, David Wheeler wrote:
> >
> > > Begin forwarded message:
> > >
> > > > From: Paul Makepeace
> > > >
> > > > I'm getting this error in Apache's main error logs. I have seen no
> > > > other reference to it on Google.
> > > >
> > > > [warning] Perl module's END block clobbered perl_destruct_level
> > > > (buggy DBD::Pg?)
> > > >
> >
> > I just tried grepping the perl, mod_perl & apache sources, & I don't
> > see "clobbered" comming form any of them. Do you know where the
> > message might be comming from?
>
> [xposting to MySQL folks since this affects DBD::mysql too]
>
> Further to this and my last message at
> http://gborg.postgresql.org/pipermail/dbdpg-general/2003-Aug ust/000286.html
>

Looks like two different issues here.

1. The putenv() issue and
2. the perl_destruct_level issue.

I think the diff that you posted is if for the second bug. The date on the
bug resolution was Dec, 2002 and the next diff after that is the May 2003,
so both fixes where include in the difffile... I don't know what the
workaround for the first one was...

Looking over http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48069 It
seems that there is/was a problem libpq calling putenv(), but given, that
this is 3 years old, I am assuming that this was fixed in perl already; am
I right to assume this?


> ..it turns out this originates in both DBD::Pg and DBD::mysql's
> dbd_discon_all() where perl_destruct_level is reset. In Debian's
> DBD::Pg's libdbd-pg-perl this has been patched (removed):
> http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug= 167148
>
> Severity: important
>
> In dbdimp.c:dbd_discon_all is this code:
>
> if (perl_destruct_level) {
> perl_destruct_level =3D 0;
> }
>
> It looks like this is because it doesn't support being told to clean up.
>
> Resetting perl_destruct_level is absolutely wrong; this is the cause of
> the 3MB or more memory leaked every time you SIGHUP a mod_perl server
> using DBD::Pg. Removing this code fixes the problem but I don't know
> what affect it'll have on DBD::Pg; I didn't see any adverse effects but
> I didn't test it very well.
>
> Does anyone know why this reset is there? Can it be removed from the sources?
> It's not in DBD::Oracle certainly since 1.06 dated 2000/07.

Since dbd_discon_all() is the same between DBD::mysql & DBD::Pg, I am
going to assume that this bit of code was inhereted from an old version of
DBD::Oracle. I don't see anything in the DBD::Oracle docs about
perl_destruct_level, so I don't know (if or when) it was removed from
DBD::Oracle; however, I did see ' No longer sets perl_destruct_level
unless debug set >= 4.' in the DBI Changelog, so maybe that was in there
to work with dbi chaing destruct levels???

Given that dbd_discon_all is just about the same in DBD::Pg, DBD::mysql
DBD::Oracle, should/could it be brought into driver.xst?



Rudy.



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org