You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Matt Sergeant <ma...@sergeant.org> on 2001/02/16 17:40:15 UTC

Config directive segfaults

This seems to fix it:

--- ExtUtils.pm.old	Fri Feb 16 16:38:05 2001
+++ ExtUtils.pm	Fri Feb 16 16:38:30 2001
@@ -283,7 +283,7 @@
     add_module(&XS_${modname});
     stash_mod_pointer("$class", &XS_${modname});
     register_cleanup(perl_get_startup_pool(), (void *)1,
-                     remove_module_cleanup, null_cleanup);
+                     null_cleanup, remove_module_cleanup);

 void
 END()

I'm not sure its the right fix, but my server doesn't segfault any more
:-)

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Config directive segfaults

Posted by Matt Sergeant <ma...@sergeant.org>.
On Fri, 16 Feb 2001, Matt Sergeant wrote:

> This seems to fix it:
>
> --- ExtUtils.pm.old	Fri Feb 16 16:38:05 2001
> +++ ExtUtils.pm	Fri Feb 16 16:38:30 2001
> @@ -283,7 +283,7 @@
>      add_module(&XS_${modname});
>      stash_mod_pointer("$class", &XS_${modname});
>      register_cleanup(perl_get_startup_pool(), (void *)1,
> -                     remove_module_cleanup, null_cleanup);
> +                     null_cleanup, remove_module_cleanup);
>
>  void
>  END()
>
> I'm not sure its the right fix, but my server doesn't segfault any more
> :-)

Would the following be a result of the above being the wrong fix?

Unbalanced scopes: 38 more ENTERs than LEAVEs
Unbalanced saves: 430 more saves than restores
Unbalanced tmps: 311 more allocs than frees
Unbalanced context: 28 more PUSHes than POPs

???

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Config directive segfaults

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 19 Feb 2001, G.W. Haywood wrote:

> Hi Matt,
>
> On Mon, 19 Feb 2001, Matt Sergeant wrote:
>
> > Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
> [snip]
> >   Compiler:
> >     cc='cc', optimize='-O3 ...
>
> Now didn't I tell you that nothing more than -O2 was safe?

That was the case a couple of years ago, but things have changed a lot
with gcc since then. This is an RPM install of Perl from Mandrake 7.0, and
I've never had a segfault that was compiler related on this box.

Of course having said that, watch it go and make a liar out of me :-)

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Config directive segfaults

Posted by "G.W. Haywood" <ge...@www.jubileegroup.co.uk>.
Hi Matt,

On Mon, 19 Feb 2001, Matt Sergeant wrote:

> Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
[snip]
>   Compiler:
>     cc='cc', optimize='-O3 ...

Now didn't I tell you that nothing more than -O2 was safe?

73,
Ged.


Re: Config directive segfaults

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sun, 18 Feb 2001, Doug MacEachern wrote:

> On Sun, 18 Feb 2001, Matt Sergeant wrote:
>  
> > If you can't find it, we'll get together at ApacheCon so you can debug it
> > direct on my box.
> 
> you don't really want to wait until then do you? :)

Well I'm not bothered for me because commenting out remove_module fixes it
for me, but I assume there's some reason you need to do more than that. I
wish I understood it - but the only docs I have for writing config
directives is the Eagle book :-)

> i'd like to fix it asap, just need to be able to reproduce it.

We could arrange for you to have root here, if you can't find a way to
repro it. I guess I can trust you not to rm -fR / :-)

> > If it helps, here's my compile recipe:
> > 
> >  $ perl Makefile.PL \
> >  > EVERYTHING=1 \
> >  > USE_APACI=1 \
> >  > DYNAMIC=1 \
> >  > APACHE_PREFIX=/opt/apache \
> >  > APACHE_SRC=../apache_1.3.12/src \
> >  > DO_HTTPD=1 \
> >  > APACI_ARGS="--enable-module=so --enable-shared=info  --enable-shared=proxy --enable-shared=rewrite --enable-shared=log_agent"
> >  $ make
> >  $ su
> >  $ make install
> 
> did you have this working before with something < 1.25 ?

Yeah it was no trouble with mod_perl 1.24_01.

> directive handlers + LoadModule core dumped with < 1.25 for me.
> if you don't use -shared modules + LoadModule do the core dumps go away?

I don't have any LoadModules on that server.

> can you mail me your perl -V too?

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.15-4mdk, archname=i386-linux
    uname='linux updates.mandrakesoft.com 2.2.15-4mdk #1 wed may 10
15:31:30 cest 2000 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O3 -fomit-frame-pointer -fno-exceptions -fno-rtti
-pipe -s -mpentium -mcpu=pentium -march=pentium -ffast-math
-fexpensive-optimizations', gccversion=2.95.2 19991024 (release)
    cppflags='-Dbool=char -DHAS_BOOL'
    ccflags ='-Dbool=char -DHAS_BOOL'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Aug  7 2000 12:43:52
  @INC:
    /usr/lib/perl5/5.00503/i386-linux
    /usr/lib/perl5/5.00503
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005
    .


-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\



Re: Config directive segfaults

Posted by Doug MacEachern <do...@covalent.net>.
On Sun, 18 Feb 2001, Matt Sergeant wrote:
 
> If you can't find it, we'll get together at ApacheCon so you can debug it
> direct on my box.

you don't really want to wait until then do you? :)
i'd like to fix it asap, just need to be able to reproduce it.
 
> If it helps, here's my compile recipe:
> 
>  $ perl Makefile.PL \
>  > EVERYTHING=1 \
>  > USE_APACI=1 \
>  > DYNAMIC=1 \
>  > APACHE_PREFIX=/opt/apache \
>  > APACHE_SRC=../apache_1.3.12/src \
>  > DO_HTTPD=1 \
>  > APACI_ARGS="--enable-module=so --enable-shared=info  --enable-shared=proxy --enable-shared=rewrite --enable-shared=log_agent"
>  $ make
>  $ su
>  $ make install

did you have this working before with something < 1.25 ?
directive handlers + LoadModule core dumped with < 1.25 for me.
if you don't use -shared modules + LoadModule do the core dumps go away?
can you mail me your perl -V too?


Re: Config directive segfaults

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sun, 18 Feb 2001, Doug MacEachern wrote:

> On Fri, 16 Feb 2001, Matt Sergeant wrote:
> 
> > This seems to fix it:
> ... 
> > I'm not sure its the right fix, but my server doesn't segfault any more
> 
> its not the right fix, as it looks like you've already discovered :)
> you should be able to get by for the moment with 1.24_01's
> Apache::ExtUtils.  unless you have LoadModule's configured, which is
> what the 1.25 change was try to fix.  i tried like hell on friday to
> reproduce the problem with 1.25's, but everything works fine for me.  i
> don't doubt the bug is there, i'll try again on another machine in the
> office tommorrow.  if you're up for it, could you see if the patch below
> (against 1.25) helps at all?

Damn I wish I could say yes :-( - I still get the segfaults. The only
thing that stops them is commenting out remove_module line.

If you can't find it, we'll get together at ApacheCon so you can debug it
direct on my box.

If it helps, here's my compile recipe:

 $ perl Makefile.PL \
 > EVERYTHING=1 \
 > USE_APACI=1 \
 > DYNAMIC=1 \
 > APACHE_PREFIX=/opt/apache \
 > APACHE_SRC=../apache_1.3.12/src \
 > DO_HTTPD=1 \
 > APACI_ARGS="--enable-module=so --enable-shared=info  --enable-shared=proxy --enable-shared=rewrite --enable-shared=log_agent"
 $ make
 $ su
 $ make install


-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\



Re: Config directive segfaults

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 16 Feb 2001, Matt Sergeant wrote:

> This seems to fix it:
... 
> I'm not sure its the right fix, but my server doesn't segfault any more

its not the right fix, as it looks like you've already discovered :)
you should be able to get by for the moment with 1.24_01's
Apache::ExtUtils.  unless you have LoadModule's configured, which is
what the 1.25 change was try to fix.  i tried like hell on friday to
reproduce the problem with 1.25's, but everything works fine for me.  i
don't doubt the bug is there, i'll try again on another machine in the
office tommorrow.  if you're up for it, could you see if the patch below
(against 1.25) helps at all?

Index: lib/Apache/ExtUtils.pm
===================================================================
RCS file: /home/cvs/modperl/lib/Apache/ExtUtils.pm,v
retrieving revision 1.22
diff -u -r1.22 ExtUtils.pm
--- lib/Apache/ExtUtils.pm	2000/12/30 05:08:57	1.22
+++ lib/Apache/ExtUtils.pm	2001/02/16 23:30:53
@@ -263,6 +263,9 @@
         /* need to remove the module so module index is reset */
         remove_module(&XS_${modname});
     }
+    else {
+        return;
+    }
     if (data) {
         /* make sure BOOT section is re-run on restarts */
         (void)hv_delete(GvHV(incgv), this_module,
@@ -285,11 +288,6 @@
     register_cleanup(perl_get_startup_pool(), (void *)1,
                      remove_module_cleanup, null_cleanup);
 
-void
-END()
-
-    CODE:
-    remove_module_cleanup(NULL);
 EOF
 }