tomazos has asked for the wisdom of the Perl Monks concerning the following question:

I've been playing around with mod_perl on the server today. Modules I have played with include Apache::Registry, Apache::Status and Apache::DBI.

After I was finished weird things started showing up in apache's error log. Two different errors show up every minute or so.

The first kind is like this:

[Thu Apr 18 09:48:39 2002] null: Attempt to free unreferenced scalar.

The second kind is like this. (The pid is always different.)

[Thu Apr 18 09:48:40 2002] [notice] child pid 22240 exit signal Segmentation fault (11)

It is still going even though I have disabled everything.

Any ideas?

Replies are listed 'Best First'.
Re: mod_perl weirdness
by samtregar (Abbot) on Apr 18, 2002 at 17:12 UTC
    I used to see the first one ("Attempt to free unreferenced scalar.") all the time with mod_perl, but recent versions seem to have fixed this. What version of Apache, mod_perl and Perl are you using? Did you compile mod_perl staticly like a good boy or are you using a DSO?

    The second one is impossible to diagnose without a stack trace. If you're motivated, build a debugging version of Perl and run your tests under gdb with the -X flag to Apache to keep it in a single process. When the seg fault occurs you'll be able to use 'bt' to get a trace on where it's happening. Then you can debug from there.

    -sam

      Here is the info on the version of everything:

      Embedded Perl version v5.6.1 for Apache/1.3.19 Ben-SSL/1.42 (Unix) PHP/4.0.6 mod_perl/1.26 FrontPage/4.0.4.3 process 23166,

      And the Perl Configuration:

      Summary of my perl5 (revision 5.0 version 6 subversion 1) configuratio +n: Platform: osname=linux, osvers=2.4.2, archname=i386-linux uname='linux grommet 2.4.2 #1 smp sun feb 25 16:33:33 pst 2001 i68 +6 unknown ' config_args='-de -Dprefix=/usr -Darchname=i386-linux -Dprivlib=/us +r/lib/perl5 -Darchlib=/usr/lib/perl5/i386-linux -Dsitelib=/usr/lib/pe +rl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl/i386-linux' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LA +RGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.3 20010315 (release)', gccosandvers +='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 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 -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.2.so, so=so, useshrplib=false, libperl=libperl. +a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynami +c' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
        What about mod_perl - is it compiled staticly or loaded as a DSO? If it's a DSO I suggest you try recompiling staticly. Also, you might try upgrading Apache - 1.3.24 is current I believe.

        -sam