Bug #2113
closedWFileUpload race?
0%
Description
Dear witty team,
attached is an example program that sometimes (often) fails to upload
all file using WFileUpload. I am using a self-compiled wt-3.3.0 on a
linux host (currently Ubuntu 12.10, but reproduced on Fedora). I guess
this is a bug, but maybe I am using WFileUpload the wrong way?
How to reproduce:
- compile
export ROOTWEBTOOLKIT=/path/to/local/wtinstallation
export WTCONFIGDIR=/path/to/local/wtconfig/etc/wt
mkdir build
cd build
cmake -DCMAKE_MODULE_PATH=${ROOTWEBTOOLKIT}/cmake -DCMAKE_INCLUDE_PATH:PATH="${ROOTWEBTOOLKIT}/include" \
-DCMAKE_LIBRARY_PATH:PATH="${ROOTWEBTOOLKIT}/lib" ../
make - create some dummy data
dd if=/dev/zero of=file1 bs=1 count=501047
dd if=/dev/zero of=file2 bs=1 count=4070
dd if=/dev/zero of=file3 bs=1 count=264 - adjust file size limit in ${WTCONFIGDIR}/wt_config.xml
64000 - start and upload the three files
./triggerWFileUploadBug.wt ---docroot . ---http-address 127.0.0.1 ---http-port 9876
sometimes the upload fails, the log will say something like
[error] "WebController: could not parse request: CgiParser: reached end of input while seeking end of headers or content. Format of CGI input is wrong"
Best
Nils
Files
Updated by Wim Dumon over 11 years ago
- Status changed from New to Feedback
From a quick read of your code, it seems that you reuse the WFileUpload widgets, which is not allowed (WFileUpload documentation states: The WFileUpload widget must be hidden or deleted when a file is received.). Does the problem also occur when you delete and reinstantiate the widget? Can you modify TriggerWFileUploadBugWidget::reset() to do this instead of just re-enabling the loadButton?
BR,
Wim.
Updated by Nils Christian over 11 years ago
Hi Wim,
sorry, I overlooked the sentence about hiding or deleting the WFileUpload. But the bug persists with the fix, see attachment.
Best
Nils
Updated by Jesse Pepper over 11 years ago
Hi Wim,
I'm having the same problem. I'm definitely recreating new WFileUpload widgets. It is an intermittent problem, and on my Core 2 duo laptop, it appears to happen much more in release builds than debug... I think. I'll confirm soon. The symptom is the upload just gets some way through and then stops at, some percentage, say 19% (it varies). My app continues to function fine and all other Wt widgets seem unaffected.
Updated by Wim Dumon over 11 years ago
I could reproduce the problem, will try to find the cause.
Wim.
Updated by Wim Dumon over 11 years ago
- Status changed from Feedback to Resolved
I think I found the problem, patch is on its way to public git.
Wim.
Updated by Koen Deforche over 11 years ago
- Status changed from Resolved to Closed
- Target version set to 3.3.1