[erlang-patches] fix livelock in erts_poll_info_kp()

Björn Gustavsson bgustavsson@REDACTED
Sat May 15 10:27:30 CEST 2010


On Wed, May 12, 2010 at 12:03 PM, Mikael Pettersson <mikpe@REDACTED> wrote:
> erts_poll_info_kp() [defined in erts/emulator/sys/common/erl_poll.c
> via some name-mangling trickery] contains a code path that can end
> up in an infinite loop, causing a livelock.  There is a block of code
> inside #if ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE that is supposed to
> iterate over a linked list of ErtsPollSetUpdateRequestsBlocks and
> update two variables based on the sizes of these blocks.  The bug is
> that the loop forgets to advance the list pointer to the next element,
> so if the loop is entered at all (the initial list pointer is non-NULL),
> the thread falls into an infinite loop.
>
> This patch, against R13B03 but applies fine to today's git, fixes the
> bug by adding a statement to advance the list pointer in the loop.
> All other loops over this list appear to be correct.
>

Thanks! Included in 'pu'.

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list