You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Sean T Allen <se...@usaherbals.com> on 2004/08/18 21:15:31 UTC

Post truncation problem

<>Apache/2.0.40 (Red Hat Linux)
Perl/v5.8.0 built for i386-linux-thread-multi
mod_perl/1.99_07-dev

just to get that out of the way.

problem i have is that we are running a stripped down version of CGI.pm

that on a post does:

    my $input         =  undef;
    my $method        =  $ENV{ 'REQUEST_METHOD' };
    my $content_type  =  $ENV{ 'CONTENT_TYPE' };


    if ( $method eq 'POST' )
    {
        no strict;

        #
        # Do sysread in an eval because it doesn't work on all platforms
        #

        eval ( "sysread( \STDIN, \$input, $ENV{ 'CONTENT_LENGTH' } )" );

        #
        # Do a read if sysread failed
        #       $@ gets set to undef if eval succeeds or an error string 
if it fails
        #

        if ( $@ )
        {
            read( STDIN, $input, $ENV{ 'CONTENT_LENGTH' } );
        }


We've encountered a problem where occassionally,
we arent reading the full content-length....

sometimes 2 characters... somtimes 7...
variable low numbers
very intermittent... less than .1% requests...

have seen if run enough under a single server situation as well.

so question is...

is there a bug in our particular setup? i did find references to a post 
error with mod-perl but it was always truncating at the same length..
or is there a mod-perl gotcha that i'm just an aware of?

if this isnt the right place for this quesiton... please let me know...

thanks in advance for the help...




-- 
Sean T. Allen <se...@usaherbals.com>

Re: Post truncation problem

Posted by Kurt Hansen <kh...@charityweb.net>.
Stas Bekman wrote:
> Kurt Hansen wrote:
> 
>> I just figured since he has a threaded perl already that he might want 
>> to avoid the thread problems noted on the prereq page, i.e. "Perl 
>> 5.8.0's threads.pm doesn't work with mod_perl 2.0." May as well avoid 
>> problems that might pop up down the road if you are aware of them.
> 
> 
> Agreed, Kurt. But on the other hand we don't want to drive people away 
> by posing unnecesary requirements when all they want is to get their job 
> done :) and in this case geting the latest mp2 should do the trick just 
> fine ;)

Good point, Stas!

And thanks for all your work and words!

Take care,

Kurt



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Post truncation problem

Posted by Stas Bekman <st...@stason.org>.
Kurt Hansen wrote:
> Stas Bekman wrote:
> 
>>> Sean T Allen wrote:
>>>
>>>> <>Apache/2.0.40 (Red Hat Linux)
>>>> Perl/v5.8.0 built for i386-linux-thread-multi
>>>> mod_perl/1.99_07-dev
> 
> 
>>> I believe your problem is there, both in the Perl version and in the 
>>> mod_perl2 version. You'll want to update Perl to at least 5.8.1 and 
>>> mod_perl2 to the most recent, 1.99_14.
>>
>>
>>
>> There is nothing wrong with perl 5.8.0, unless you want to run a 
>> threaded mpm
>> http://perl.apache.org/docs/2.0/user/install/install.html#Prerequisites

in fact there is nothing wrong with 5.8.0 and threaded mpms :) it's only 
an issue if you want to spawn perl ithreads from your modperl app.

> I just figured since he has a threaded perl already that he might want 
> to avoid the thread problems noted on the prereq page, i.e. "Perl 
> 5.8.0's threads.pm doesn't work with mod_perl 2.0." May as well avoid 
> problems that might pop up down the road if you are aware of them.

Agreed, Kurt. But on the other hand we don't want to drive people away by 
posing unnecesary requirements when all they want is to get their job done 
:) and in this case geting the latest mp2 should do the trick just fine ;)


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Post truncation problem

Posted by Kurt Hansen <kh...@charityweb.net>.
Stas Bekman wrote:

>> Sean T Allen wrote:
>>
>>> <>Apache/2.0.40 (Red Hat Linux)
>>> Perl/v5.8.0 built for i386-linux-thread-multi
>>> mod_perl/1.99_07-dev

>> I believe your problem is there, both in the Perl version and in the 
>> mod_perl2 version. You'll want to update Perl to at least 5.8.1 and 
>> mod_perl2 to the most recent, 1.99_14.
> 
> 
> There is nothing wrong with perl 5.8.0, unless you want to run a 
> threaded mpm
> http://perl.apache.org/docs/2.0/user/install/install.html#Prerequisites

I just figured since he has a threaded perl already that he might want 
to avoid the thread problems noted on the prereq page, i.e. "Perl 
5.8.0's threads.pm doesn't work with mod_perl 2.0." May as well avoid 
problems that might pop up down the road if you are aware of them.

Take care,

Kurt


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Post truncation problem

Posted by Stas Bekman <st...@stason.org>.
Kurt Hansen wrote:
> Hi,
> 
> Just started working on Apache2/MP2 myself..
> 
> I think you lead off your message very well by listing your setup:
> 
> Sean T Allen wrote:
> 
>> <>Apache/2.0.40 (Red Hat Linux)
>> Perl/v5.8.0 built for i386-linux-thread-multi
>> mod_perl/1.99_07-dev
> 
> 
> I believe your problem is there, both in the Perl version and in the 
> mod_perl2 version. You'll want to update Perl to at least 5.8.1 and 
> mod_perl2 to the most recent, 1.99_14.

There is nothing wrong with perl 5.8.0, unless you want to run a threaded mpm
http://perl.apache.org/docs/2.0/user/install/install.html#Prerequisites



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Post truncation problem

Posted by Kurt Hansen <kh...@charityweb.net>.
Hi,

Just started working on Apache2/MP2 myself..

I think you lead off your message very well by listing your setup:

Sean T Allen wrote:
> <>Apache/2.0.40 (Red Hat Linux)
> Perl/v5.8.0 built for i386-linux-thread-multi
> mod_perl/1.99_07-dev

I believe your problem is there, both in the Perl version and in the 
mod_perl2 version. You'll want to update Perl to at least 5.8.1 and 
mod_perl2 to the most recent, 1.99_14.

See MP2 page for further details:

http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Installation

Take care,

Kurt Hansen
khansen@charityweb.net


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Post truncation problem

Posted by Stas Bekman <st...@stason.org>.
Sean T Allen wrote:
> <>Apache/2.0.40 (Red Hat Linux)
> Perl/v5.8.0 built for i386-linux-thread-multi
> mod_perl/1.99_07-dev

Sean, upgrade to 1.99_14 first and try again.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html