Skip to content

Commit

Permalink
HPCC-32960 Fix epoll memory corruption issues
Browse files Browse the repository at this point in the history
Although the SelectItem 'items' array is protected by a CS,
epoll_wait can receive pending events for SelectItems that have
been deleted, which were then link counted and caused corruption.

Like the select handler version, avoid deleting the SelectItem's
when items are removed, instead mark them deleted and let the
triggerselect() approach remove them on the main thread.

Also fix a theoretical issue when adding a existing socket to
CSocketEpollThread, it did not check other CSocketEpollThread's
to see if it needed to be removed. (given default hdlPerThrd is
UINT_MAX, it will not have happened).

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
  • Loading branch information
jakesmith committed Nov 11, 2024
1 parent 7067a3c commit 0ecb3e4
Showing 1 changed file with 181 additions and 85 deletions.
Loading

0 comments on commit 0ecb3e4

Please sign in to comment.