Skip to content
Tcl Source Code History Of Ticket ed29c4da21
Login

History Of Ticket ed29c4da21

Artifacts Associated With Ticket ed29c4da21

  1. Ticket change [2583c8ee98] (rid 140228) by anonymous on 2014-10-09 19:29:48:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      The command http::geturl -channel is broken on MacOS 10.9.5 (and likely other versions). Transfers fail while writing to the channel with "resource temporarily unavailable". Transfers seem to work if -channel not specified. Here is an example:
      
      package require http
      
      set outname "saturn.jpg"
      set url "http://apod.nasa.gov/apod/image/1409/saturnequinox_cassini_7227.jpg"
      set out [open "temp" w]
      set token [::http::geturl $url -channel $out]
      close $out
      package require http
      
      set outname "saturn.jpg"
      set url "http://apod.nasa.gov/apod/image/1409/saturnequinox_cassini_7227.jpg"
      set out [open "temp" w]
      set token [::http::geturl $url -channel $out]
      close $out
      puts "done"
      
      On MacOS with ActiveState Tcl 8.5.16 I see:
      Error in startup script: error reading "sock8": resource temporarily unavailable
          while executing
      "::http::geturl $url -channel $out"
          invoked from within
      "set token [::http::geturl $url -channel $out]"
          (file "tcl http example.tcl" line 6)
      localhost$ wish tcl\ http\ example.tcl 
      Error in startup script: error reading "sock8": resource temporarily unavailable
          while executing
      "::http::geturl $url -channel $out"
          invoked from within
      "set token [::http::geturl $url -channel $out]"
          (file "tcl http example.tcl" line 6)
      
    5. foundin initialized to: "8.5.16"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "a7673d7774a7264840c8898b901228c171b16b73"
    10. resolution initialized to: "None"
    11. severity initialized to: "Severe"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to: "http::get -channel broken on MacOS"
    16. type initialized to: "Bug"
  2. Ticket change [c35a19a91f] (rid 140230) by aku on 2014-10-09 19:46:21:

    1. icomment:
      From the description it seems that a 'read' on the socket fails.
      
      The underlying error code for the message ('resource temporarily unavailable')
      usually is EAGAIN or EWOULDBLOCK, pointing to some mishandling in that area ?!
      
      Do you see the issue only with the APOD site, or others as well ?
      
    2. login: "aku"
    3. mimetype: "text/plain"
  3. Ticket change [0177255f95] (rid 140232) by anonymous on 2014-10-09 20:37:25:

    1. comment changed to:
      The command http::geturl -channel is broken on MacOS 10.9.5 (and likely other versions). Transfers fail while writing to the channel with "resource temporarily unavailable". Transfers seem to work if -channel not specified. Here is an example:
      
      package require http
      
      set outname "saturn.jpg"
      set url "http://apod.nasa.gov/apod/image/1409/saturnequinox_cassini_7227.jpg"
      set out [open $outname w]
      set token [::http::geturl $url -channel $out]
      close $out
      package require http
      
      On MacOS with ActiveState Tcl 8.5.16 I see:
      Error in startup script: error reading "sock8": resource temporarily unavailable
          while executing
      "::http::geturl $url -channel $out"
          invoked from within
      "set token [::http::geturl $url -channel $out]"
          (file "tcl http example.tcl" line 6)
      localhost$ wish tcl\ http\ example.tcl
      
    2. icomment:
      I see the problem on every site I have tried (I used APOD as a public place to get a large image).
      
      I'm pretty sure the error is in writing the file. based on error messages I see when running similar code in Python using Tkinter (which is where I first ran into the problem -- I primarily code Python, hence some of the clumsiness in my code example).
      
    3. login: "anonymous"
    4. mimetype: "text/plain"
  4. Ticket change [0c7cf0d570] (rid 140234) by aku on 2014-10-09 21:32:08:

    1. icomment:
      "writing the file" - Then why is the message
         'error reading "sock8"'
      That is definitely reading from the socket.
      A file handle would be something like 'fileXXX'.
      
      Still, with it 'working' for any site it should be possible to bisect where the problem started.
      
    2. login: "aku"
    3. mimetype: "text/plain"
  5. Ticket change [d8937714fc] (rid 140235) by aku on 2014-10-09 22:03:43:

    1. icomment:
      Can confirm the error on a Snow Leopard box with 8.5.16. Somebody said that 8.5.9 works, so I will try that and if that is true bisection can run.
      
      (I modified the script a bit, i.e. I added the missing 'fconfigure -translation binary $out', and the missing '-binary 1' for the geturl call).
      
    2. login: "aku"
    3. mimetype: "text/plain"
  6. Ticket change [024bf81b08] (rid 140236) by aku on 2014-10-09 22:14:18:

    1. icomment: "Confirmed that 8.5.9 works with the same script."
    2. login: "aku"
    3. mimetype: "text/plain"
  7. Ticket change [35a8cd4a92] (rid 140237) by aku on 2014-10-09 22:39:33:

    1. assignee changed to: "dgp"
    2. icomment:
      Bisection result:
      
      bisect complete
        1 BAD     2014-10-09 14:52:48 b14bb38f76f7ee7a
        9 BAD     2014-09-01 08:11:52 abaf2748e223200a
       11 BAD     2014-08-25 15:36:16 06a91f777f9dc176
       12 BAD     2014-08-22 13:23:04 70e97884f0a0517b
       13 CURRENT 2014-08-22 13:23:04 [70e97884f0a0517b] -- Here it came in
       10 GOOD    2014-08-20 18:59:31 ff52fbb4ac3eb0a8
        8 GOOD    2014-08-13 09:04:55 a0fa37f70e4b3310
        7 GOOD    2014-07-10 12:52:10 6526c143035aba08
        6 GOOD    2014-05-14 09:11:42 57d9dfa4e6b7ca2a
        5 GOOD    2014-03-27 21:35:57 b846182cdc2e35ab
        4 GOOD    2013-06-12 10:24:52 e2b60a9a55e05f48
        3 GOOD    2012-07-28 22:54:19 288d3e72e58232c0
        2 GOOD    2010-09-08 17:38:32 7f1e1062ab6ea681
      
      That checkin was made by dgp for Eric Boudaillier.
      Assigning the ticket now.
      
      Will also attach my test script. Derived from the original one.
      
    3. login: "aku"
    4. mimetype: "text/x-fossil-wiki"
  8. Add attachment "iotrap.tcl" [22def0099f] (rid 140239) by aku on 2014-10-09 22:40:28.

  9. Ticket change [ff69c7bbdd] (rid 140240) by aku on 2014-10-09 22:48:17:

    1. icomment:
      Looking at the quite short delta I suspect that the removal of the GotFlag check for CHANNEL_BLOCKED is the problem. That is triggered by EWOULDBLOCK IIRC, and that matches the issue we now have.
      
    2. login: "aku"
    3. mimetype: "text/plain"
  10. Ticket change [de3fcc9b01] (rid 140246) by dgp on 2014-10-10 01:07:30:

    1. icomment:
      
      Thanks for isolating the cause.
      
      Key to making progress is to look at [5180649ac5].
      Comment there is "Same results; simpler logic" but now
      we know that's false, because that's the checkin that
      broke this demo script.
      
      Anyone who needs a fix *NOW* can apply the backout
      of that patch, and it should work.
      
      Mystery why this fails on 8.5, but doesn't seem to affect
      8.6.2.  After I further analyze the detailed cause, it may
      be that some other demo script can demo similar troubles there.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  11. Ticket change [ea4f229f9d] (rid 140249) by dgp on 2014-10-10 13:42:30:

    1. icomment:
      
      In the demo script, the bug is in [chan copy] aka [fcopy].
      That's the easiest route for scripts to get to where the
      problem is.  Most other script-level channel read operations
      do not go there.
      
      The problem doesn't show in Tcl 8.6 with this script because
      the same conditions that route to the bug in 8.5 route to the
      new optimized "MoveBytes" version of [chan copy] in 8.6, so
      the bug is dodged there, at least in this instance.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  12. Ticket change [9fb3ae72a9] (rid 140253) by dgp on 2014-10-10 15:42:37:

    1. icomment:
      Spoke too soon.
      
      New test io-53.15 committed to both core-8-5-branch and trunk.
      
      Demonstrates the bug in both branches.  MBRead() copied the
      same bug over.
      
      The http script doesn't demo the problem in 8.6.  I have to
      guess that all of the [socket] channel changes (IPv6, etc.)
      have had the effect that sockets just do not raise EAGAIN
      in the same circumstances.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  13. Ticket change [50aabe0745] (rid 140260) by dgp on 2014-10-10 18:24:54:

    1. icomment:
      
      Fix committed to the 8.5 branch.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  14. Ticket change [9f333b04f0] (rid 140270) by dgp on 2014-10-10 19:45:06:

    1. closedate changed to: "2456941.32299205"
    2. closer changed to: "dgp"
    3. icomment:
      
      Completed fix committed to trunk.
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"