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

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 31 11:27:41 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.

Off hand, do you have a feeling on how accurate this method is? I keep
running in situations where the SIGEV_THREAD did not seem reliable and
the spinner never terminated -- so I welcome a chance to do something
different (even if using timerfd + thread is effectively what glibc is
doing behind the scenes, and why I didn't really concern myself with
trying to do better.)
-Chris


More information about the igt-dev mailing list