Skip to content
Tcl Source Code History Of Ticket 336441ed59c9f49f
Login

History Of Ticket 336441ed59c9f49f

Artifacts Associated With Ticket 336441ed59c9f49f

  1. Ticket change [3510c5a213] (rid 137234) by oehhar on 2014-03-11 10:27:03:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      Within branch [https://core.tcl.tk/tcl/timeline?r=win-sock-async-connect-race-fix|win-sock-async-connect-race-fix], in checkin [521b7229c4], Andreas Kupries reports about socket-async stalls due to not delivered FD_CONNECT event by the operating system.
      Read the checkin comment for the issue.
      
      Issues:
      
         *   gets or puts may never return on a socket with async connection
         *   the connection notification FD_CONNECT is not observed
      
      Conclusion:
         *   FD_CONNECT is not sent by the OS
      
      Action:
         *   Use FD_WRITE as a fallback. There is already such code in the notifier proc. The proposed fix uses that to exit gets/puts.
      
      This ticket is created to discuss the issue.
      
      Reinhard Max and Harald Oehlmann are working on the 8.6.x socket code in the branch [https://core.tcl.tk/tcl/timeline?r=bug-13d3af3ad5|bug-13d3af3ad5].
      
      There, the same issue was observed. The conclusion was: 
         *   FD_CONNECT is not delivered, if the socet connect fails between the connect() call and the WSAAsyncSelect() call
         *   FD_CONNECT is ignored if delivered between the WSAAsyncSelect() call and the insertion of the socket structure in TcpThreadActionProc()
      
      Within the branch [https://core.tcl.tk/tcl/timeline?r=bug-13d3af3ad5|bug-13d3af3ad5], those issues are fixed.
      
      The workaround to use FD_WRITE instead FD_CONNECT was removed in [https://core.tcl.tk/tcl/timeline?r=bug-13d3af3ad5|bug-13d3af3ad5].
      The issue of this is, that an eventual connect failure is not detected.
      It should be reintroduced, if the information "FD_CONNECT's are not delivered" is correct.
      
      This work is in accordance what is done on the Unix side.
      
    5. foundin initialized to: "8.5.15"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "24. Channel Commands"
    15. title initialized to: "socket -async stall on windows"
    16. type initialized to: "Bug"
  2. Ticket change [41acffd092] (rid 137352) by oehhar on 2014-03-22 16:18:53:

    1. icomment:
      Proposed solution in
      checkin [2596fec7bd] in branch "bug-336441ed59" ready for check.
      
      Backported fix from commit [65b320b464] from branch "bug-[13d3af3ad5]".
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  3. Ticket change [ec8d18e903] (rid 137459) by oehhar on 2014-04-01 13:47:39:

    1. icomment:
      Reinhard has created a test where this bug shows-up on my machine:
      <verbatim>
      set sock [socket -async 169.254.0.0 42424]
      after 10000 {set x timeout}
      fileevent $sock writable {set x writable}
      vwait x
      close $sock
      puts $x
      </verbatim>
      
      The bug shows up as <b>socket 169.254.0.0 42424</b> fails so quickly on my machine with "network is unreachable".
      For me, the writable event does never fire and the timeout fires.
      
      This is on Windows Vista 32 bit with tcl8.5.15.
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  4. Ticket change [8d771ff15d] (rid 137474) by oehhar on 2014-04-02 10:11:18:

    1. assignee changed to: "oehhar"
    2. closedate changed to: "2456749.92452291"
    3. closer changed to: "oehhar"
    4. icomment:
      Test added, which, at least, works on my machine.
      As test is timing dependent, it may not show the error on other machines.
      
      Commited to core-8-5-branch by commit [1dfe1390d8].
      
      Bug closed.
      
    5. login: "oehhar"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "oehhar"
  5. Ticket change [9e5678f685] (rid 137806) by oehhar on 2014-04-29 20:00:01:

    1. closer changed to: "nobody"
    2. icomment:
      Andreas has tested the patch on 8.5 and it failed.
      Here is his message:
      
      Running our stackato.exe in a loop, simply asking for information from
      the target, with https (TLS) active the application hangs after about
      14-28 iterations, with about 14 iterations per minute, so within 1 to
      2 minutes. Symptom of not accepting ^C is the same as before I should
      note.
      
      After activating the --debug-http-log it is not hanging itself within
      10 minutes anymore.
      As that option only activates more output, i.e. introduces delays this
      looks as if there is still a race condition present, old or new.
      
      This means that I will still have to use my fix and branch of Tcl 8.5
      for the stackato client, instead of head.
      Sorry about the bad news.
      
      The rough outline of operations done in the client is:
      
      -1- register tls for https, with http
      -2- open a https -async socket to a webserver
      -3- read some data data, via readable fileevent
      -4- close the socket
      -5- format and print data
      
      Note that the iterations I speak of here are always new stackato
      processes, with each doing the above. The iteration does NOT happen in
      a single stackato process.
      
      The last time I had to investigate the hang happend inside of TLS,
      during the open of the socket, i.e. step 2. The TLS transform does
      sync read/writes to perform the TLS handshake, without using
      fileevents.
      
      I suspect that this is true this time as well.
      
    3. login: "oehhar"
    4. mimetype: "text/plain"
    5. resolution changed to: "None"
    6. status changed to: "Open"
    7. username: "oehhar"
  6. Ticket change [0674c51a75] (rid 138287) by oehhar on 2014-05-29 14:58:41:

    1. icomment:
      Another test version in bug branch: commit [a658836882]:
         *   Don't switch monitoring off when waiting for FD_CONNECT to not loose it
      
      Andreas, I would appreciate, if you could test this.
      
      Thank you,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  7. Ticket change [7bcd66b050] (rid 138296) by oehhar on 2014-05-30 10:42:35:

    1. closedate changed to: "2456807.94624626"
    2. closer changed to: "oehhar"
    3. icomment:
      Here is the message by Andreas about the test result I have even not hoped about but it happend:
      <verbatim>
      I have now completed the check and it seems to have done the trick.
      Using a stackato client wrapped with the basekit build from the specified revision.
      I ran my "testcase" (iterated 'stackato info' against a https target) and saw no hangs for 13 minutes at about 50 iterations/minute, i.e. circa 650 iterations.
      
      When the problem was active I could expect a hang within a minute and two at most.
      
      Thank you very much for the work on this.
      
      Having this in the Tcl 8.5 core branch will make me happy and willing to switch to it again, away from my "win-sock-async-connect-race-fix" branch (which I can/will then close).
      </verbatim>
      
      So, merged by commit [6ecb583012], bug closed, thank you all,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "oehhar"