
js5 at sanger
Aug 17, 2009, 11:30 PM
Post #5 of 6
(1026 views)
Permalink
|
|
Re: Debugging seg faults in Apache mod_perl
[In reply to]
|
|
Phillipe, Thnx, that seems to have solved the problem - I'd been slurping in the page template file with a $/.. it also explains why switching from using perl-script to modperl as the handler type also resolved the issue... James On Tue, 18 Aug 2009, Philippe M. Chiasson wrote: > On 17/08/09 21:48 , Philippe M. Chiasson wrote: >> On 17/08/09 19:54 , James Smith wrote: >>> >>> Futher to this I now have a stack trace if that helps anyone point me in >>> the right direction: >>> >>> #0 0x00007f17ee936fb1 in strncpy () from /lib/libc.so.6 >>> #1 0x00007f17e808ecfc in modperl_perl_global_request_save () from >>> /usr/lib/apache2/modules/mod_perl.so >> >> That's hapenning in a fairly simple piece of code: >> >> modperl_perl_global_svpv_save(pTHX_ modperl_perl_global_svpv_t *svpv) >> { >> svpv->cur = SvCUR(*svpv->sv); >> strncpy(svpv->pv, SvPVX(*svpv->sv), sizeof(svpv->pv)); >> } >> >> [...] >> >> But looking at the guts, the only code path that will invoke this is >> when saving/restoring the value of $/... Can you check to see what part >> of your code alters that variable and to what ? > > Just had an idea, can't verify or test it right now, but I suspect this > might be caused by: > > $/ = undef; > > Could you have one of these lying around in your code somewhere ? > > If so, can you try and change it to the usually recommended form: > > local $/ = undef; > > Hope this helps. > > -- > Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 > http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/ > > -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
|