You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Gerald Richter <ri...@ecos.de> on 2002/08/19 08:39:11 UTC

Re: DBI makes apache fail in perl58.dll

Hi
>  with perl 5.8/ apache 2.0.40 / mod_perl 1.99_05 / DBI 1.30
> "use DBI "
> in the startup.pl (before child cloning process) script makes apache
> segfault in perl 58.dll
> this is on win32
>

I have the same behaviour here. The problem is the dup of the trace
filehandle. Perl's dup function accesses a table (PL_ptr_table) which isn't
intialized at the time dup is called when the Perl interpreters gets cloned
under mod_perl.

The following change fixes that, but now the trace filehandle is not cloned
anymore. That means you have to set the trace file in every thread and
cannot set it in the parent thread.

DBI.xs line 223

change from

    DBIS->logfp  = parent_dbis? fp_dup(parent_dbis->logfp,'>',0) :
PerlIO_stderr();

to

    DBIS->logfp  = parent_dbis && PL_ptr_table?
fp_dup(parent_dbis->logfp,'>',0) : PerlIO_stderr();

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: DBI makes apache fail in perl58.dll

Posted by Gerald Richter <ri...@ecos.de>.
> 
> thanks for preceeding answer. I have two others :
> 
> 1/ is it going to be fixed in a future release of DBI ?

I am sure Tim will fix it.

> 2/ if I don't want to trace DBI can I ignore the trace file in children
> processes created by modperl ?
> 

Yes you can ignore it

Gerald



Re: DBI makes apache fail in perl58.dll

Posted by pascal barbedor <pa...@free.fr>.
> The following change fixes that, but now the trace filehandle is not
cloned
> anymore. That means you have to set the trace file in every thread and
> cannot set it in the parent thread.
>
> DBI.xs line 223
>
> change from
>
>     DBIS->logfp  = parent_dbis? fp_dup(parent_dbis->logfp,'>',0) :
> PerlIO_stderr();
>
> to
>
>     DBIS->logfp  = parent_dbis && PL_ptr_table?
> fp_dup(parent_dbis->logfp,'>',0) : PerlIO_stderr();
>
> Gerald


Hi

thanks for preceeding answer. I have two others :

1/ is it going to be fixed in a future release of DBI ?
2/ if I don't want to trace DBI can I ignore the trace file in children
processes created by modperl ?


pascal






core dump: PL_ptr_table not set during CLONE (was: DBI makes apache fail)

Posted by Tim Bunce <Ti...@pobox.com>.
On Mon, Aug 19, 2002 at 08:39:11AM +0200, Gerald Richter wrote:
> Hi
> >  with perl 5.8/ apache 2.0.40 / mod_perl 1.99_05 / DBI 1.30
> > "use DBI "
> > in the startup.pl (before child cloning process) script makes apache
> > segfault in pel 58.dll this is on win32
> 
> I have the same behaviour here. The problem is the dup of the trace
> filehandle. Perl's dup function accesses a table (PL_ptr_table) which isn't
> intialized at the time dup is called when the Perl interpreters gets cloned
> under mod_perl.
> 
> The following change fixes that, but now the trace filehandle is not cloned
> anymore. That means you have to set the trace file in every thread and
> cannot set it in the parent thread.
> 
> DBI.xs line 223 change from
> 
>     DBIS->logfp  = parent_dbis ? fp_dup(parent_dbis->logfp,'>',0) : PerlIO_stderr();
> to
>     DBIS->logfp  = parent_dbis && PL_ptr_table ? fp_dup(parent_dbis->logfp,'>',0) : PerlIO_stderr();

I'd appreciate it if some on perl5-porters could give me the "correct"
way to dup a PerlIO during a CLONE call.

Tim.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org