|
2026-10-22
| ||
| 17:19 | • Ticket [54683c0e7b] Creeping up on maximum O/S allowable file descriptors aborts... artifact: 7400effcb0 user: serhiy.storchaka | |
|
2026-10-12
| ||
| 19:51 | • Closed ticket [54683c0e7b]. artifact: aabff163f2 user: serhiy.storchaka | |
|
2018-11-19
| ||
| 18:41 | • Ticket [54683c0e7b]: 4 changes artifact: 3528281dd1 user: dgp | |
|
2018-11-18
| ||
| 01:38 | • New ticket [54683c0e7b]. artifact: ecbda6b66f user: anonymous | |
Creeping up on maximum O/S allowable file descriptors aborts
Closed / Duplicate54683c0e7bc3ae1e1edcd7603925ffd84c8cdc23Created 8 years agoUpdated 42 days ago
Descriptionplain2018-11-18 01:38:55
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
dgpplain2018-11-19 18:41:07
Reinhard, anything here you can look at?
serhiy.storchakawiki2026-10-12 19:51:12
Duplicate of [c6897e6e6a]: the select notifier overflows its fd_set for descriptors >= FD_SETSIZE (1024 on Linux). With a 2048 or 4096 descriptor limit 8.6.17 aborts ("bit out of range 0 - FD_SETSIZE on fd_set"). 9.0 and 9.1 use epoll on Linux and accept the connection at any limit. The connections that are never presented when the limit is reached are accept() failing with EMFILE, also discussed there.
serhiy.storchaka Ticket [54683c0e7b]: 3 changes
[History diff]2026-10-22 17:19:25
Log in (anonymous is fine) to add a comment.