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 8, 2024
1 parent 7067a3c commit a08faf0
Showing 1 changed file with 169 additions and 94 deletions.
Loading

0 comments on commit a08faf0

Please sign in to comment.