Skip to content

qa/valgrind: generalize suppressions for gcc-14 MismatchedFree - #68289

Merged
cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-75945
Apr 16, 2026
Merged

cbodley merged 2 commits into
ceph:mainfrom
cbodley:wip-75945

Conversation

@cbodley

@cbodley cbodley commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

the rgw suite is showing a handful of these false positives, and i really don't want to micromanage suppressions for every little thing that shows up here

so i chose to generalize the existing suppressions from https://tracker.ceph.com/issues/74604 so that a single suppression would cover this entire class of MismatchedFree warnings

Fixes: https://tracker.ceph.com/issues/75945

Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

the rgw suite is showing a handful of these false positives, and i
really don't want to micromanage suppressions for every little thing
that shows up here

so i chose to generalize the existing suppressions from
https://tracker.ceph.com/issues/74604 so that a single suppression would
cover this entire class of MismatchedFree warnings

Fixes: https://tracker.ceph.com/issues/75945

Signed-off-by: Casey Bodley <[email protected]>
@github-actions github-actions Bot added the tests label Apr 9, 2026
@cbodley

cbodley commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley
cbodley marked this pull request as ready for review April 9, 2026 21:06
@cbodley
cbodley requested review from a team, NitzanMordhai and rzarzynski April 9, 2026 21:09
@chardan

chardan commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

This LGTM. And I got to learn about the leak suppression system!

Comment thread qa/valgrind.supp Outdated
rocky10_gcc14_mismatch_delete_map_erase
rocky10_gcc14_mismatch_delete
Memcheck:Free
fun:_Zda*align_val_t*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Between

{
   <allthefrees, so we can behave with tcmalloc>
   Memcheck:Free
   fun:free
   ...
}

which suppresses all free() instances,

{
   co_compose bug manifesting under Ubuntu only
   Memcheck:Free
   fun:_ZdaPvm
   ...
}

which suppresses all operator delete[](void*, unsigned long) instances and this one which suppresses all operator delete[] instances with align_val_t in the parameter list, is there anything meaningful left? Plain delete?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there anything meaningful left? Plain delete?

i suppose not. according to @NitzanMordhai from #67230, we don't even have a separate symbol for aligned delete anymore:

Standard library containers (like std::map) correctly call delete, but Valgrind falsely interprets this as a call to delete[] because GCC 14 folds the identical aligned delete operators into a single symbol. This causes Valgrind to flag a mismatch against the non-array allocation.

if we're getting false positives just from using standard library containers, i don't want to keep adding more suppressions every time this shows up under a new call stack

by turning this into a blanket suppression, we unfortunately lose the ability to catch real MismatchedFree issues in our code. that's why i tagged everyone for review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Valgrind recommends building tcmalloc with -DTCMALLOC_NO_ALIASES and disabling identical code folding when linking for test builds.

What I was getting at is perhaps all of those suppressions could be merged into a single one, simply ignoring all Memcheck:Free reports? I suppose it would be equivalent to invoking Valgrind with --show-mismatched-frees=no option.

@cbodley cbodley Apr 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this updated suppression failed qa with

==00:00:00:00.084 19744== FATAL: in suppressions file "/home/ubuntu/cephtest/valgrind.supp" near line 6:
==00:00:00:00.084 19744== suppression must contain at least one location line which is not "..."

i think this means we'll still need separate suppressions for fun:free fun:_ZdaPvm and fun:_Zda*align_val_t*

@idryomov idryomov Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think _Zda and _Zda*align_val_t* can be merged into _Zda* -- both are variants of operator delete[], but it's a really minor nit. I didn't realize Valgrind is this

suppression must contain at least one location line which is not "..."

picky.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, simplified to fun:free and fun:_Zda*

@yuvalif

yuvalif commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

in rocky10.1 runs i see a lot of these failures:

valgrind error: MismatchedFree
operator delete[](void*, unsigned long, std::align_val_t)
rgw::sal::RadosStore::meta_list_keys_complete(void*)
RGWOwnerStatsCache::sync_all_owners(DoutPrefixProvider const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)

should these also be supressed?

@cbodley

cbodley commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

should these also be supressed?

@yuvalif yes, this pr suppresses that MismatchedFree error tracked in https://tracker.ceph.com/issues/75945. in the meantime, feel free to include this commit in your qa runs

@idryomov

Copy link
Copy Markdown
Contributor

jenkins test api

@BBoozmen BBoozmen added the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Apr 15, 2026
combine the various MismatchedFree suppressions into unconditional ones
for each function

Signed-off-by: Casey Bodley <[email protected]>
Comment thread qa/valgrind.supp Resolved
@cbodley
cbodley merged commit 7a6816d into ceph:main Apr 16, 2026
6 checks passed
@cbodley

cbodley commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

fyi @NitzanMordhai i did a tentacle backport of this and two of your prs in #68431

@BBoozmen BBoozmen removed the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants