[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Problems with Linux VM - EPOLL (Issue #615)

David T Lewis notifications at github.com
Mon Feb 21 23:02:12 UTC 2022


EPOLL on Linux can be a bit problematic when fork() is used (OSProcess forkSqueak). I wonder if there may also be some issues related to EPOLL on Linux pthreads? Totally guessing but Linux threads are built on top of its process model so it makes me wonder.

Here are some updates I've made in the last year related to EPOLL on Linux when fork() may be involved:

Author: David T Lewis <dtlewis290 at gmail.com>
Date:   Fri Jul 23 18:47:02 2021 -0400
    Merge pull request #552 from OpenSmalltalk/dtl/epoll-forksqueak
    For epoll aio, close and reopen the epoll fd in forked child process

commit 066a43128584d55964f4a6ace4b2c878cf96087e
Author: David T. Lewis <lewis at mail.msen.com>
Date:   Mon Feb 8 15:14:42 2021 -0500
    For epoll aio, close and reopen the epoll fd in forked child process
    Factor the epoll initiation out of aioInit into new epollInit function
    and invoke it via pthread_atfork in the child process after a fork.
    Prevents misdelivery of events from the common kernel epoll structures.

commit f376ffbc0b6d62047b7effb7f29d405fbd7e4611
Author: David T. Lewis <lewis at mail.msen.com>
Date:   Sun Feb 7 23:16:24 2021 -0500
    Fix epoll event delivery error messages cut and paste error

commit b6616b21d263ecaa334d458bf3a9579fcb88c635
Author: David T. Lewis <lewis at mail.msen.com>
Date:   Sun Feb 7 12:12:42 2021 -0500
    Handle epoll event delivery errors without VM segfault.
    Under certain error conditions epoll may deliver event notification to the
    wrong process, with empty event data provided by the kernel. If this happens,
    handle the condition with a message to stderr and proceed without segfault.
    Error messages will look like this:

      aioPoll in process 9055 no readHandler in epollEventData undefined handler called (fd 0, flags 2)

commit 75498075b2bd030794f54c5303d00626fe33b195
Author: David T. Lewis <lewis at mail.msen.com>
Date:   Sun Feb 7 12:09:51 2021 -0500
    Rearrange forgetXDisplay to disable aio before fd close.
    Required for epoll event handling, we should not close the descriptor
    before unregistering it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/615#issuecomment-1047282935
You are receiving this because you are subscribed to this thread.

Message ID: <OpenSmalltalk/opensmalltalk-vm/issues/615/1047282935 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220221/16e8eb52/attachment.html>


More information about the Vm-dev mailing list