Closed Bug 1612713 Opened 4 years ago Closed 4 years ago

Avoid unloading several libraries in TSan builds

Categories

(Core :: Security: PSM, enhancement)

x86_64
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: decoder, Assigned: decoder)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

With TSan we cannot unload libsecret once we have loaded it because TSan does not support unloading libraries that are matched from its suppression list. To avoid this problem altogether, let's just not support libsecret for now in TSan builds.

There are a few more places where we load libraries on-demand and the pattern is always quite similar:

  1. We load the respective library.
  2. We check by some means, that it provides the necessary features.
  3. If the required features are not detected, we unload it and return an error (causing the feature to not be supported).
  4. At destruction time, we unload the library if we kept it around earlier.

I think we can keep the optional features supported by simply avoiding both unloads. If the library was not adequate, we can still keep it around, but return an error nonetheless. At destruction time, we can also just skip the unloading.

I tried this with several libraries now (e.g. libsecret and libcanberra) and no tests fail because of this. Will attach a comprehensive patch in a few that disables all the unloads that caused me trouble either locally or in CI.

Summary: Disable libsecret in TSan builds → Avoid unloading several libraries in TSan builds
Pushed by choller@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/797cd52b8d01
Avoid unloading several libraries in TSan builds. r=froydnj
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: