Project

General

Profile

Actions

Bug #2113

closed

WFileUpload race?

Added by Anonymous over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
08/16/2013
Due date:
% Done:

0%

Estimated time:

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:

  1. 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
  2. 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
  3. adjust file size limit in ${WTCONFIGDIR}/wt_config.xml
    64000
  4. 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

TriggerWFileUploadBug.cxx (4.21 KB) TriggerWFileUploadBug.cxx Anonymous, 08/16/2013 06:44 PM
CMakeLists.txt (628 Bytes) CMakeLists.txt Anonymous, 08/16/2013 06:44 PM
TriggerWFileUploadBug.cxx (4.29 KB) TriggerWFileUploadBug.cxx Nils Christian, 08/20/2013 10:12 AM
Actions #1

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.

Actions #2

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

Actions #3

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.

Actions #4

Updated by Wim Dumon over 11 years ago

I could reproduce the problem, will try to find the cause.

Wim.

Actions #5

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.

Actions #6

Updated by Koen Deforche over 11 years ago

  • Status changed from Resolved to Closed
  • Target version set to 3.3.1
Actions

Also available in: Atom PDF