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

A funtional mod-perl code installed on a new apple server spits out these odd critical errors after a couple of successful runs:

[Tue Feb 16 03:31:08 2010] [error] [client XX.XXX.XXXX.XX] panic: memory wrap at /Library/Perl/Updates/5.10.0/AutoLoader.pm line 90.
I've tracked it down to the cpan module Storable causing the error. Its the current version of Storable and it is supposed to be solid. Same apache setup, and same setup as other working servers. (stable versions and worker MPM)

Restarting apache wont help restore the memory. But rebooting the server is more effective. Apache comes up normal and it progress for some time before it get stuck again.
After turning it around, my only conclusion is that perl itself is hitting the roof. but its very light data and Storable just compress and simply store it to a file which makes no sense to me.

Seen it before? ideas how to proceed?
tx for your time.
---------------------- Summary of my perl5 (revision 5 version 10 subversion 0) configuration +: Platform: osname=darwin, osvers=10.0, archname=darwin-thread-multi-2level uname='darwin b66.apple.com 10.0 darwin kernel version 10.0.0d8: t +ue may 5 19:29:59 pdt 2009; root:xnu-1437.2~2release_i386 i386 ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= +-Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc +=gcc-4.2' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=und +ef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc-4.2', ccflags ='-arch x86_64 -arch i386 -arch ppc -g -pipe + -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include' +, optimize='-Os', cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing +-I/usr/local/include' ccversion='', gccversion='4.2.1 (Apple Inc. build 5646)', gccosand +vers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc-4.2 -mmacosx-version-min=10.6', ldflags ='-arch x86_64 -ar +ch i386 -arch ppc -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libpe +rl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-arch x86_64 -arch i386 -arch ppc -bund +le -undefined dynamic_lookup -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_ +BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Locally applied patches: /Library/Perl/Updates/<version> comes before system perl directori +es installprivlib and installarchlib points to the Updates directory Built under darwin Compiled at Jul 9 2009 15:07:54 @INC: /Library/Perl/Updates/5.10.0/darwin-thread-multi-2level /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0

Replies are listed 'Best First'.
Re: [error] panic: memory wrap
by arpx (Acolyte) on Mar 01, 2010 at 16:20 UTC
    Ok, after fighting with this for 2 weeks i finally found a workaround.
    Seems like the AutoLoader in this setup is the source of the problem.
    Using selfloader instead avoids the problem.
    Hence you will need to remove the following 2 lines from Storable.pm:
    #use AutoLoader; #*AUTOLOAD = \&AutoLoader::AUTOLOAD;
    and insert:
    use SelfLoader;
      ignore previous..

      the problem lies in the way osx ties up other resources.
      a simple sleep will give the os time to close and open.
      restart or graceful will go in conflict.

      apachectl stop
      sleep 2
      apachectl start

        Wow - same workaround solved it for me. You must have just saved me days of troubleshooting. Thankyou!!