Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > odd crash in file upload via CGI

Reply
Thread Tools

odd crash in file upload via CGI

 
 
msoulier
Guest
Posts: n/a
 
      07-31-2006
Hey people,

This one is baffling me. I'm moving from a RedHat 7.3 platform to
CentOS 4.3, which includes a move from Perl 5.6.1 to 5.8.5.

I have an upload dialog making use of a CGI with the CGI module that
works fine on the old platform, but all I get on the new platform is an
internal server error, due to no content being sent back to apache.

It would seem that the interpreter is sending nothing, and I'm having a
hell of a time finding out why. Running it on the command line with the
same environment does not produce similar results (thus, the
environment is obviously not similar enough). And yet, it seems like
the interpreter might just be crashing out for some reason.

Suggestions appreciated as to how to troubleshoot this going forward.

Mike

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      07-31-2006
"msoulier" <(E-Mail Removed)> wrote:
> Hey people,
>
> This one is baffling me. I'm moving from a RedHat 7.3 platform to
> CentOS 4.3, which includes a move from Perl 5.6.1 to 5.8.5.
>
> I have an upload dialog making use of a CGI with the CGI module that
> works fine on the old platform, but all I get on the new platform is an
> internal server error, due to no content being sent back to apache.


Does a simple "hello world" CGI work? Does your log file contain anything
useful?

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      07-31-2006

Quoth "msoulier" <(E-Mail Removed)>:
> Hey people,
>
> This one is baffling me. I'm moving from a RedHat 7.3 platform to
> CentOS 4.3, which includes a move from Perl 5.6.1 to 5.8.5.
>
> I have an upload dialog making use of a CGI with the CGI module that
> works fine on the old platform, but all I get on the new platform is an
> internal server error, due to no content being sent back to apache.
>
> It would seem that the interpreter is sending nothing, and I'm having a
> hell of a time finding out why. Running it on the command line with the
> same environment does not produce similar results (thus, the
> environment is obviously not similar enough). And yet, it seems like
> the interpreter might just be crashing out for some reason.
>
> Suggestions appreciated as to how to troubleshoot this going forward.


Run it as whatever user it gets run as when it's called as a CGI.
CGI::Carp

Ben

--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
msoulier
Guest
Posts: n/a
 
      07-31-2006
(E-Mail Removed) wrote:
> Does a simple "hello world" CGI work? Does your log file contain anything
> useful?


CGIs work in general, yes. This CGI works fine in fact, except for this
one feature.

[Mon Jul 31 11:51:46 2006] [error] [client 127.0.0.1] Premature end of
script headers: tug, referer:
https://10.33.15.145/server-manager/...7a1a8b94edbef3

Basically says that the CGI returned prematurely, as it returning
nothing.

Mike

 
Reply With Quote
 
msoulier
Guest
Posts: n/a
 
      07-31-2006

Ben Morrow wrote:
> Quoth "msoulier" <(E-Mail Removed)>:
> > Hey people,
> >
> > This one is baffling me. I'm moving from a RedHat 7.3 platform to
> > CentOS 4.3, which includes a move from Perl 5.6.1 to 5.8.5.
> >
> > I have an upload dialog making use of a CGI with the CGI module that
> > works fine on the old platform, but all I get on the new platform is an
> > internal server error, due to no content being sent back to apache.
> >
> > It would seem that the interpreter is sending nothing, and I'm having a
> > hell of a time finding out why. Running it on the command line with the
> > same environment does not produce similar results (thus, the
> > environment is obviously not similar enough). And yet, it seems like
> > the interpreter might just be crashing out for some reason.
> >
> > Suggestions appreciated as to how to troubleshoot this going forward.

>
> Run it as whatever user it gets run as when it's called as a CGI.
> CGI::Carp


Yeah, tried CGI::Carp already, and ran it as the right user. However, I
just removed and eval call and this error popped up. For some reason
the eval masked the problem. Perhaps it crashed the interpreter, not
sure.

Can't coerce GLOB to string in entersub at
/usr/lib/perl5/site_perl/5.8.0/Persistence/Object/Simple.pm line 125.

So this is apparently my issue. I didn't see it because evaling the
code and checking $@ for some reason did not turn the issue up. Very,
very odd.

Mike

 
Reply With Quote
 
Charles DeRykus
Guest
Posts: n/a
 
      07-31-2006
msoulier wrote:
> Ben Morrow wrote:
>> Quoth "msoulier" <(E-Mail Removed)>:
>>> Hey people,
>>>
>>> This one is baffling me. I'm moving from a RedHat 7.3 platform to
>>> CentOS 4.3, which includes a move from Perl 5.6.1 to 5.8.5.

^^^^^
>
> Yeah, tried CGI::Carp already, and ran it as the right user. However, I
> just removed and eval call and this error popped up. For some reason
> the eval masked the problem. Perhaps it crashed the interpreter, not
> sure.
>
> Can't coerce GLOB to string in entersub at
> /usr/lib/perl5/site_perl/5.8.0/Persistence/Object/Simple.pm line 125.

^^^^^

Is the version discrepancy between 5.8.5 and 5.8.0 expected... Could
your environment be picking up older installs...

--
Charles DeRykus
 
Reply With Quote
 
msoulier
Guest
Posts: n/a
 
      08-01-2006
Charles DeRykus wrote:
> Is the version discrepancy between 5.8.5 and 5.8.0 expected... Could
> your environment be picking up older installs...


I don't believe so, but I suppose I should ask the CentOS people, and
the owner of the Dag repository. I believe that's where the code is
coming from.

Mike

 
Reply With Quote
 
msoulier
Guest
Posts: n/a
 
      08-01-2006
msoulier wrote:
> Can't coerce GLOB to string in entersub at
> /usr/lib/perl5/site_perl/5.8.0/Persistence/Object/Simple.pm line 125.


And believe it or not, this little bit of code prevents it from
happening.

foreach my $param ($cgi->param)
{
my $val = $cgi->param($param);
my $string = "$val";
}

Seems completely unrelated, but if I don't stringify the incoming
parameters once, then it crashes.

Any perl gurus with black magick to explain this one for me?

Cheers,
Mike

 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      08-01-2006
msoulier wrote:
> msoulier wrote:
> > Can't coerce GLOB to string in entersub at
> > /usr/lib/perl5/site_perl/5.8.0/Persistence/Object/Simple.pm line 125.

^^^^^
> Any perl gurus with black magick to explain this one for me?


5.8.0 is notoriously buggy. You use known-buggy software, you
encounter bugs. Upgrade.

Paul Lalli

 
Reply With Quote
 
msoulier
Guest
Posts: n/a
 
      08-02-2006
Paul Lalli wrote:
> 5.8.0 is notoriously buggy. You use known-buggy software, you
> encounter bugs. Upgrade.


If you'll check the thread, you'll find that I'm running 5.8.5.

Mike

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to upload Files via http/cgi Richard Konrad Python 2 12-19-2006 09:09 AM
How to guarantee file upload won't crash server? Steve ASP .Net 1 06-02-2006 11:53 AM
CGI file upload - problems with file size... DJ Stunks Perl Misc 1 01-23-2006 05:35 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
Odd File Upload Experience =?Utf-8?B?Q2hyaXMgRmluaw==?= ASP .Net 1 07-22-2004 06:38 PM



Advertisments