Rafael Caceres | 4 Sep 2007 22:37
Picon

Re: seg faults when running modperl and GD::Graph

If you have PHP (with mod_php) enabled on that server, that's the
culprit and it can be fixed by compiling PHP without GD support.

On Tue, 2007-09-04 at 13:12 -0700, Matt Williamson wrote:
> I noticed that my server is segfaulting when I run a script using
> GD::Graph
> 
> e.g.
> 
> [Fri Aug 31 09:26:14 2007] [notice] child pid 6385 exit signal
> Segmentation fault (11)
> [Fri Aug 31 09:26:18 2007] [notice] child pid 6386 exit signal
> Segmentation fault (11)
> [Fri Aug 31 09:26:23 2007] [notice] child pid 6387 exit signal
> Segmentation fault (11)
> [Fri Aug 31 09:30:06 2007] [notice] child pid 6394 exit signal
> Segmentation fault (11)
> [Fri Aug 31 09:30:52 2007] [notice] child pid 6462 exit signal
> Segmentation fault (11)
> [Fri Aug 31 09:31:01 2007] [notice] child pid 6448 exit signal
> Segmentation fault (11)
> [Fri Aug 31 09:31:06 2007] [notice] child pid 6463 exit signal
> Segmentation fault (11)
> 
> I am running an ex-cgi script under ModPerl::Registry
> 
> <Location /perl>
>      SetHandler perl-script
>      PerlResponseHandler ModPerl::Registry
>      Options +ExecCGI
(Continue reading)

Matt Williamson | 5 Sep 2007 06:47

RE: seg faults when running modperl and GD::Graph

I don't think it can be php.

I disabled php on the server, and I still get the seg faults

[Tue Sep 04 21:45:19 2007] [notice] Apache/2.0.55 (Ubuntu)
mod_perl/2.0.2 Perl/v5.8.7 configured -- resuming normal operations

[Tue Sep 04 21:45:29 2007] [notice] child pid 18466 exit signal
Segmentation fault (11)
[Tue Sep 04 21:45:30 2007] [notice] child pid 18467 exit signal
Segmentation fault (11)
[Tue Sep 04 21:45:32 2007] [notice] child pid 18468 exit signal
Segmentation fault (11)

Any other ideas?

Matt

> -----Original Message-----
> From: Rafael Caceres [mailto:rcaceres <at> aasa.com.pe]
> Sent: Tuesday, September 04, 2007 1:38 PM
> To: Matt Williamson
> Cc: modperl <at> perl.apache.org
> Subject: Re: seg faults when running modperl and GD::Graph
> 
> If you have PHP (with mod_php) enabled on that server, that's the
> culprit and it can be fixed by compiling PHP without GD support.
> 
> On Tue, 2007-09-04 at 13:12 -0700, Matt Williamson wrote:
> > I noticed that my server is segfaulting when I run a script using
(Continue reading)

Manoj Bist | 5 Sep 2007 07:13
Picon

Re: seg faults when running modperl and GD::Graph

One option would to be run apache under single threaded mode(option
-X) under gdb  and see where it is crashing.  Once you identify the
.so where it is crashing, you can try reproducing the crash outside
apache context.

If you suspect it to be a memory corruption issue you can try running
apache under valgrind.

On 9/4/07, Matt Williamson <matt <at> sanasecurity.com> wrote:
> I don't think it can be php.
>
> I disabled php on the server, and I still get the seg faults
>
> [Tue Sep 04 21:45:19 2007] [notice] Apache/2.0.55 (Ubuntu)
> mod_perl/2.0.2 Perl/v5.8.7 configured -- resuming normal operations
>
>
> [Tue Sep 04 21:45:29 2007] [notice] child pid 18466 exit signal
> Segmentation fault (11)
> [Tue Sep 04 21:45:30 2007] [notice] child pid 18467 exit signal
> Segmentation fault (11)
> [Tue Sep 04 21:45:32 2007] [notice] child pid 18468 exit signal
> Segmentation fault (11)
>
> Any other ideas?
>
> Matt
>
>
>
(Continue reading)

William A. Rowe, Jr. | 5 Sep 2007 08:59

Re: seg faults when running modperl and GD::Graph

Manoj Bist wrote:
> One option would to be run apache under single threaded mode(option
> -X) under gdb  and see where it is crashing.  Once you identify the
> .so where it is crashing, you can try reproducing the crash outside
> apache context.

See also http://httpd.apache.org/dev/debugging.html

Matt Williamson | 5 Sep 2007 22:58

RE: seg faults when running modperl and GD::Graph

So I got apache to run under gdb, but I still am somewhat non-the-wiser.
It appears to happen the second time that the handler is used to process
the request, so I guess one workaround would be to call my script as a
plain cgi. 

I'm not really how to interpret the gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1214974272 (LWP 20348)]
0xb76a9628 in XS_Apache2__RequestRec_send_cgi_header () from
/usr/lib/perl5/auto/Apache2/Response/Response.so
(gdb) bt
#0  0xb76a9628 in XS_Apache2__RequestRec_send_cgi_header () from
/usr/lib/perl5/auto/Apache2/Response/Response.so
#1  0xb787a3b9 in Perl_pp_entersub () from /usr/lib/libperl.so.5.8
#2  0xb7872917 in Perl_runops_standard () from /usr/lib/libperl.so.5.8
#3  0xb7811ef0 in Perl_get_cv () from /usr/lib/libperl.so.5.8
#4  0xb7815cf1 in Perl_call_sv () from /usr/lib/libperl.so.5.8
#5  0xb7931b7f in modperl_callback () from
/usr/lib/apache2/modules/mod_perl.so
#6  0xb7932451 in modperl_callback_run_handlers () from
/usr/lib/apache2/modules/mod_perl.so
#7  0xb79326ff in modperl_callback_per_dir () from
/usr/lib/apache2/modules/mod_perl.so
#8  0xb792cf61 in modperl_response_finish () from
/usr/lib/apache2/modules/mod_perl.so
#9  0xb792d1e2 in modperl_response_handler_cgi () from
/usr/lib/apache2/modules/mod_perl.so
#10 0x08077e38 in ap_run_handler ()
#11 0x080781bc in ap_invoke_handler ()
(Continue reading)

William A. Rowe, Jr. | 6 Sep 2007 00:02

Re: seg faults when running modperl and GD::Graph

Matt Williamson wrote:
> So I got apache to run under gdb, but I still am somewhat non-the-wiser.
> It appears to happen the second time that the handler is used to process
> the request, so I guess one workaround would be to call my script as a
> plain cgi. 

FYI compiling with -g will often give more more intelligible results
from gdb.  This should include the way you build both perl and httpd,
and therefore mod_perl.

Matt Williamson | 4 Sep 2007 23:06

RE: seg faults when running modperl and GD::Graph

Ok, thanks.

I am not so familiar with php. I have 

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

And
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>

So I guess I have mod_php5.

Do I have to recompile, or do you think I might find a php without GD as
a pre-compiled ubuntu package?

I actually don't think I need php on this system, would removing it have
the same effect?

Matt

> -----Original Message-----
> From: Rafael Caceres [mailto:rcaceres <at> aasa.com.pe]
> Sent: Tuesday, September 04, 2007 1:38 PM
> To: Matt Williamson
> Cc: modperl <at> perl.apache.org
> Subject: Re: seg faults when running modperl and GD::Graph
> 
> If you have PHP (with mod_php) enabled on that server, that's the
(Continue reading)

Rafael Caceres | 5 Sep 2007 17:07
Picon

RE: seg faults when running modperl and GD::Graph

Matt,
I had the problem with PHP4, but you can do a quick test commenting the
LoadModule php5_module line on your httpd.conf file and testing before
going full course. If that prevents the crash, then my guess is you'll
have to build PHP5 yourself.

Rafael
On Tue, 2007-09-04 at 14:06 -0700, Matt Williamson wrote:
> Ok, thanks.
> 
> I am not so familiar with php. I have 
> 
> LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
> 
> And
> <IfModule mod_php5.c>
>   AddType application/x-httpd-php .php .phtml .php3
>   AddType application/x-httpd-php-source .phps
> </IfModule>
> 
> So I guess I have mod_php5.
> 
> Do I have to recompile, or do you think I might find a php without GD as
> a pre-compiled ubuntu package?
> 
> I actually don't think I need php on this system, would removing it have
> the same effect?
> 
> Matt
> 
(Continue reading)


Gmane