EffectsBackend: fix crash when AU manifest loading times out - #16298
Open
ProfKenUston wants to merge 2 commits into
Open
EffectsBackend: fix crash when AU manifest loading times out#16298ProfKenUston wants to merge 2 commits into
ProfKenUston wants to merge 2 commits into
Conversation
daschuer
requested changes
Apr 7, 2026
daschuer
left a comment
Member
There was a problem hiding this comment.
Thank you for the fix.
This looks also like a 2.5 fix. Can you rebase it as well?
| } | ||
| if (!pManifest2) { | ||
| return true; | ||
| } |
Member
There was a problem hiding this comment.
This code looks a bit scary. Why is a null manifest added in the first place? I think this shall not happen.
The checks here are OK to not crash, but It would be better if hat never happens and we can use VERIFY_OR_DEBUG_ASSERT() here.
Maybe this is now resolved anyway by the mutex fix?
|
This PR is marked as stale because it has been open 90 days with no activity. |
Member
|
Friendly ping @ProfKenUston :) |
Member
|
The issue has been probably introduced to our 2.6 branch via #13887 I will rebase it to that. |
AudioUnitBackend loads manifests asynchronously via dispatch_group_async with a 6-second timeout. If the timeout fires, m_manifestsById is only partially populated, but getEffectIds() was iterating m_componentsById (populated synchronously for every discovered AU). Callers would then receive null EffectManifestPointers from getManifest(), and the next std::sort on the combined manifest list would dereference null in EffectManifest::sortLexigraphically and segfault. Fix: - AudioUnitBackend::getEffectIds() now returns keys from m_manifestsById so only fully loaded manifests are reported. The three map accessors also take m_mutex (now mutable) to stop racing the loader threads. - EffectManifest::sortLexigraphically null-checks both arguments as defensive insurance for any other backend that might expose a null.
daschuer
force-pushed
the
fix-au-manifest-race
branch
from
August 16, 2026 05:01
c073285 to
2aeb09e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AudioUnitBackend loads manifests asynchronously via dispatch_group_async with a 6-second timeout. If the timeout fires, m_manifestsById is only partially populated, but getEffectIds() was iterating m_componentsById (populated synchronously for every discovered AU). Callers would then receive null EffectManifestPointers from getManifest(), and the next std::sort on the combined manifest list would dereference null in EffectManifest::sortLexigraphically and segfault.
Fix: