Skip to content

Fix a couple of Coverity false positives for INCOMPLETE_DEALLOCATOR#4103

Open
nrwahl2 wants to merge 14 commits intoClusterLabs:mainfrom
nrwahl2:nrwahl2-coverity
Open

Fix a couple of Coverity false positives for INCOMPLETE_DEALLOCATOR#4103
nrwahl2 wants to merge 14 commits intoClusterLabs:mainfrom
nrwahl2:nrwahl2-coverity

Conversation

@nrwahl2
Copy link
Copy Markdown
Contributor

@nrwahl2 nrwahl2 commented May 5, 2026

This fixes INCOMPLETE_DEALLOCATOR false positives for mainloop_gio_destroy() and another one that I don't recall. It also fixes a longstanding const fields issue with lrmd_event_data_t.

nrwahl2 added 13 commits May 4, 2026 17:20
annotations-warnings.txt in the coverity-TAG/output directory says these
four annotations are unused.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
qb_ipcc_is_connected() returns QB_FALSE for a NULL argument.
pcmk__ipc_free_client_buffer() does nothing when its argument's buffer
field is NULL.

Also remove a layer of nesting.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Commit 4facb96 introduced much of this complexity. The commit message
says "Make mainloop_gio_destroy() tollerant of being called
re-entrantly". However, there seems to be no way this could happen.
Pacemaker is single-threaded, and the destroy_fn can't return control
back to the main loop. Control returns to the main loop when
mainloop_gio_destroy() returns.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
...where appropriate.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
lrmd_new_event() allocates memory for rsc_id and op_type.

lrmd_copy_event() allocates memory for rsc_id, op_type, user_data,
output, remote_nodename, and exit_reason.

lrmd_dispatch_internal() allocates memory for output and exit_reason,
but prior to this commit it used strings belonging to other objects for
rsc_id, op_type, user_data, and remote_nodename.

lrmd_free_event() frees all six fields.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
This should have been done in commit e09bc86.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
@nrwahl2 nrwahl2 requested a review from clumens May 5, 2026 18:53
g_clear_pointer() is triggering these warnings. When we require GLib
2.58 or later, we can probably re-enable the warning.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
clumens
clumens previously approved these changes May 5, 2026
Comment thread lib/lrmd/lrmd_client.c
@clumens
Copy link
Copy Markdown
Contributor

clumens commented May 5, 2026

Man, coverity's being picky right now.

@nrwahl2
Copy link
Copy Markdown
Contributor Author

nrwahl2 commented May 5, 2026

Man, coverity's being picky right now.

Yeah, and the new errors are actually ones that I dropped in the "Drop unused Coverity annotations" commit. The analysis output said those were unused. And at the time, when I re-ran Coverity, the errors did not reappear. Now they do.

@clumens clumens self-requested a review May 5, 2026 21:23
@clumens clumens dismissed their stale review May 5, 2026 21:23

New coverity things to look at

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants