Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8d03a89608f5f6362ebdc8678a3824e22c071327
Ticket: 2840603fffffffffffffffffffffffffffffffff
Tcl hangs or crashes with [fileevent] on too many sockets
User & Date: eee on 2009-08-19 21:39:02
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Tcl hangs if I try to use event-driven I/O on more than approximately 1024 channels, and if I use greatly more than that, Tcl crashes. I used ActiveTcl 8.5.6 and an 8.6b1.1 basekit from the teapot. Running on sparc Solaris 10.
    
    gps suggested that the issue has to do with the FD_SETSIZE define of the select() system call, and suggested that the fix involved checking "if ( fd >= FD_SETSIZE)" in tclUnixNotfy.c:Tcl_CreateFileHandler()
    
    # SAMPLE script that will coredump.
    # (for a script that merely hangs, change the "3000" to "1100" or smaller)
    proc accept {fd host port} {
            puts "Got connection: $host:$host:$fd"
            fileevent readable $fd [list read-data $fd]
    }
    proc read-data {fd} {
            puts "$fd: [read $fd]"
    }
    for {set port 1} {$port < 3000} {incr port} {catch {socket -server accept $port} res; puts "$port:$res"}
    puts "Now listening."
    % vwait forever
    
  4. foundin changed to: "obsolete: 8.5.7"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "eee"
  10. subsystem changed to: "25. Channel System"
  11. title changed to:
    Tcl hangs or crashes with [fileevent] on too many sockets
    
  12. type changed to: "Bug"