Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ecbda6b66f1503d41b03fc334edb37a5a6a735b5d767161d17234659b4498dcf
Ticket: 54683c0e7bc3ae1e1edcd7603925ffd84c8cdc23
Creeping up on maximum O/S allowable file descriptors aborts
User & Date: anonymous on 2018-11-18 01:38:55
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Running the script below reliably causes an abort under Linux.  My supposition is that somewhere there's a limit on file descriptor storage, presumably sized by guess.  That limit is improperly enforced, and much wackiness ensues. I am confident that this is a rogue pointer or table index, because the behaviour changes when I compile with different -g options.
    
    # Cause Tcl (8.6.9, 8.7a1 etc) to SIGABORT
    # Sufficiently small values of $overhead abort immediately
    # Larger values don't abort, but once the number of connections exceed $maxfiles
    # connections to port 8091 occur, but are never presented to ::Connected, nor are they closed
    
    lassign $argv overhead
    
    if {$overhead eq ""} {
        set overhead 3
    }
    
    try {
        # calculate o/s max fd limit for Linux
        lindex [split [exec -- prlimit --output SOFT --nofile] \n] end
    } on ok {maxfiles} {
        # works for Linux    
    } on error {e eo} {
        set maxfiles 1024	;# I have no idea what value this is for your system
    }
    puts stderr maxfiles:$maxfiles
    
    set count [llength [chan names]]
    while {$count < $maxfiles-$overhead} {
        open [info script]
        incr count
    }
    puts Opened:[llength [chan names]]
    
    proc Connected {args} {
        puts stderr Connected:$args
    }
    
    ::socket -server ::Connected 8091
    
    vwait forever
    
  5. foundin changed to: "8.6.9"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "16910d69b11045755316a073070779a85cd9218f"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "37. File System"
  15. title changed to:
    Creeping up on maximum O/S allowable file descriptors aborts
    
  16. type changed to: "Bug"