Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Debugging child pid 4577 exit signal Segmentation fault (11)

by Anonymous Monk
on Oct 01, 2012 at 07:19 UTC ( #996593=note: print w/ replies, xml ) Need Help??


in reply to Debugging child pid 4577 exit signal Segmentation fault (11)

Hi, finally found the culprit. I cannot use the string concatenation on the header function, I think it has to do with the prototype thingy. This is the line that cause error.

return $cgi->header({-charset => "utf-8"}).$tmpl->output;

the header has to be assigned to a variable first then concatenate. I still wonder why ?

Thanks all.


Comment on Re: Debugging child pid 4577 exit signal Segmentation fault (11)
Re^2: Debugging child pid 4577 exit signal Segmentation fault (11)
by keenlearner (Acolyte) on Oct 01, 2012 at 07:27 UTC
    Ops...sorry, this is still causing the problem. After I refresh more time, still got segmentation fault. But definitely is this $cgi->header, cause if don't use this object but use print "Content-type: text/html\n\n", it's no longer causing the segfault.
Re^2: Debugging child pid 4577 exit signal Segmentation fault (11)
by keenlearner (Acolyte) on Oct 01, 2012 at 07:47 UTC
    The final work around is putting the $cgi in the self.
    sub new { my ($class) = @_; my $self = {cgi => CGI->new}; bless $self, $class; return $self; }
      I still wonder why, I have been using the our $cgi = CGI->new for many modules, but only this particular module is having this issue. Any input will be great ?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996593]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-08-29 01:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls