[igt-dev] [PATCH] lib/igt_dummyload: Use timerfd rather than SIGEV_THREAD

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 31 13:52:57 UTC 2020


Quoting Michał Winiarski (2020-03-31 12:19:11)
> From: Michał Winiarski <michal.winiarski at intel.com>
> 
> Since timer_delete doesn't give us any guarantees that the thread and
> its notify_function isn't currently running, we can hit a use-after-free
> in a race condition scenario.
> This causes a seemingly random segfault when igt_spin_end from notify
> thread is called after igt_spin_free was already called from the main
> thread.
> Let's fix that by using timerfd and managing the timer thread ourselves.
> 
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>

Seems I was confused with the meaning of timerfd_canceled() and imbued
it with properties it did not have,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list