Skip to content
Tcl Source Code History Of Ticket 550646ffffffffff
Login

History Of Ticket 550646ffffffffff

Artifacts Associated With Ticket 550646ffffffffff

  1. Ticket change [ca4a1a3805] (rid 122440) by nobody on 2002-04-30 14:51:31:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      See comp.lang.tcl thread "Unix forking error".  When
      your tclsh
      has a huge process size (say 1Gb virtual memory) and
      you
      "exec ls", it fails on solaris unless you have 1Gb of
      virtual
      memory free.  The c.l.t. thread contains a test
      program.  The
      discussion in the thread from Peter Da Silva and others
      indicates that you can't just use vfork instead of
      fork, but
      they have outlined a solution.
      
      (Should I have pasted in big pieces of the c.l.t
      discussion?)
      
      - Dave Allen: [email protected]
      
    4. foundin initialized to: "obsolete: 8.3.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to: "exec (fork) from huge process fails"
    11. type initialized to: "Bug"
  2. Ticket change [8f2699b546] (rid 120235) by dkf on 2002-04-30 21:54:19:

    1. assignee changed to: "andreas_kupries"
    2. subsystem changed to: "24. Channel Commands"
  3. Ticket change [f96fd8fe9b] (rid 91709) by andreas_kupries on 2002-04-30 22:12:37:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      Pasting big pieces of the cl.t. discussion: IMHO no. The 
      reason for that is that it would have been sent with each 
      notification email created for every change of this item.
      
      OTOH, attaching them to the report as separate file (see 
      below) has no such problem and should be done.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  4. Ticket change [f74b5443d9] (rid 91349) by davidlallen on 2002-04-30 22:55:15:

    1. icomment:
      Logged In: YES 
      user_id=530697
      
      I have created a file (~100 lines) containing the useful
      bits from the c.l.t thread.  But, there is no button I can
      see to attach a file to an existing problem report.  I have
      just created a sourceforge login and come back, but
      there is still no button.
      
      OK to paste in 100 lines as a "followup"?
      
      
    2. login: "davidlallen"
    3. mimetype: "text/plain"
    4. username: "davidlallen"
  5. Ticket change [f599c0c5bc] (rid 130141) by andreas_kupries on 2002-04-30 23:05:13:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      On this page here, where you attached you comment you can 
      attach files too. Immediately after the text entry field 
      for comment you will see a section "Followups" which 
      displays the comments so far. After that is the 
      section "Check to Upload & Attach File". Check the 
      checkbox, enter the name of the file in the entry field 
      below the checkbox (or use the Browse button), optionally 
      enter a file description in the next entry field. Then use 
      the button "Submit changes" to upload the new attachment.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  6. Ticket change [f493d3d4c8] (rid 129943) by davidlallen on 2002-04-30 23:10:13:

    1. icomment:
      Logged In: YES 
      user_id=530697
      
      Sorry, there is no such checkbox. After "followups" is a
      section 
      which says "Attached files",  and then "Changes".  Do I have
      to be a member of the tcl group?  If you send me an email to
      the above address, I will send you a screenshot of what I
      see.
      
      
    2. login: "davidlallen"
    3. mimetype: "text/plain"
    4. username: "davidlallen"
  7. Ticket change [a4724cff3f] (rid 110207) by andreas_kupries on 2002-04-30 23:22:23:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      Wow. For the time being paste the 100 lines in as a 
      followup. Better have this part of the report now. I can't 
      say how long it will take to understand why file upload is 
      disabled for you. Note that my page says "Existing files" 
      instead of "Attached files".
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  8. Ticket change [a7699a56bc] (rid 98791) by davidlallen on 2002-04-30 23:34:41:

    1. icomment:
      Logged In: YES 
      user_id=530697
      
      Excerpts from discussion on comp.lang.tcl thread "Unix
      forking error encountered", mid-April 2002:
      
      I wrote:
      
      > Here's something you can try.  Take your favorite
      > tclsh and add a command with this C code.  (Yes, I
      > know this command leaks memory.  That's the point :-)
      >
      >    int i; void *p;
      >    for (i=0; i<512; i++) p = malloc(1024*1024);
      >
      > Each time you call it, it increases the virtual
      > memory size of your process by 512MB.  Now, in your
      > tcl shell, call this until the virtual memory size of
      > your process is greater than your remaining free
      > virtual memory.
      >
      > Then "exec ls", and you will get the out of memory
      > message.
      >
      > What I'm hoping to find is a way to run "ls" or other
      > similar unix commands when my virtual memory size is
      > larger than the free virtual memory.
      
      Dan Smart ([email protected]) wrote:
      
      > > > [...] how about: vfork(), then without diddling
      > > > any signal handlers immediately exec() a new
      > > > tclsh with command line arguments telling it that
      > > > it's completing a vfork/exec sequence so it can
      > > > tweak the signal handlers where they're supposed
      > > > to be in the child?
      > >
      > > Referring to the tcl 8.3.3 source code, "fork()"
      > > appears only once, in unix/tclUnixPipe.c, function
      > > TclpCreateProcess.  After fork()'ing, the child
      > > process code (pid == 0 means child process)
      > > executes RestoreSignals() before execvp()'ing.
      > >
      > > Based on my limited understanding, it seems to me
      > > that the code already does what you suggest.
      > >
      > > I think that line of the tcl source code could be
      > > changed to use vfork() instead of fork() and my VM
      > > problem would go away with no side effects.
      > >
      > > Am I missing something?
      >
      > Yes, an extra exec.
      >
      > Doing anything with signal handlers in the child
      > branch of a vfork is not a good idea, in fact doing
      > anything other than an exec is pretty much frowned
      > upon. If you want to use vfork(), you have to replace
      > the current process image (i.e. the copy that is the
      > child), with a new process image. The new process
      > image can then mess with its environment in anyway it
      > chooses, including change signal handling, mess with
      > file descriptors...  Thus to replace fork() with
      > vfork(), you need an intermediate process, that takes
      > the desired eventual command line, sets up a "sane
      > environment", and then execs the final process. The
      > definition of "sane environment" would also have to
      > be passed to the intermediate.
      >
      > Peter's suggestion was that the intermediate process
      > also be an incarnation of tclsh, with a magic flag to
      > tell it to perform the above function. In other words
      > the current (pseudoTCL):
      >
      >         if {[fork] == 0} {
      >                 RestoreSignals
      >                 exec myProgram and an arg
      >         }
      >
      > would become (more pseudoTCL)
      >
      >         if {[vfork] == 0} {
      >                 exec "tclsh -magic myProgram and an arg"
      >         }
      >
      > and tclsh would include the following (even more
      > pseudoTCL)
      >
      >         if {[string equal [lindex argv 0] "-magic"]} {
      >                 eval [lreplace $argv 0 0 exec]
      >         }
      >
      > Note that this does not include passing the necessary
      > context information to actually restore the signal
      > handlers (we need to set them to whatever the
      > original tclsh inherited from its parent, rather than
      > just to default).
      
      
      
    2. login: "davidlallen"
    3. mimetype: "text/plain"
    4. username: "davidlallen"
  9. Ticket change [e52e61ee06] (rid 88086) by dgp on 2002-05-08 11:58:46:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      You've stumbled on the SF shortcoming I registered as
      Feature Request 490389.
      
      http://sf.net/tracker/?func=detail&aid=490389&group_id=1&atid=350001
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [5ba9364c75] (rid 259724) by serhiy.storchaka on 2026-10-21 10:03:37:

    1. icomment:
      Since 8.6.14 and 9.0.0, exec on Unix creates children with vfork() (or posix_spawnp()) instead of fork(), so the parent's address space is no longer duplicated: [b5b3c28401] and [42d3f0cdb9], ticket [c54e4a1aeb].
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  11. Ticket change [26b2e175f4] (rid 260016) by serhiy.storchaka on 2026-10-22 17:19:30:

    1. closedate changed to: "2461334.9191877777"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"