masks: don't let mask manager rows hand out stale module pointers - #22055
Draft
da-phil wants to merge 1 commit into
Draft
Conversation
da-phil
force-pushed
the
pl/prevent_mask_manager_from_handing_out_stale_module_pointers
branch
from
August 29, 2026 19:49
48974d6 to
1c65474
Compare
1 task
Member
|
Since mask manager will be removed in 5.8 and replaced by the new flexi masking maybe this is just not necessary. |
Contributor
Author
|
I guess it also depends if that gets into the way of the flexi masking development, like constantly producing merge conflicts. If not, I don't see why we should not make sure existing bugs are fixed until the module can be fully replaced by a new one. What do you think about that? |
da-phil
force-pushed
the
pl/prevent_mask_manager_from_handing_out_stale_module_pointers
branch
from
September 1, 2026 22:40
1c65474 to
4b70837
Compare
Tree rows cache raw dt_iop_module_t pointers but outlive the modules, which are freed on instance delete, image change and darkroom leave. Selecting a group row then called flags() through a dangling pointer, and deleting a shape crashed in dt_iop_is_hidden(). - _lib_masks_get_values(): only return a module still present in dev->iop; NULL attributes the edit to the mask manager - _forms_structure_hash(): include the modules and their mask ids so a changed module set forces a rebuild - invalidate the cached hash on image change and darkroom entry: the allocator may hand back the freed addresses and hash identical - gui_update(): drop a pending selection module that died before the deferred update ran - _tree_delete_shape(): stop clobbering the row's module with the one of the previous row
da-phil
force-pushed
the
pl/prevent_mask_manager_from_handing_out_stale_module_pointers
branch
from
September 1, 2026 22:42
4b70837 to
b4b1e63
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.
masks: don't let mask manager rows hand out stale module pointers
Tree rows cache raw dt_iop_module_t pointers but outlive the modules,
which are freed on instance delete, image change and darkroom leave.
Selecting a group row then called flags() through a dangling pointer,
and deleting a shape crashed in dt_iop_is_hidden().
dev->iop; NULL attributes the edit to the mask manager
changed module set forces a rebuild
allocator may hand back the freed addresses and hash identical
deferred update ran
the previous row
Speculatively fixes #22050
Disclaimer: this change was co-created with Claude.