CIFuzz: integrate ThreadSanitizer#4981
Conversation
8a948f2 to
58c1cfc
Compare
Use `libraries` instead of `requires` when calling `pkg.generate()` to make the configuration succeed with internal dependencies (i.e. subprojects). Non-functional change.
|
This is starting to take shape. I've opened PR #4985 and google/oss-fuzz#15235, which this PR depends on. TSan is also far more reliable when GLib is built with it, which allows me to remove most of the previously needed suppressions. :) |
3313b54 to
6aa50c5
Compare
Instead, exit the loop when `progress()` returns an error.
Do this only when building with `-Ddeprecated=true`.
6aa50c5 to
6967b16
Compare
|
The changeset at kleisauke/libvips@8ed96ff...6967b16 (which I'll split out later) fixes all known data races found in this PR. The TSan suppressions now apply only to GLib: libvips/suppressions/tsan.supp Lines 3 to 16 in 6967b16 Note that accessing a shared variable from multiple threads without synchronization (where at least one access is a write) is always a data race and causes UB. |
|
That's awesome! Thanks Kleis! |
|
I think(?) the only severe issue was the one fixed in commit 6967b16 (the code was introduced in v8.16.1), where the eval callback could race with the one in Other than that, the remaining data races involved only flags, which are likely not severe. |
libvips does that quite often for events which are not time-critical. Do we need to lock all these, or can we just suppress them? |
I think this falls under what are referred to as "Benign" data races. This blog post also discusses why such races can still be problematic: I'm aware that GLib uses |
Ah interesting, I guess that's true. Then I suppose we should use glib atomics for these cross-thread "signal" variables. It'd be good to avoid mutexes or cond vars if possible, they can limit SMP scaling. |
Ensure it corresponds to the image passed to `vips_sink_disc()`. This fixes a regression introduced in bbd9207 where eval callbacks failed to propagate to the image that was originally marked with `vips_image_set_progress()`.
Opened as a draft since ThreadSanitizer is not officially supported by CIFuzz.
Context: #4713 (comment).
Depends on: google/oss-fuzz#15235.