sn-item: Fix error handling to address SIGSEGV (cherry-pick 2212d1c9f to 3.2-maintenance) - #214
Open
climashscape wants to merge 1 commit into
Open
Conversation
(cherry picked from commit 2212d1c)
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.
Cherry-picks
2212d1c9f("sn-item: Fix error handling to address SIGSEGV (#201)", merged tomaster2026-05-21) into3.2-maintenance.Why
3.2-maintenancepicked up the rest of that series but not this commit:a24316cc7("Address status notifier items by their registered bus name") and
d383f461d("Fix dbus invocation return value") are both present, while
sn-item.cthere has nog_cancellable_cancel. The 3.2.3 release package therefore still ships theuse-after-free.
Symptom
On Mint 22 (zena),
libxapp1 3.2.3+zena,xapp-sn-watchercrashed twice in 26 hourswith an identical signature:
xapp-sn-watcher + 0x1036fis theg_critical()atsn-item.c:748:get_all_properties_callback()takesitemfromuser_datawithout holding areference, and
sn_item_dispose()does not cancel the in-flightGetAllcall — so ifthe item is disposed while the request is pending, the error path dereferences the freed
sn_item_proxy.Impact
The item registry is in-memory only, so each crash empties it. Clients that watch the
watcher's bus name re-register themselves within seconds; clients that do not lose their
tray icon until the app is restarted. Reproduced here with Flathub QQ Music 1.1.8
(Electron 8.2.1 / Chrome 80), which stayed gone after both crashes while WeChat,
Obsidian, ComfyUI and clash-verge all recovered on their own.
Verification
3.2-maintenance, no conflicts.sn-item.conly).compiles and links clean against the 3.2.x headers and system libraries.