You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by jb...@team-linux.com on 2000/07/07 19:58:43 UTC

Help debugging Embperl crash

I'm using Embperl 1.3b3 and mod_perl 1.24. I'm trying to use Class::DBI in my
templates and when I hit a certain line in the page the child segfaults. This
definitely seems to be some kind of problem between Embperl and Class::DBI. I'm
able to run the same code from a plain old perl script and it works just fine.

Here's the template code:

<HTML>
<HEAD><TITLE>New Entry</TITLE></HEAD>
<BODY BGCOLOR=WHITE>
<H2>New Timesheet Entry</H2>

[!
 use TLC::Timesheets::Project;
 TLC::Timesheets::Project->set_db('Main', 'dbi:mysql:phppm', 'root', '',
{AutoCommit => 1});
 TLC::Timesheets::Project->table('projects');
 TLC::Timesheets::Project->columns('All', qw(proj_id proj_cust proj_name
proj_owner proj_desc proj_quote proj_active proj_done proj_billed proj_version
proj_startdate proj_targetdate proj_url proj_num proj_principal proj_state
proj_rate));
 TLC::Timesheets::Project->columns('Primary', 'proj_id');

 require "functions.pl";
!]

[- @projects = TLC::Timesheets::Project->search_like('proj_num', '%') -]

The last line is where things are dying. 

Here's the relevant line from the apache error log:

[Fri Jul  7 12:50:21 2000] [notice] child pid 32268 exit signal Segmentation
fault (11)

And here's the relevant info from the embperl.log:

[32269]MEM:  Alloc 64 Bytes at 08155a88   Allocated so far 64 Bytes
[32269]MEM: Load
/opt/apache/dw3.teamlinux.net/443/htdocs/timesheets/entry.phtml in
HTML::Embperl::DOC::_1
[32269]MEM:  Free 64 Bytes at 08155a84  Allocated so far 0 Bytes
[32269]REQ:  Embperl 1.3b3 starting... Fri Jul  7 12:58:37 2000

[32269]REQ:  No Safe Eval  All Opcode allowed   mode = mod_perl (3)
[32269]REQ:  Package = HTML::Embperl::DOC::_1
[32269]Formdata... length = 0
[32269]Using APACHE for output...
[32269]Reading /opt/apache/dw3.teamlinux.net/443/htdocs/timesheets/entry.phtml
as input using PerlIO ...
[32269]SVs:  Entry-SVs: 13125 -OBJs: 13 Curr-SVs: 13221 -OBJs: 16
[32269]MEM:  Alloc 17 Bytes at 08155ad0   Allocated so far 17 Bytes
[32269]MEM:  Alloc 22 Bytes at 08155ae8   Allocated so far 39 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155b08   Allocated so far 56 Bytes
[32269]MEM:  Alloc 21 Bytes at 08155b20   Allocated so far 77 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155b40   Allocated so far 94 Bytes
[32269]MEM:  Alloc 31 Bytes at 08155b58   Allocated so far 125 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155b80   Allocated so far 142 Bytes
[32269]MEM:  Alloc 23 Bytes at 08155b98   Allocated so far 165 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155bb8   Allocated so far 182 Bytes
[32269]MEM:  Alloc 23 Bytes at 08155bd0   Allocated so far 205 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155bf0   Allocated so far 222 Bytes
[32269]MEM:  Alloc 36 Bytes at 08155c08   Allocated so far 258 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155c30   Allocated so far 275 Bytes
[32269]MEM:  Alloc 38 Bytes at 08155c48   Allocated so far 313 Bytes
[32269]MEM:  Alloc 17 Bytes at 08155c78   Allocated so far 330 Bytes
[32269]MEM:  Alloc 22 Bytes at 08155c90   Allocated so far 352 Bytes
[32269]SVs:  17754
[32269]EVAL< 
 use TLC::Timesheets::Project;
 TLC::Timesheets::Project->set_db('Main', 'dbi:mysql:phppm', 'root', '',
{AutoCommit => 1});
 TLC::Timesheets::Project->table('projects');
 TLC::Timesheets::Project->columns('All', qw(proj_id proj_cust proj_name
proj_owner proj_desc proj_quote proj_active proj_done proj_billed proj_version
proj_startdate proj_targetdate proj_url proj_num proj_principal proj_state
proj_rate));
 TLC::Timesheets::Project->columns('Primary', 'proj_id');

 require "functions.pl";

[32269]SVs:  18176
[32269]EVAL> 1
[32269]SVs:  Entry-SVs: 13125 -OBJs: 13 Curr-SVs: 18174 -OBJs: 16
[32269]SVs:  18198
[32269]EVAL<  @projects = TLC::Timesheets::Project->search_like('proj_num',
'%') 


I've got EMBPERL_DEBUG set to 775.

Are there debug options i can set that will give me more info?

Thanks.

-- 
Jason Bodnar + jbodnar@team-linux.com + Team Linux

And anyone can be tooted?

                -- Homer Simpson, on tutoring
                   The Way We Was


RE: Help debugging Embperl crash

Posted by Gerald Richter <ri...@ecos.de>.
>
> Okay, it seems to be some kind of conflict between
> mod_perl/Embperl and PHP and
> perhaps Apache::DBI. My Embperl stuff works if there's no
> database access. It
> also works if I don't load libphp4.so. I guess the best solution
> is to either
> build everything statically or run seperate servers for PHP and mod_perl.
>

Yes, it look like a bad mixture of Perl and PHP. Also the linker seems to
get confused, because the the symbols from stackframe 37+ are out of the
Apache core  and not from DBI.so. I would try to link mod_perl and PHP
staticly into Apache and if this doesn't help, use separate Apaches.

Gerald


RE: Help debugging Embperl crash

Posted by jb...@team-linux.com.
Okay, it seems to be some kind of conflict between mod_perl/Embperl and PHP and
perhaps Apache::DBI. My Embperl stuff works if there's no database access. It
also works if I don't load libphp4.so. I guess the best solution is to either
build everything statically or run seperate servers for PHP and mod_perl.

Here's the backtrace in case the problem jumps out at you:

#0  0x4049ea08 in ?? ()
#1  0x40256af0 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#2  0x40256e30 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#3  0x40256e9f in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#4  0x4025a888 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#5  0x4031c4f5 in php_if_imagecopyresized (ht=-1073754856,
return_value=0x402df625, 
    this_ptr=0xbfffce10, return_value_used=1076752868) at gd.c:1801
#6  0x4031758d in php_if_imagegif (ht=-1073754608, return_value=0x402df1e4,
this_ptr=0xbfffcdf0, 
    return_value_used=0) at gd.c:606
#7  0x402df625 in php_message_handler_for_zend (message=-1073754640, data=0x0)
at main.c:582
#8  0x402df1e4 in php_error_cb (type=139645588, format=0x0) at main.c:408
#9  0x40209131 in Perl_av_delete () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#10 0x4031c4f5 in php_if_imagecopyresized (ht=-1073754064,
return_value=0x402df625, 
    this_ptr=0xbfffd128, return_value_used=1076752868) at gd.c:1801
#11 0x4031758d in php_if_imagegif (ht=-1073753816, return_value=0x402df1e4,
this_ptr=0xbfffd108, 
    return_value_used=0) at gd.c:606
#12 0x402df625 in php_message_handler_for_zend (message=-1073753848, data=0x0)
at main.c:582
#13 0x402df1e4 in php_error_cb (type=137866052, format=0x0) at main.c:408
#14 0x40209131 in Perl_av_delete () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#15 0x4031c4f5 in php_if_imagecopyresized (ht=-1073753272,
return_value=0x402df625, 
    this_ptr=0xbfffd440, return_value_used=1076753390) at gd.c:1801
#16 0x4031758d in php_if_imagegif (ht=-1073753024, return_value=0x402df3ee,
this_ptr=0xbfffd420, 
    return_value_used=0) at gd.c:606
#17 0x402df625 in php_message_handler_for_zend (message=-1073753056, data=0x0)
at main.c:582
#18 0x402df3ee in php_set_timeout (seconds=139592856) at main.c:486
#19 0x40249060 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#20 0x4024956f in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#21 0x402497c7 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#22 0x40249817 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#23 0x40240b93 in S_regmatch () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#24 0x402439a0 in S_reginclass () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#25 0x40249ddd in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#26 0x402436a6 in S_regrepeat () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#27 0x40243d97 in S_reghop () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#28 0x4023d5ee in S_regcppush () from
/opt/apache/dw3.teamlinux.net/443/libexec/libperl.so
#29 0x4031c4f5 in php_if_imagecopyresized (ht=-1073743976,
return_value=0x402df625, 
    this_ptr=0xbffff890, return_value_used=1076753390) at gd.c:1801
#30 0x4031758d in php_if_imagegif (ht=-1073743728, return_value=0x402df3ee,
this_ptr=0xbffff870, 
    return_value_used=0) at gd.c:606
#31 0x402df625 in php_message_handler_for_zend (message=-1073743760, data=0x0)
at main.c:582
#32 0x402df3ee in php_set_timeout (seconds=137219524) at main.c:486
#33 0x402c37f2 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libphp4.so
#34 0x402c30e6 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libphp4.so
#35 0x402c1af4 in ?? () from
/opt/apache/dw3.teamlinux.net/443/libexec/libphp4.so
#36 0x80d4033 in ap_invoke_handler ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#37 0x80e79e9 in process_request_internal ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#38 0x80e7a4c in ap_process_request ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#39 0x80df23e in child_main ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#40 0x80df3ec in make_child ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#41 0x80df549 in startup_children ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#42 0x80dfb76 in standalone_main ()
   from /opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#43 0x80e0303 in main () from
/opt/depot/perl-5.6.0/lib/site_perl/5.6.0/i686-linux/auto/DBI/DBI.so
#44 0x4007e9cb in __libc_start_main (main=0x80dffbc <main>, argc=5,
argv=0xbffffac4, 
    init=0x805c624 <_init>, fini=0x811621c <_fini>, rtld_fini=0x4000ae60
<_dl_fini>, 
    stack_end=0xbffffabc) at ../sysdeps/generic/libc-start.c:92



-- 
Jason Bodnar + jbodnar@team-linux.com + Team Linux

It's wonderful, it's magical.  Oh boy, here it comes.  Another mouth.

                -- Homer Simpson
                   And Maggie Makes Three


RE: Help debugging Embperl crash

Posted by Gerald Richter <ri...@ecos.de>.
> I'm not sure if I understand the FAQ
> (http://perl.apache.org/embperl/Faq.pod.1.html#make_test_fails_wit
> h_a_SIGxxxx_).
>
> If this is in a page how do I set the args for perl?
>
> Or am I looking at the wrong FAQ entry?
>

No it's right, but it is not exactly fit to your problem, do

#gdb /path/to/httpd
>set args -X -f /path/to/httpd.conf    (use -X to have only a single
process; maybe more commmand line options for apache here)
>r

now you have a running apache and can do your request, you should get a
message about SIGSEGV, then you type

>BT

and send the result

Gerald





RE: Help debugging Embperl crash

Posted by jb...@team-linux.com.
I'm not sure if I understand the FAQ
(http://perl.apache.org/embperl/Faq.pod.1.html#make_test_fails_with_a_SIGxxxx_).

If this is in a page how do I set the args for perl?

Or am I looking at the wrong FAQ entry?

On 07-Jul-2000 Gerald Richter wrote:
>>
>> I'm using Embperl 1.3b3 and mod_perl 1.24. I'm trying to use
>> Class::DBI in my
>> templates and when I hit a certain line in the page the child
>> segfaults. This
>> definitely seems to be some kind of problem between Embperl and
>> Class::DBI. I'm
>> able to run the same code from a plain old perl script and it
>> works just fine.
>>
> 
> It would be very helpfull, if you could make a stackbacktrace of the seg
> fault. See in the Faq how to do it.
> 
> 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 925151
> WWW:        http://www.ecos.de      Fax:      +49 6133 925152
> -------------------------------------------------------------

-- 
Jason Bodnar + jbodnar@team-linux.com + Team Linux

Smithers:
        Next.  There's a problem with the reactor -- what do you do?

Homer:  There's a problem with the reactor??  We're all going to die!!

                   I Married Marge


RE: Help debugging Embperl crash

Posted by Gerald Richter <ri...@ecos.de>.
>
> I'm using Embperl 1.3b3 and mod_perl 1.24. I'm trying to use
> Class::DBI in my
> templates and when I hit a certain line in the page the child
> segfaults. This
> definitely seems to be some kind of problem between Embperl and
> Class::DBI. I'm
> able to run the same code from a plain old perl script and it
> works just fine.
>

It would be very helpfull, if you could make a stackbacktrace of the seg
fault. See in the Faq how to do it.

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 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------