Bug 247140

Summary: mod_python 3.1 has issues with some large files
Product: Red Hat Enterprise Linux 4 Reporter: Todd Warner <taw>
Component: mod_pythonAssignee: Joe Orton <jorton>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:28:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Todd Warner 2007-07-05 16:31:44 UTC
Description of problem:
mod_python 3.1 (and not mod_python 3.2 and mayhas issues with large files. As
far as I can tell, it's only with files that don't have carriage returns since
the logic in the module does a readline instead of a sensible read. It tries to
read in more than possible in one chunk. Refer to this conversation:

http://www.modpython.org/pipermail/mod_python/2005-November/019463.html


Version-Release number of selected component (if applicable):
[twarner@twarner ~]$ rpm -q mod_python
mod_python-3.1.3-5.1

How reproducible:
Always.


Steps to Reproduce:
1. create a 1.5G or even 550M (I believe) file from /dev/urandom via dd
2. pump that file through mod_python via an upload of some sort. I am using
logic similar to this:
http://webpython.codepoint.net/mod_python_publisher_file_upload
  
Actual results:
MemoryError. Here's my traceback...

[twarner@twarner ~]$ curl -k -F
"file=@/home/twarner/file-1.5G-random.txt;type=multipart/form-data;filename=testfile"
http://MY_HOSTNAME/api/publishing/beta/file-upload/index.py

Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in
HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 134, in
handler
    req.form = util.FieldStorage(req, keep_blank_values=1)

  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 133, in __init__
    line = req.readline()

MemoryError


Expected results:
Transfer of the file without error. As you can see, I am doing it via an API
through python's mod_python.publisher


Additional info:
This issue is fixed in mod_python 3.2 apparently

Comment 1 Joe Orton 2007-07-23 12:50:19 UTC
Can you try rebuilding the source RPM from:

http://people.redhat.com/jorton/Nahant-mod_python/

to see if that fixes the issue?

Comment 2 Todd Warner 2007-07-23 16:36:24 UTC
This did not fix the issue. Take a look at line 133 in util.py on RHEL4 versus
line 157 in util.py in the version on FC6 (mod_python-3.2.8-3.1).

The version you gave me does not stop the readline from sucking in a 2G file.

-todd

Comment 3 Jiri Pallich 2012-06-20 13:28:33 UTC
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.