Created attachment 60179
reference event sources before calling timeout handler to ensure events stay valid for loop iteration.
If ply_event_loop_handle_timeouts() is called before the events returned
by epoll_wait() are referenced, a timeout handler can free an event
source leading to undefined behaviour (and frequently SIGSEGV crashes)
once ply_event_loop_handle_timeouts() has finished since
ply_event_loop_process_pending_events() continues to try and process the
now invalid event sources. Thanks to cjwatson for a simpler solution to
my original fix.
Save errno values to ensure logic is robust in case handler makes
system call.
Created attachment 60179
reference event sources before calling timeout handler to ensure events stay valid for loop iteration.
If ply_event_ loop_handle_ timeouts( ) is called before the events returned loop_handle_ timeouts( ) has finished since loop_process_ pending_ events( ) continues to try and process the
by epoll_wait() are referenced, a timeout handler can free an event
source leading to undefined behaviour (and frequently SIGSEGV crashes)
once ply_event_
ply_event_
now invalid event sources. Thanks to cjwatson for a simpler solution to
my original fix.
Save errno values to ensure logic is robust in case handler makes
system call.