-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop depending on avrt.dll
statically on Windows
#27
Conversation
Before merging this we should probably review all the other ways Firefox code calls into |
This is the only call site that is compiled. Fixing this doesn't need to wait on fixing that other call-site, but the CI should be green. |
I was mentioning this because I saw we have some crashes going through About the failure, the error is a bit unexpected. Have jobs always been trustworthy for Windows? (i.e. tests never failed with the previous code) Did you ever get a similar error before? Can you run again to see if it's intermittent? Can you let both nightly and stable jobs run to completion? Thank you. |
It's simply calling this crate indeed. |
7252f2f
to
94ea17f
Compare
* Load `avrt.dll` dynamically with `LoadLibraryW` * Fail with an `AudioThreadPriorityError` * Ensure thread-safety with a warmup call See also https://bugzilla.mozilla.org/show_bug.cgi?id=1884214
94ea17f
to
36cd677
Compare
I have fixed the tests by playing with the CI. The failures seem to indicate the following although it is mostly speculation from me: if parallel calls to I triggered this behavior by adding new tests in the Windows part of the code, whereas we had only a single test running on Windows before. The preexisting code already had the issue, but it wasn't showing because of the single test. I have added a new test that explicitly tests the API in a multithreaded setting to make sure that we cover this explicitely. Then to solve the actual issue, I have added a warmup call to Note that on a non-CI machine, it may be fine to assume that the service is already running, in which case this wouldn't cause a problem for actual users. On my own machine MMCSS is on Auto start, which suggests we should be fine as long as my speculations from above are correct. Even if I set it on Demand start, it is started by the time I reach my desktop. |
Thanks for all the research! |
Load
avrt.dll
dynamically withLoadLibraryW
Fail with an
AudioThreadPriorityError
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1884214
Note: This adds a dependency to
once_cell
on Windows.Note: If the functions are always called from the same thread we could replace
once_cell::sync::OnceCell
withonce_cell::unsync::OnceCell
. I took the thread-safe option because I don't know if it is the case or not.This is a follow-up of #26 which I closed over (legitimate) calling convention concerns. I have checked that the tests now pass in 32-bit x86 as well (they did not before).