Skip to content

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

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

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

Conversation

@larsewi

@larsewi larsewi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Backported from #6332

@larsewi
larsewi force-pushed the simulate-pkg-mapremove-3.27.x branch from f06963e to 46e3231 Compare September 2, 2026 11:51
@larsewi

larsewi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@cf-bottom Jenkins please :)

@cf-bottom

Copy link
Copy Markdown

…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.27.x branch from 46e3231 to 29b2e49 Compare September 2, 2026 11:56
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