Skip to content
Tcl Source Code History Of Ticket 1322866fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1322866fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1322866fffffffffffffffffffffffffffffffff

  1. Ticket change [384011f12d] (rid 112164) by mteira on 2005-10-10 14:23:33:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Embedded interpreter into an application that is not
      using zero descriptor for stdin, gets this descriptor
      closed (a AF_INET socket in this case) when
      Tcl_FinalizeThread is called:
      
      ff3705b0 close    (0, 13b320, 4, 2, 0, ff331be0) + c0
      fed91eac TcpCloseProc (150f10, 0, fed91e9c, ff3dc790,
      0, 1) + 10
      fed5fdfc CloseChannel (0, 16cff0, 13b320, 7efefeff, 6e,
      6e) + e8
      fed5fd00 FlushChannel (0, 16cff0, 0, 0, 67, 67) + 298
      fed60170 Tcl_Close (0, 16cff0, feda0af0, feda0b00, 0,
      2) + 148
      fed5e9a0 TclFinalizeIOSubsystem (146330, fed68928, 68,
      39924, aebd8, 0) + a8
      fed4d3d4 Tcl_FinalizeThread (fd40f3c0, b0e90, aeaf4,
      fd40f3d0, 184, af488) + 8c
      
      This file descriptor is not related with the embedded
      tcl subsystem, neither used or referenced from tcl code. 
      
      This is happening on a Solaris 8 platform using sparc
      binaries.
      
      
      
    4. foundin initialized to: "obsolete: 8.4.6"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "mteira"
    9. subsystem initialized to: "25. Channel System"
    10. title initialized to: "TclFinalizeIOSubsystem closes zero descriptor"
    11. type initialized to: "Bug"
  2. Ticket change [b5d6f62979] (rid 125314) by dgp on 2005-10-11 01:34:00:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      see also 1192047
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [aeca5f3685] (rid 101698) by dkf on 2005-10-11 04:27:51:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Thinking about this (not very deeply though) it seems to me
      that FD 0 (and 1 and 2) should only be magical (outside of
      the [exec] guts) if it is open when we init the IO
      subsystem. Otherwise, the special behaviour attached to
      stdin (stdout, stderr) should simply vanish. OK, that'll
      make a number of things unhappy, but it'll be up to script
      authors to deal with that (and it should at least be better
      than a crash!)
      
      Alternative is to hack around closed std channels by opening
      the platform's null device in their place. Not as elegant
      though.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [e40b20ce67] (rid 87895) by mteira on 2005-10-11 14:19:10:

    1. icomment:
      Logged In: YES 
      user_id=308238
      
      I don't know what is the best solution. Anyway, it seems to
      me that there are two different problems.
      One of them is the interpreter closing file descriptors not
      opened by itself. That's what is happening here.
      The other one is if the interpreter is able to tell if a
      file descriptor is actually stdin/stdout/stderr. File
      descriptor 1 can be a regular file not related with stdout
      when my process is a daemon, and could also be stdout in
      this situation if I exec'ed it using redirection. Are these
      cases distinguised?
      
      
    2. login: "mteira"
    3. mimetype: "text/plain"
    4. username: "mteira"
  5. Ticket change [5070fd4ceb] (rid 125967) by dgp on 2005-12-19 22:56:06:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      "interpreter closing file
      descriptors not opened by
      itself" is a (underdocumented?)
      feature of Tcl_MakeFileChannel().
      That's a very old interface
      predating the existence of a
      Tcl_Finalize() distinct and
      separate from Tcl_Exit(), IIRC.
      There are existing programs
      that rely on T_MFC acting
      this way.
      
      It's not so clear that when
      Tcl creates default standard
      channels that it ought to be
      calling T_MFC to do it, given
      this feature.  Now that existence
      of Tcl_Finalize() suggests Tcl
      supports finalizing in an app
      that will continue to run, it
      doesn't seem to be a good thing
      that Tcl forces closed the file
      descriptors corresponding to its
      standard channels.
      
      And in this particular report,
      there's the additional wrinkle
      that in this case file descriptor
      0 isn't even the right thing to
      attach to the "stdin" channel.
      
      Since this report is about an
      "embedded interpreter" I assume
      the app in question is a C program,
      and the workaround ought to be to
      include whatever Tcl_SetStdChannel()
      calls are required to force Tcl to
      use some harmless alternatives for
      its std* channels, and not the
      0, 1, 2 file descriptors being used
      in other ways by the program.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [ba8edb8142] (rid 129340) by dgp on 2006-03-10 13:34:29:

    1. assignee changed to: "dgp"
    2. priority changed to: "9 Immediate"
  7. Ticket change [3500e1948a] (rid 106843) by dgp on 2006-03-27 23:25:22:

    1. priority changed to: "7 High"
  8. Ticket change [72b96966c9] (rid 100911) by dgp on 2006-06-06 00:58:25:

    1. closedate changed to: "2006-06-05T17:58:25"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Putting this in the
      "Won't Fix" file.  Correct
      way to deal with this issue
      is to use Tcl_SetStdChannel()
      to give Tcl some other channels
      to do its stdfoo businees with
      when it ought to keep its hands
      off of file descriptors 0, 1, and 2.
      
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Closed"
    8. username: "dgp"