On Monday 23 February 2004 09:47 am, Stas Bekman wrote:
> Beau E. Cox wrote:
>
> Nice work, Beau! You may want to put your patches somewhere online and post
> the URL here/modperl list so if someone with 5.8.2 can't migrate to 5.8.3
> they can use your patch.

OK, I'll put the patches online, but as I mentioned earlier on this list,
the DBI patch presents a whole new interface to DBDs; anyone wishing
to use it will have to update any DBDs they use also. (I have patched
only DBD-mysql and DBD-Pg.) As Tim mentioned, the 'real' implementation
of PERL_NO_GET_CONTEXT will have to wait for Tim's v2 DBI.

As for perl 5.8.2 - it still does'nt work: I patched DBI/DBD and EVERY
XS I use in my Apache2/mp2 server, and the "Attempt to free
unreferenced scalar..." messages still appear. For example, in DBI
running under 5.8.2, the error is triggered at:

 ...
 my $a;
 foreach $a (qw(RaiseError PrintError AutoCommit)) { # do these first
 next unless  exists $attr->{$a};
>$dbh->{$a} = delete $attr->{$a};
 }
 ...

in 'connect'. If I change this to (prob. introducing leaks):

 ...
 my $a;
 foreach $a (qw(RaiseError PrintError AutoCommit)) { # do these first
 next unless  exists $attr->{$a};
>$dbh->{$a} = $attr->{$a};
>delete $attr->{$a};
 }
 ...

DBI works fine. But other PERL_NO_GET_CONTEXT XSs still fail, i.e.
Apache::Cookie (perl glue in libapreq2):

 sub new {
     my ($class, $env, %attrs) = @_;
     my $name  = delete $attrs{name};
     my $value = delete $attrs{value};
>    $name     = delete $attrs{-name}  unless defined $name;
     $value    = delete $attrs{-value} unless defined $value;
     return unless defined $name and defined $value;

Other XSs fail in a similar way too.

Using DBI->Trace, the errors start appearing just after DBI does
a DBI 'clone'; I really don't understand this fully, but it seems
it happens just after Apache2 switches threads after a Max...(?)

I would be happy to share with you my DBI->Trace logs and
anything else you deem useful, but, to me, it seems perl
5.8.2 "just don't work', and those poor souls stuck in 5.8.2
are out of luck.

5.8.1 and 5.8.3 work fine.

>
> > So my plan is to keep current with DBI svn and keep applying
> > my patch and testing it to be sure it works. I will also
> > keep DBD-mysql and DBD-Pg in-sync.
>
> You don't need to re-apply the patch. Just apply it once and then just run
> 'svn update' and resolve any conflicts if they happen. svn will do the
> merge for you. That will save you a lot of time.
>
Yep - that one I actually figured out myself!

Aloha => Beau;

Reply via email to