Discussion:
[ast-developers] ksh file descriptor leak
Jeff Frontz
2016-10-14 12:32:30 UTC
Permalink
The reason I was trying to build the latest ksh on El Capitan was to see if
a file descriptor leak persists in the latest version.

Here's my simplified test script -- can someone running the latest version
of ksh try it and see if the list of open files (actually a pipe, I think?)
grows until the system-imposed limit is reached?

Thanks,
Jeff

---

#! /bin/ksh

fdUser() {
:
}

while true
do
fdUser <(
echo " -e"
)

if [ -d /proc ]
then
ls /proc/$$/fd
else
lsof -p $$ | wc -l
fi
sleep 1
done
Martijn Dekker
2016-10-17 20:13:17 UTC
Permalink
Post by Jeff Frontz
The reason I was trying to build the latest ksh on El Capitan was to see
if a file descriptor leak persists in the latest version.
I can't get it to compile on El Capitan (10.11) at all. I still have a
binary of the latest beta which I managed to compile (with much effort)
on 10.7. It wasn't usable: lots of segfaults. It also sort of runs on
10.11 and your scripts says it has the bug:

$ /usr/local/src/ksh93/ast/arch/darwin.i386-64/bin/ksh test.ksh
14
15
16
17
18
19
20
21
22
23
24
25
26
27
^C

- Martijn

Loading...