[Vm-dev] unix SqueakSource socket 'too many open files' problem

stes@PANDORA.BE stes at telenet.be
Mon Mar 1 13:45:38 UTC 2021


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


One thing to check is also 

	ulimit -n

the numbber of open files that the shell reports.

You could change it with ulimit -n -S <n> where <n> is smaller than the 
current limit.

I'm not sure whether it matters for sockets.

But it may be the case that some software
was installed on your machine that perhaps changed the profile, 
and that change the ulimit -n setting.

David Lewis wrote:

> Tim, one other thing to look out for is the event handling in the VM.
> Since last October it now uses the Linux-specific epoll mechanism.
> If the problem you see now started happening after updating to a
> newer VM, then consider this as a possible suspect. 

Linux epoll originated on Linux but there exist implementations on other
Operating Systems it seems.

OpenIndiana has epoll and other facilities like Berkeley BSD kqueue.

https://illumos.org/man/5/epoll

When running the Squeak opensmalltalk configure script it says for me

$ grep HAVE_EPOLL config.h 

#define HAVE_EPOLL 1
#define HAVE_EPOLL_PWAIT 1

So basically the configure script logic detects on OpenIndiana <sys/epoll.h>
and enabled it.

This is because the ax_have_epoll.m4 M4 file from autoconf was used:

https://www.gnu.org/software/autoconf-archive/ax_have_epoll.html

If I configure ax_cv_have_epoll=no ax_cv_have_epoll_pwait=no

then

$ grep EPOLL config.h 
/* #undef HAVE_EPOLL */
/* #undef HAVE_EPOLL_PWAIT */

So basically when epoll support was introduced,
it automatically switched on OpenIndiana to epoll.

So you could try as an experiment build the VM with

   ax_cv_have_epoll=no ax_cv_have_epoll_pwait=no

The way to do that would be to edit the "mvm" script and add the above
to the configure command line so that git diff reports something like:

- -       CFLAGS="$OPT"
+       CFLAGS="$OPT"\
+       ax_cv_have_epoll=no ax_cv_have_epoll_pwait=no

I am not sure whether it is the right way to disable epoll.

Perhaps a configure --without-epoll exists but I don't see it.

Also an issue is , how to see how the VM was built ?

In my case, by default on OpenIndiana epoll seems to be enabled now.

$ strings squeak | grep aioEnable
aioEnable(%d, %p, %d): IGNORED
aioEnable(%d): fd too large
aioEnable: descriptor %d already enabled
aioEnable(%d, %p, %d): allocating new epoll_event
aioEnable: malloc event
aioEnable(%d, %p, %d): allocating new epollEventData
...
aioEnable(%d, %p, %d): enable non-blocking io and sigio

... but when I compile with ax_cv_have_epoll=no ax_cv_have_epoll_pwait=no

then

$ strings squeak  | grep aioEnable
aioEnable(%d, %p, %d): IGNORED
aioEnable(%d): fd too large
aioEnable: descriptor %d already enabled
aioEnable(%d): external

To return to the Linux case, it could be a good experiment to build the VM
without epoll if that is supported and see if it makes a difference,
either by using the method described or by the recommended method to do it
(as the method I describe may not be the correct one).

Finally as David T. Lewis also indicates the problem may have existed 
in the past before epoll, so there is of course not really an indication
that epoll is involved here.

Basically as I read my interpretation of what David T. Lewis wrote is that
file descriptor socket leaks have always been a problem - with/without epoll.

Regards,
David Stes

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJgPO/GAAoJEAwpOKXMq1MaCUUIAK0d//me/vV4uuICELaOnxEs
zCqHtdb/8J8lI4GhvBW/oniSanyduFyzCxe7powS+5m4L/ons7U/2wmQXS2w3Vcy
gY9pbXm4m5v9xIBUC0oD/REqhTo0epeem8Q/2GN6bvHPBjTt+BWVh3Z42l6HN/TB
LXFfnXPck5buU2Lzo27brXE2XAweZx2JKdjhxB+YGOzsiwjWECqiy+zDXwXi2uN7
KG2ijFdQ6QTd5TaeQWgLhpFT/gnGX1ss8KPlkeKdcE7SH+EM0zPiie50bulUaJ7Q
viLM3pT7+K5U9NZ7FXbkhACg4MR8MPz0llHC4zUznqwiaNv2XEwf4Tk+Zy+rnhs=
=7R9P
-----END PGP SIGNATURE-----


More information about the Vm-dev mailing list