Closed Bug 71962 Opened 24 years ago Closed 24 years ago

file uploads don't finish

Categories

(Core :: Networking: HTTP, defect)

x86
Linux
defect
Not set
blocker

Tracking

()

VERIFIED FIXED
mozilla0.8.1

People

(Reporter: blizzard, Assigned: darin.moz)

References

Details

(Whiteboard: critical for mozilla 0.8.1 - can't reproduce)

Attachments

(50 files)

108.52 KB, image/jpeg
Details
19.00 KB, image/jpeg
Details
11.52 KB, image/jpeg
Details
35.68 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
40.91 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
40.17 KB, image/jpeg
Details
40.91 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
100 bytes, application/octet-stream
Details
1000 bytes, application/octet-stream
Details
9.77 KB, application/octet-stream
Details
35.92 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
60 bytes, image/gif
Details
310 bytes, image/jpeg
Details
40.17 KB, image/jpeg
Details
38.43 KB, image/jpeg
Details
38.43 KB, image/jpeg
Details
40.17 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
14.91 KB, text/plain
Details
35.92 KB, image/jpeg
Details
18.46 KB, text/plain
Details
38.66 KB, image/jpeg
Details
38.66 KB, image/jpeg
Details
38.66 KB, image/jpeg
Details
38.66 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
38.45 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
35.92 KB, image/jpeg
Details
5.41 KB, patch
Details | Diff | Splinter Review
40.17 KB, image/jpeg
Details
5.44 KB, patch
Details | Diff | Splinter Review
40.17 KB, image/jpeg
Details
40.17 KB, image/jpeg
Details
40.17 KB, image/jpeg
Details
40.17 KB, image/jpeg
Details
40.17 KB, image/jpeg
Details
5.55 KB, patch
Details | Diff | Splinter Review
40.17 KB, image/jpeg
Details
6.00 KB, patch
Details | Diff | Splinter Review
6.22 KB, patch
Details | Diff | Splinter Review
40.17 KB, image/jpeg
Details
When posting a screenshot to bugzilla my file upload never finished and the resulting image in bugzilla is damaged. Have a look in bug 71958 to see the uploaded images. When you upload the file the spinner keeps going until you get a complaint that "the operation timed out." My build is from a pull at about 6 AM pacific time on March 14th.
Whiteboard: critical for mozilla 0.8.1
cc: pollman, who fixed yesterday's file submission blocker (bug 71834). Perhaps this is form submission
marking as a blocker
Severity: normal → blocker
Target Milestone: --- → mozilla0.8.1
Investigating...
Status: NEW → ASSIGNED
Attached image test image (111k)
The image I just posted (attachment 27726 [details]) seemed to go through without any problems. Perhaps the image size matters. I'm going to try posting a smaller image...
Attached image test upload (19k)
Attached image test upload (12k)
Attached image test upload (37k)
I've successfully uploaded 4 different images with a variety of sizes, and none of them got corrupted. Sounds like this could be heavily dependant on your network configuration... perhaps the timeout was a fluke?? But, then it seems you were able to duplicate the problem, so I think I'm a little bit stuck. Can someone help me generate a test case for this? Thanks!
Keywords: qawanted
blizzard: what is your network configuration btw? are you connecting through a proxy?
I'm not using a proxy and I have a reasonably fast connection to the net. 2.2 DSL.
Attached image test image 41k
Ok.. let me see what happens when I upload a 41k file.
Attached image test upload (41k)
OK.. I'm still not seeing the problem. Blizzard: can you try uploading your 41k file using a version of the browser (or some other browser) that doesn't exhibit this problem. I'd like to be able to send the exact same number of bytes. Thanks!
Blizzard: what version of Linux are you running? My tests are on a pretty box-stock redhat 6.2 machine (dual processor machine). Perhaps this has something to do with it. On that note, is anyone seeing this on other platforms?
Attached image test 41k
I uploaded the same file with my build and Netscape 4.7. My build fails but the Netscape 4.7 works fine. I'm using RH 7.<mumble> here. Let me respin to see if maybe I missed a file or something.
Attached image test (new build)
Attached file test binary file
Strange. I can upload that 10,000 byte type without problems. Maybe it's related to the content of the file itself.
Attached image 1x1 test gif
Attached image test 1x1 jpg
OK, those work fine. Darin, can you try downloading the good image that I uploaded with Netscape 4.7 and uploading it yourself?
blizzard: your 41k image uploaded perfectly from my 0.8.1 build on my rh7 machine!! What the f*&#!!
ok, to move this off the 0.8.1 list??? looks like things working ok now???
Whiteboard: critical for mozilla 0.8.1 → critical for mozilla 0.8.1 - can't reproduce
Darin, you're right next to bugzilla. Try uploading to the silophone or something.
I'm not sure what to do about this. It works for me but it doesn't seem to work for Blizzard. And, we are apparently testing identical builds... the only variable seems to be in our OS's. Can we get some more QA testing this?
OK, but my test upload of your 41k file was from home over an ISDN line... not from mountain view! All the same, I will try uploading to a remote system. Perhaps the combination of a faster connection to a remote host will demonstrate the problem?!?
I'm going to be out of town for the next two days, so if this is REALLY important for moz 0.8.1, then someone else needs to own it.
I think that this is REALLY important for release. Lets see how long this might take to fix before we commit to holding the release though.
Seeing also with Mozilla PC Linux 2001031611 and Redhat Linux 7
I ran into this bug yesterday with Win NT sp6a nightly build 2001031604. While attempting to upload a screenshot to Mozdev's bugzilla at http://mozdev.org/bugs/show_bug.cgi?id=219 Network Configuration is Win NT connected to a e-smith 4.1 gateway (based on RH 7.0) with a ADSL line that tests at 380 K upload time. Three attempts to upload with Mozilla timed out and resulted in damaged images, Netscape 4.76 uploaded the file with no problem.
I tested it with ISDN upload so it don't seem to be related to speed?
Blizzard: could you (or anyone else who's seeing this bug) please attach a socket transport log (NSPR_LOG_MODULES=nsSocketTransport:5)... thanks!!
Attached image test upload
Attached file socket trace
Attached image test upload again
Blizzard: the logs look very interesting... especially the socket TIMED OUT error during the AsyncRead (though not sure if this could explain the corruption)... still looking.
From the logs it appears that only 37624 bytes were actually written. However, I don't see anything in the logs that would explain this.
Is the log enough to show that (however impossible it might seem) some very constrained bad thing is happening? Or could a million bad things be going wrong, and more tracing info is needed? /be
Brendan: not sure exactly what could be wrong... necko is not complaining about anything, but that hardly means that it's off the hook. Blizzard: can you check the size of your /tmp/formpost-XX file corresponding to the corrupted upload? thanks!
Attached image test
Attached image test
Blizzard: can you check the /tmp/formpost-xx file? what is it's size? thankx!
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test
Comments: When you are doing the translation in nsHTTPEncodeStream::Read() to the passed in buffer what's to prevent you from overwriting the end of the buffer? You are adding characters. rv = writer(this, closure, mBuf + mBufCursor, offset, amt, &amt); if (rv == NS_BASE_STREAM_WOULD_BLOCK) return NS_OK; // mask this error You aren't updating the amt from the return of that which will probably cause some badness down the road. Now to do some testing...
Attached image test
Blizzard: 1) ReadNext() ensures that the buffer will not be overrun. 2) amt is reset/computed at the top of the loop, but offset should be updated as well. Attaching new patch.
This patch didn't fix the problem. In fact it seems to have caused another more serious problem. Now the file uploads and it's apparently successful but the http thread gets stuck in: 1026[81399a0]: nsSocketTransport: PR_Write(count=1007) returned 1007 and has the CPU pegged. Hitting cancel will make the browser hang, probably trying to cancel the request.
Attached image test
Attached image test
Attached image test
Attached image test
Attached image test (should work)
Attached image test
I was IRC'ing with darin as the last patch developed, focused on crucial stuff. Nit comments only below, take 'em or leave 'em -- sr=brendan@mozilla.org either way, we need the crucial fixes for 0.8.1: + char *mBuf; // ReadSegments buffer + PRUint32 mBufCursor; // index into mBuf of unread data + PRUint32 mBufSize; // amount of unread data in buffer mBufSize is a misleading name next to mBuf (it's not the size in bytes of the allocation at mBuf). How about mBufUnread or mBufLength (vaguer, mBufUnread says it all)? From ReadNext: if (NS_FAILED(rv)) return rv; + *result += amt; if (rv == NS_BASE_STREAM_WOULD_BLOCK || amt == 0) return rv; Isn't NS_BASE_STREAM_WOULD_BLOCK a failure code? Maybe the first clause of that || is useless and you just want if (amt == 0) return rv; ? If so, save a useless += 0 and put the *result += amt; after that if-then. + NS_ENSURE_ARG_POINTER(buf); + NS_ENSURE_ARG_POINTER(countRead); These are just cycle-wasting worry-beads, no? Read is called only within this module or by other code in Necko, and Necko is a sufficiently closed system that you need assertions (at most), not runtime checks, that no one was insane enough to pass null for a in string or out int param. Or it had better be, else I will look for CVS vouchers to chastise! + if (rv == NS_BASE_STREAM_WOULD_BLOCK) + return NS_OK; // mask this error + else if (NS_FAILED(rv)) + return rv; + else if (amt == 0) + return NS_OK; else after return twice here, non-sequitur alert! But this confirms that rv == NS_BASE_STREAM_WOULD_BLOCK needs to be checked before NS_FAILED(rv). More nits in that other bug darin's filing about gratuitous string copying in ReadNext -- darin, what's that bug #? Thanks. /be
a=asa for checkin to the branch (on behalf of drivers). Do we still need an r= ?
r=blizzard, sr=brendan (as i understand it)
Great!
brendan: i've opened bug 72738 to track removing the extra buffer copies from nsHTTPEncodeStream::ReadNext().
*** Bug 72680 has been marked as a duplicate of this bug. ***
Ok, I've checked in the fix on both the trunk and the 0.8.1 branch.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Attached image test upload
verified: Linux rh6 2001050108
Status: RESOLVED → VERIFIED
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: