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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to