Skip to content

CFE-4742: Fixed simulate mode reporting both removal and install of the same package (3.24.x) - #6339

Open
larsewi wants to merge 1 commit into
cfengine:3.24.xfrom
larsewi:simulate-pkg-mapremove-3.24.x
Open

CFE-4742: Fixed simulate mode reporting both removal and install of the same package (3.24.x)#6339
larsewi wants to merge 1 commit into
cfengine:3.24.xfrom
larsewi:simulate-pkg-mapremove-3.24.x

Conversation

@larsewi

@larsewi larsewi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Backported from #6332

@larsewi

larsewi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins with exotics please :)

…ckage

In DiffPkgOperations() and ManifestPkgOperations(), inserting an install
message into the installed/present map set name_arch to NULL because the
map took ownership of it as a key. The MapRemove() call that cancels a
previous removal message ran after that, so it looked up a NULL key and
matched nothing. The cancellation was silently skipped exactly when an
install message had been inserted: a package recorded as removed and
then installed was reported as both removed and installed. In debug
builds a NULL key also fails an assertion in StringHash() once the map
outgrows the array-map stage.

Moved the cancellation above the code that hands name_arch to the map.

Changelog: Title
Ticket: CFE-4742

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Lars Erik Wik <53906608+larsewi@users.noreply.github.com>
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
(cherry picked from commit 5ddb6d9)
(cherry picked from commit 17dd60d)
@larsewi
larsewi force-pushed the simulate-pkg-mapremove-3.24.x branch from 5fe7efe to 6e3bbf1 Compare September 2, 2026 11:55
@cf-bottom

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants