Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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)
Replies are listed 'Best First'.
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 ?
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.

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 rifling through the Monastery: (11)
As of 2015-07-30 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls