logSelection.cpp : too high tag values show up in some jtreg tests
Baesken, Matthias
matthias.baesken at sap.com
Wed Sep 25 13:38:54 UTC 2024
Hi Stefan, not sure if this is the cause of the issue. If I add a check with a guarantee and build/run without ubsan
@@ -46,6 +46,9 @@ bool LogSelectionList::verify_selections(outputStream* out) const {
_selections[i].describe_tags_on(out);
out->print(". ");
+ // added - check that the array entries are okay
+ _selections[i].check_for_bad_tag_array(i, out);
+
_selections[i].suggest_similar_matching(out);
I see the large tag entry values too.
But initializing the whole _tags array seems to make sense.
What value should we write to the entries ?
And any idea why the initialization was not done for some ?
Best regards, Matthias
>
>Isn't the problem that the LogSelection constructor doesn't initialize all elements (Only elements that are __NO_TAG gets initialized):
>```
>LogSelection::LogSelection(const LogTagType tags[LogTag::MaxTags], bool wildcard, LogLevelType level)
> : _ntags(0), _wildcard(wildcard), _level(level), _tag_sets_selected(0) {
> while (_ntags < LogTag::MaxTags && tags[_ntags] != LogTag::__NO_TAG) {
> _tags[_ntags] = tags[_ntags];
> _ntags++;
> }
>```
>
>And then later when the code copies LogTagType arrays, it hits this ubsan warning when it reads the uninitialized value.. It looks like this could be fixed by always fully initializing _tags memory.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-runtime-dev/attachments/20240925/9364dc3c/attachment.htm>
More information about the hotspot-runtime-dev
mailing list