Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 32d512be5bb9e41561b12be67c5d6d27f5dcabae
Ticket: 219012ffffffffffffffffffffffffffffffffff
tmpnam limitation
User & Date: nobody on 2000-10-26 01:09:18
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 3911 Bug
    Version: 8.2
    SubmitDate: '1999-12-21'
    LastModified: '2000-03-31'
    Severity: SER
    Status: Released
    Submitter: techsupp
    ChangedBy: ericm
    OS: Linux
    Machine: IBM PC/AT compatible
    FixedDate: '2000-03-31'
    FixedInVersion: 8.3.1
    ClosedDate: '2000-10-25'
    
    
    Name:
    Hiroshi Kasai
    
    CustomShell:
    JP patch
    
    Comments:
    Precisely, I found this bug in tcl7.6. But, it is same as in tcl8.2.
    
    If you use a function 'exec' or 'open "|..."', tcl calls a function 'tmpnam'. This function has a limitation.
    It is defined in stdio.h as
    #define TMP_MAX 238328
    This is a maximum number of calls for the function 'tmpnam'.
    If it gets over, the function returns NULL. But, the function is used as
    
    char fileName[L_tmpnam]; 
    
    tmpnam(fileName); 
    
    The 'fileName' is local variable. So, if 'tmpnam' returned NULL, 'fileName' value is not changed.
    And more, the variable is not initialized because it is local,
    Nothing happens if it is lucky.An error is indicated if it has bad luck a little.
    When it is the worst, if the variable has a exist file name, the file is destroyed.
    It is to redirect standard error output specifically to avoid this.
    
    ReproducibleScript:
    open "|command"
    exec command
    
    ObservedBehavior:
    couldn't create error file : no such file or directory
    
    
    
    Thanks for pointing this out.  I added a test for a NULL return from tmpnam, which will solve this problem on Linux and should be non-harmful on other UNIX (Solaris and HP-UX both follow a different convention when TMP_MAX is exceeded).  This fix will go out with 8.3.1.
    
    - eric
    
    -- 03/31/2000 ericm
    
    
    
  4. foundin changed to: "obsolete: 8.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "60. NRE and coroutines"
  10. title changed to: "tmpnam limitation"
  11. type changed to: "Bug"