Skip to content

EffectsBackend: fix crash when AU manifest loading times out - #16298

Open
ProfKenUston wants to merge 2 commits into
mixxxdj:mainfrom
ProfKenUston:fix-au-manifest-race
Open

EffectsBackend: fix crash when AU manifest loading times out#16298
ProfKenUston wants to merge 2 commits into
mixxxdj:mainfrom
ProfKenUston:fix-au-manifest-race

Conversation

@ProfKenUston

Copy link
Copy Markdown

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 daschuer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix.
This looks also like a 2.5 fix. Can you rebase it as well?

}
if (!pManifest2) {
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions Bot added the stale Stale issues that haven't been updated for a long time. label Jul 7, 2026
@acolombier

Copy link
Copy Markdown
Member

Friendly ping @ProfKenUston :)
Happy to do the rebase otherwise!

@github-actions github-actions Bot removed the stale Stale issues that haven't been updated for a long time. label Jul 20, 2026
@daschuer

Copy link
Copy Markdown
Member

The issue has been probably introduced to our 2.6 branch via #13887 I will rebase it to that.

@daschuer daschuer added this to the 2.6.0 milestone Aug 16, 2026
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
daschuer force-pushed the fix-au-manifest-race branch from c073285 to 2aeb09e Compare August 16, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants