Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Alarm CPAN distribution.

Report information
The Basics
Id: 60566
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-Alarm

People
Owner: karman [...] cpan.org
Requestors: chris [...] masto.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: malloc() errors using Catalyst::Plugin::Alarm
Date: Fri, 20 Aug 2010 14:03:18 -0400
To: bugs-Catalyst-Plugin-Alarm [...] rt.cpan.org
From: Christopher Masto <chris [...] masto.com>
Howdy, I recently tried to use Catalyst::Plugin::Alarm to set a global timeout in my application. Nothing fancy, I just started out by adding the plugin and configuring it with: alarm => { global => 30 } Unfortunately, I end up with errors like this: perl-fcgi(770) malloc: *** error for object 0x107008b60: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug After some experimentation, it looks like Sys::SigAction is causing problems on my platform (Mac OS X, Perl 5.12.1 installed from MacPorts). As an experiment, I tried altering it to use the "if ($WIN32)" code that sets $SIG{ALRM} instead, and the problem went away. While I'm not qualified to debug the problem with Sys::SigAction, people on IRC seem to feel that it's potentially unsafe. Maybe you could add a config option to allow people with this problem to use the $SIG{ALRM} path instead? Anyway, thanks for the module. Hopefully this information will be of some use. Summary of my perl5 (revision 5 version 12 subversion 1) configuration: Platform: osname=darwin, osvers=10.4.0, archname=darwin-multi-2level uname='darwin chris-mastos-imac.local 10.4.0 darwin kernel version 10.4.0: fri apr 23 18:28:53 pdt 2010; root:xnu-1504.7.4~1release_i386 i386 ' config_args='-des -Dprefix=/opt/local -Dscriptdir=/opt/local/bin -Dcppflags=-I/opt/local/include -Dccflags=-pipe -O2 -arch x86_64 -Dldflags=-L/opt/local/lib -arch x86_64 -Dvendorprefix=/opt/local -Dusemultiplicity=y -D cc=/usr/bin/gcc-4.2 -D ld=/usr/bin/gcc-4.2 -D man1ext=1pm -D man3ext=3pm -D man1dir=/opt/local/share/man/man1p -D man3dir=/opt/local/share/man/man3p -D siteman1dir=/opt/local/share/man/man1 -D siteman3dir=/opt/local/share/man/man3 -D vendorman1dir=/opt/local/share/man/man1 -D vendorman3dir=/opt/local/share/man/man3 -D pager=/usr/bin/less -sR' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/usr/bin/gcc-4.2', ccflags ='-pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include', optimize='-O3', cppflags='-I/opt/local/include -no-cpp-precomp -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -fstack-protector -I/opt/local/include' ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.6 /usr/bin/gcc-4.2', ldflags ='-L/opt/local/lib -arch x86_64 -fstack-protector' libpth=/opt/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-L/opt/local/lib -arch x86_64 -bundle -undefined dynamic_lookup -fstack-protector' 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_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under darwin Compiled at Jul 6 2010 09:49:40 %ENV: PERL5LIB="/Users/Chris/proj/adama/extlib/lib/perl5/darwin-multi-2level:/Users/Chris/proj/adama/extlib/lib/perl5" PERL_AUTOINSTALL="--defaultdeps" PERL_MM_OPT="INSTALL_BASE=/Users/Chris/proj/adama/extlib" @INC: /Users/Chris/proj/adama/extlib/lib/perl5/darwin-multi-2level /Users/Chris/proj/adama/extlib/lib/perl5/darwin-multi-2level /Users/Chris/proj/adama/extlib/lib/perl5 /opt/local/lib/perl5/site_perl/5.12.1/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.12.1 /opt/local/lib/perl5/vendor_perl/5.12.1/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.12.1 /opt/local/lib/perl5/5.12.1/darwin-multi-2level /opt/local/lib/perl5/5.12.1 .
Thanks for the bug report. I've just uploaded version 0.05 to pause with a new config option called 'use_native_signals' that should hopefully address this issue. Please try it out and let me know if it works, and I'll close this ticket.
I'll take silence as good news.