You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "David E. Wheeler" <da...@kineticode.com> on 2008/05/29 06:54:26 UTC

Re: Bus Error with mod_perl 2.04

On Apr 24, 2008, at 00:03, Philippe M. Chiasson wrote:

> Nah, the core file by itself is not exactly super usefull. You just  
> have
> to figure out how to get a debugging build. Also, I've tried to  
> reproduce
> this on OS X/Apache 2.2.8 prefork/ Perl 5.10 without any luck.
>
> Can you post the exact details on how you built each of these ?
>
> For me, it goes something like:
>
> perl> ./Configure -des \
>  -Doptimize=-g \
>  -Dprefix=$HOME/opt/perl.org/perl/5.10.0/debug

For me:

perl-5.10.0> sh Configure -des \
  -Duseshrplib\
  -Dprefix=/usr/local/perl-5.10.0.d \
  -Doptimize='-g'

> apache> CFLAGS="-g" ./configure \
>  --with-included-apr \
>  --with-mpm=prefork \
>  --enable-maintainer-mode \
>  --enable-modules=all \
>  --neable-mods-shared=max \
>  --prefix=$HOME/opt/apache.org/httpd/2.2.8/prefork-debug

For me:

httpd-2.2.8>export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
export CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED -g"
./configure \
  --prefix=/usr/local/apache2 \
  --with-mpm=prefork \
  --enable-dav \
  --enable-dav-fs \
  --enable-log-config \
  --enable-authn-file \
  --enable-authz-host \
  --enable-authz-group \
  --enable-authz-user \
  --prefix=/usr/local/apache2.d \
  --enable-mods-shared="rewrite info worker proxy deflate mod_auth  
include ssl env mime-magic auth_digest expires dav dav_fs perl"

So I added the -g to CFLAGS. I didn't have that before. Instead I used  
--enable-maintainer-mode as documented in

   http://perl.apache.org/docs/2.0/devel/debug/c.html#Analyzing_Dumped_Core_Files

Is that out of date, perhaps?

> mod_perl> perl Makefile.PL \
>  MP_APXS=$HOME/opt/apache.org/httpd/2.2.8/prefork-debug/bin/apxs
>  MP_MAINTAINER=1 \
>  MP_DEBUG=1

For me:

mod_perl-2.0.4>/usr/local/perl-5.10.0.d/bin/perl Makefile.PL \
  MP_AP_PREFIX=/usr/local/apache2.d \
  MP_MAINTAINER=1 \
  MP_PROMPT_DEFAULT=1 \

The above URL doesn't have the MP_MAINTAINER=1 bit, but I followed  
your lead. Should it have that?

Ah, bloody hell! Now I get this:

# make
cd "src/modules/perl" && make
cc -I/usr/local/src/mod_perl-2.0.4/src/modules/perl -I/usr/local/src/ 
mod_perl-2.0.4/xs -I/usr/include/apr-1 -I/usr/include/apr-1  -I/usr/ 
local/apache2.d/include -fno-common -DPERL_DARWIN -no-cpp-precomp - 
DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/ 
local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE -DMOD_PERL -Wall - 
Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror  
-Wdeclaration-after-statement -DMP_COMPAT_1X -DMP_DEBUG -DMP_TRACE - 
DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -g  \
	-c mod_perl.c && mv mod_perl.o mod_perl.lo
In file included from /usr/local/perl-5.10.0.d/lib/5.10.0/ 
darwin-2level/CORE/perl.h:2382,
                  from modperl_perl_includes.h:65,
                  from modperl_common_includes.h:24,
                  from mod_perl.h:21,
                  from mod_perl.c:17:
/usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/handy.h:85:1:  
error: "bool" redefined
In file included from /usr/include/mach-o/dyld.h:29,
                  from /usr/include/apr-1/apr_portable.h:166,
                  from /usr/local/apache2.d/include/http_protocol.h:31,
                  from modperl_apache_includes.h:30,
                  from mod_perl.h:20,
                  from mod_perl.c:17:
/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/stdbool.h:36:1: error:  
this is the location of the previous definition
cc1: warnings being treated as errors
In file included from modperl_perl_includes.h:65,
                  from modperl_common_includes.h:24,
                  from mod_perl.h:21,
                  from mod_perl.c:17:
/usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/perl.h:3969:  
warning: function declaration isn’t a prototype
In file included from modperl_io_apache.h:22,
                  from modperl_io.h:20,
                  from mod_perl.h:83,
                  from mod_perl.c:17:
/usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/perliol.h:173:  
warning: function declaration isn’t a prototype
mod_perl.c: In function ‘modperl_response_handler’:
mod_perl.c:1019: warning: unused variable ‘rcfg’
make[1]: *** [mod_perl.lo] Error 1
make: *** [modperl_lib] Error 2

WTF? I could have sworn I built a debugging mod_perl before. Could it  
be choking on Perl 5.10 here, too?

Thanks,

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


Re: Bus Error with mod_perl 2.04

Posted by "David E. Wheeler" <da...@kineticode.com>.
On May 31, 2008, at 14:27, Philip M. Gollucci wrote:

>> David E. Wheeler wrote:
>> This merely adds -DAP_DEBUG which does not include -g, so yes,  
>> thats out of date.
>> CFLAGS="-g3 -O0 -DAP_UNSAFE_ERROR_LOG_UNESCAPED" ..... ./configure
>> should get you just about everything.
> Updated in 662085.

Cool, thanks!

David

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


Re: Bus Error with mod_perl 2.04

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Philip M. Gollucci wrote:
> David E. Wheeler wrote:
> This merely adds -DAP_DEBUG which does not include -g, so yes, thats out 
> of date.
> 
> CFLAGS="-g3 -O0 -DAP_UNSAFE_ERROR_LOG_UNESCAPED" ..... ./configure
> should get you just about everything.
Updated in 662085.

Thanks!


------------------------------------------------------------------------
Philip M. Gollucci (philip@ridecharge.com)
o:703.549.2050x206
Senior System Admin - Riderway, Inc.
http://riderway.com / http://ridecharge.com
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.


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


Re: Bus Error with mod_perl 2.04

Posted by "David E. Wheeler" <da...@kineticode.com>.
On May 29, 2008, at 12:41, Philip M. Gollucci wrote:

> | perl-5.10.0> sh Configure -des \
> |  -Duseshrplib\
> |  -Dprefix=/usr/local/perl-5.10.0.d \
> |  -Doptimize='-g'
> - -g3 -O0 -DDEBUGGING will get you just about everything...

Okay, did this:

sh Configure -des \
-Duseshrplib \
-Dprefix=/usr/local/perl-5.10.0.d \
-Doptimize='-g3 -O0 -DDEBUGGING'

> | httpd-2.2.8>export CPPFLAGS="-I/usr/local/include"
> | export LDFLAGS="-L/usr/local/lib"
> | export CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED -g"
> in bash, you don't need to use the exports like that....
>
> | So I added the -g to CFLAGS. I didn't have that before. Instead I  
> used
> | --enable-maintainer-mode as documented in
> |http://perl.apache.org/docs/2.0/devel/debug/c.html#Analyzing_Dumped_Core_Files
> This merely adds -DAP_DEBUG which does not include -g, so yes, thats  
> out of date.

Okay, did this:

export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
export CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED -g"
./configure \
--prefix=/usr/local/apache2.d \
--with-mpm=prefork \
--enable-dav \
--enable-dav-fs \
--enable-log-config \
--enable-authn-file \
--enable-authz-host \
--enable-authz-group \
--enable-authz-user \
--prefix=/usr/local/apache2.d \
--enable-maintainer-mode \
--enable-mods-shared="rewrite info worker proxy deflate mod_auth  
include ssl env mime-magic auth_digest expires dav dav_fs perl"


> | Ah, bloody hell! Now I get this:
> |
> | # make
> | -Werror
> If you just want to see it compile, edit lib/Apache2/Build.pm and  
> remove
> - -Werror stuff.
>
> in todo/bugs_build I see that I wrote
> ==gcc 4.x and higher compiles break under -Werror
> ==[pgollucci volunteers]
>
> that might be fixed because I did build it recently on FreeBSD with  
> 4.2.x.....
>
> - -Wdeclaration-after-statement -DMP_COMPAT_1X -DMP_DEBUG
> | In file included from
> | /usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/perl.h:2382,
> |                  from modperl_perl_includes.h:65,
> |                  from modperl_common_includes.h:24,
> |                  from mod_perl.h:21,
> |                  from mod_perl.c:17:
> | /usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/handy.h:85:1:
> | error: "bool" redefined
> Definitely a perl 5.10 bug in Darwin.  Take it to p5p :)
> You are not the first to post this.

Now I get this from svn head:

benedict% make
cd "src/modules/perl" && make
cc -I/Users/david/dev/perl/modperl2/src/modules/perl -I/Users/david/ 
dev/perl/modperl2/xs -I/usr/include/apr-1 -I/usr/include/apr-1  -I/usr/ 
local/apache2.d/include -fno-common -DPERL_DARWIN -no-cpp-precomp - 
DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/ 
local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE -DMOD_PERL -Wall - 
Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror  
-Wdeclaration-after-statement -DMP_COMPAT_1X -DMP_DEBUG -DMP_TRACE - 
DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -DAP_DEBUG -g3 - 
O0 -DDEBUGGING  \
	-c mod_perl.c && mv mod_perl.o mod_perl.lo
In file included from /usr/local/perl-5.10.0.d/lib/5.10.0/ 
darwin-2level/CORE/perl.h:2382,
                  from modperl_perl_includes.h:65,
                  from modperl_common_includes.h:24,
                  from mod_perl.h:21,
                  from mod_perl.c:17:
/usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/handy.h:85:1:  
error: "bool" redefined
In file included from /usr/include/mach-o/dyld.h:29,
                  from /usr/include/apr-1/apr_portable.h:166,
                  from /usr/local/apache2.d/include/http_protocol.h:31,
                  from modperl_apache_includes.h:30,
                  from mod_perl.h:20,
                  from mod_perl.c:17:
/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/stdbool.h:36:1: error:  
this is the location of the previous definition
cc1: warnings being treated as errors
In file included from modperl_perl_includes.h:65,
                  from modperl_common_includes.h:24,
                  from mod_perl.h:21,
                  from mod_perl.c:17:
/usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/perl.h:3969:  
warning: function declaration isn’t a prototype
In file included from modperl_io_apache.h:22,
                  from modperl_io.h:20,
                  from mod_perl.h:83,
                  from mod_perl.c:17:
/usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/perliol.h:173:  
warning: function declaration isn’t a prototype
mod_perl.c: In function ‘modperl_response_handler’:
mod_perl.c:1019: warning: unused variable ‘rcfg’
make[1]: *** [mod_perl.lo] Error 1
make: *** [modperl_lib] Error 2

:-(

So I commented-out this line:

$Wall .= " -Werror" if $] >= 5.006002;

And all was well.

I then ran the code to get the core dump. Just a a reminder, here is  
the httpd.conf:

LoadModule           perl_module modules/mod_perl.so
ServerName           localhost
ServerRoot           /usr/local/apache2
PidFile              logs/httpd.pid
Listen               80
User                 daemon
Group                daemon
StartServers         2
ErrorLog             logs/error_log
CustomLog            logs/access_log combined
TypesConfig          conf/mime.types
PerlModule mod_perl2
PerlPassEnv PERL5LIB
PerlModule MyConfig

And here is MyConfig.pm:

package MyConfig;
require Apache2::ServerUtil;
my $s = Apache2::ServerUtil->server;
$s->add_config([
     'NameVirtualHost *:80',
     '<VirtualHost *:80>',
     '  DocumentRoot /usr/local/apache2/htdocs',
     '</VirtualHost>',
]);
1;

I ran it like so:

sudo env PERL5LIB=/Users/david/Desktop /usr/local/apache2-debug/bin/ 
httpd -f /Users/david/Desktop/httpd.conf

This did generate a core file, but its backtrace doesn't look  
particuarly interesting:

% sudo gdb /usr/local/apache2-debug/bin/httpd /cores/core.23077GNU gdb  
6.3.50-20050815 (Apple version gdb-768) (Tue Oct  2 04:07:49 UTC 2007)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for  
shared libraries ........ done

Core was generated by `/usr/local/apache2-debug/bin/httpd'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ............ done
#0  0x0002efd2 in open_multi_logs ()
(gdb) bt
#0  0x0002efd2 in open_multi_logs ()
#1  0x0002f354 in init_config_log ()
#2  0x00002514 in ap_run_open_logs ()
#3  0x0000a115 in main ()

What more doe you need?

Best,

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


Re: Bus Error with mod_perl 2.04

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David E. Wheeler wrote:

| perl-5.10.0> sh Configure -des \
|  -Duseshrplib\
|  -Dprefix=/usr/local/perl-5.10.0.d \
|  -Doptimize='-g'
- -g3 -O0 -DDEBUGGING will get you just about everything...


| httpd-2.2.8>export CPPFLAGS="-I/usr/local/include"
| export LDFLAGS="-L/usr/local/lib"
| export CFLAGS="-DAP_UNSAFE_ERROR_LOG_UNESCAPED -g"
in bash, you don't need to use the exports like that....

| So I added the -g to CFLAGS. I didn't have that before. Instead I used
| --enable-maintainer-mode as documented in
|http://perl.apache.org/docs/2.0/devel/debug/c.html#Analyzing_Dumped_Core_Files
This merely adds -DAP_DEBUG which does not include -g, so yes, thats out of date.

CFLAGS="-g3 -O0 -DAP_UNSAFE_ERROR_LOG_UNESCAPED" ..... ./configure
should get you just about everything.

| Ah, bloody hell! Now I get this:
|
| # make
| -Werror
If you just want to see it compile, edit lib/Apache2/Build.pm and remove
- -Werror stuff.

in todo/bugs_build I see that I wrote
==gcc 4.x and higher compiles break under -Werror
==[pgollucci volunteers]

that might be fixed because I did build it recently on FreeBSD with 4.2.x.....

- -Wdeclaration-after-statement -DMP_COMPAT_1X -DMP_DEBUG
| In file included from
| /usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/perl.h:2382,
|                  from modperl_perl_includes.h:65,
|                  from modperl_common_includes.h:24,
|                  from mod_perl.h:21,
|                  from mod_perl.c:17:
| /usr/local/perl-5.10.0.d/lib/5.10.0/darwin-2level/CORE/handy.h:85:1:
| error: "bool" redefined
Definitely a perl 5.10 bug in Darwin.  Take it to p5p :)
You are not the first to post this.

| WTF? I could have sworn I built a debugging mod_perl before. Could it be
| choking on Perl 5.10 here, too?


- --
- ------------------------------------------------------------------------
Philip M. Gollucci (philip@ridecharge.com)
o:703.549.2050x206
Senior System Admin - Riderway, Inc.
http://riderway.com / http://ridecharge.com
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.8 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIPwb+dbiP+9ubjBwRAr4UAJ0YwBYllpaXTwJn1Sg56cOGfugC1gCfbXUd
hhQxlrvlZ47zCC6LEU620HU=
=CFEg
-----END PGP SIGNATURE-----

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