On 28 September 2012 17:10, Andy Colson <a...@squeakycode.net> wrote: > > On 09/28/2012 08:07 AM, Stefan Profanter wrote: >> >> Hi! >> >> Posted this question already on Catalyst Mailing List, but got no answer >> yet and I think this problem is caused by mod_perl somewhere. >> >> I programmed a Catalyst Application which uses mod_perl and apache2 in >> production mode. >> >> The Catalyst App runs fine in debug mode (“Started with own script on port >> 3000”). >> >> Another Catalyst application programmed some months ago works perfect with >> nearly the same configuration and runs also parallel even on the same >> apache2 (also with same Session Plugins). >> >> The first time, I access the site everything works fine. But after login, >> only the first page opens, each second try to open another page results in a >> Segmentation Fault. Even pages which don’t require login. >> >> If I then disable or delete the Cookies, the Site works again. So my guess >> is that there is somewhere a problem with Session handling. >> >> Disabling the first application in apache doesn’t change anything. >> >> Can you help me finding out what causes the SegFault (Debug infos see >> above)? >> >> Thanks a lot!!! >> >> Stefan >> >> -------------------------------------- >> >> Here ist the backtrace from gdb and apache2 which I got so far: >> >> Core was generated by `/usr/sbin/apache2 -k start'. >> >> Program terminated with signal 11, Segmentation fault. >> >> #0 mbuf2sv (my_perl=0x2b60a36b94c0, f=<value optimized out>, sv=<value >> optimized out>, optype=<value optimized out>, >> >> network_order=-1547829216, res=<value optimized out>) at >> Storable.xs:3873 >> >> 3873 return newSVpv(mbase, MBUF_SIZE()); >> >> (gdb) bt >> >> #0 mbuf2sv (my_perl=0x2b60a36b94c0, f=<value optimized out>, sv=<value >> optimized out>, optype=<value optimized out>, >> >> network_order=-1547829216, res=<value optimized out>) at >> Storable.xs:3873 >> >> #1 do_store (my_perl=0x2b60a36b94c0, f=<value optimized out>, sv=<value >> optimized out>, optype=<value optimized out>, >> >> network_order=-1547829216, res=<value optimized out>) at >> Storable.xs:3833 >> >> #2 0x00002b608bf0856b in XS_Storable_mstore (my_perl=0x2b60a36b94c0, >> cv=<value optimized out>) at Storable.xs:6427 >> >> #3 0x00002b6085e54045 in Perl_pp_entersub () from >> /usr/lib/libperl.so.5.10 >> > > > Looks like you are using Storable to stream out cookies? Looks like > something in there is causing Storable to puke. I see things like > array_call, store_blessed, store_hash... So I'm guessing your passing > Storable some kind of object? Does it have any recursive parts? > > I googled "perl storable seg fault" and it looks like people have gotten > Storable to seg fault before. I'm not sure if the stack trace is reading > objects or writing them. Maybe you can glean from other's what makes > Storable segfault. > > First figure out if its reading or writing that causes the problem, then try > to figure out what part of the object is so upsetting. > >> 3873 return newSVpv(mbase, MBUF_SIZE()); > > > Hum... any chance that is really really big?
Maybe look at Sereal as an alternative to Storable. https://github.com/Sereal/Sereal/ http://search.cpan.org/~smueller/Sereal-Decoder/lib/Sereal/Decoder.pm http://search.cpan.org/~smueller/Sereal-Encoder/lib/Sereal/Encoder.pm cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"