ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-commits: [Wireshark-commits] master-2.6 6c4545c: Fix extcap initialization deadlock

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 16 Aug 2018 19:38:36 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=6c4545c3f064c37cf20eb2a807c2d5efd9664905
Submitter: "Roland Knall <rknall@xxxxxxxxx>"
Changed: branch: master-2.6
Repository: wireshark

Commits:

6c4545c by Tomasz Moń (desowin@xxxxxxxxx):

    Fix extcap initialization deadlock
    
    On Windows the code calling extcap worked as follows:
    1. Create stdout and stderr pipes with default buffer size
    2. Execute extcap redirecting output to the pipes
    3. Wait for extcap process to exit
    4. Read the data from stdout pipe
    
    This resulted in deadlock when the extcap wrote more data than the pipe
    could buffer. This was especially seen with USBPcap as it is quite
    normal to have plenty of USB devices connected.
    
    Fix the issue by contantly reading the stdout data and storing it in
    GString. To prevent similar deadlock on the stderr, the stderr data is
    being constantly monitored as well (and discarded).
    
    Change-Id: I0f93e6d79617cef0e828aef2b96fad2757227923
    Bug: 14657
    Reviewed-on: https://code.wireshark.org/review/29159
    Petri-Dish: Pascal Quantin <pascal.quantin@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Roland Knall <rknall@xxxxxxxxx>
    (cherry picked from commit c18459e66e8e71a8765bb9b8e2b3d2ba61855a3f)
    Reviewed-on: https://code.wireshark.org/review/29161
    Petri-Dish: Roland Knall <rknall@xxxxxxxxx>
    

Actions performed:

    from  0a3f5bc   Windows: upgrade USBPcap to 1.2.0.4
     add  6c4545c   Fix extcap initialization deadlock


Summary of changes:
 wsutil/ws_pipe.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 72 insertions(+), 6 deletions(-)