Repository navigation
Conversation
PwRegistry::reset() destroys the registry proxy before destroying its objects. Destruction can re-enter QML and ref an object that has not been destroyed yet, which then called pw_registry_bind() with a null registry.
Author
|
The Arch job failed during configure on an HTTP 504 while fetching zstd for cpptrace. It's a network error unrelated to this change. D. |
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.
PwRegistry::reset() destroys the registry proxy before destroying its objects. Destruction can re-enter QML and ref an object that has not been destroyed yet, which then called pw_registry_bind() with a null registry.
Describe your changes
Fixes a segfault when the PipeWire connection drops (refs #1435).
When the connection hits a fatal error,
PwRegistry::reset()destroys the registry proxy first and then tears down the nodes one by one. Destroying a node can re-enter QML. If aPwObjectTrackeris bound to that node list, it refs the next node, which tries to bind against the registry that's already gone. That'spw_registry_bind(NULL, ...), and it crashes.I hit this on 0.3.2 whenever my dock reconnected. The shell went down and didn't come back without a reboot.
Details and descisions
registryBind()returns false and skips the bind when the registry proxy is null. Skipping is fine because the node is destroyed later in the samereset(). It also returns false ifpw_registry_binditself fails, sobind()doesn't run hooks on a null object.Repro: run a private PipeWire server with a few null sinks and a shell with
PwObjectTracker { objects: Pipewire.nodes.values.slice(0, 1) }, then kill the server.-> Unpatched master crashed 30 of 50 runs.
-> With the patch, 0 of 50 crashed, and it rebinds normally when the server comes back.
Participation
Cheers,
Dante