Skip to content

Conversation

@NWilson
Copy link
Member

@NWilson NWilson commented Oct 24, 2025

Fixes low-severity valgrind error reported in GHSA-q7rw-r7qq-2hx6.

Comment on lines -1811 to -1813
#ifdef SUPPORT_VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(data - 2, 2);
#endif
Copy link
Contributor

@carenas carenas Oct 24, 2025

Choose a reason for hiding this comment

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

even if the data is unconditionally initialized it should be made inaccessible for reads, since it is not valid, so this part of the code is still needed IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

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

On the other hand, the test then fails. The data can't be no-access, because the serialisation code reads it. But if it is uninitialised (for valgrind) then we can't use valgrind to assert that all the memory has been set.

That's a nasty trade off. I wonder if there's a way to benefit both ways...?

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically; the fact that the serialization code is reading it is a bug that was introduced when this feature was added in 10.45, and therefore we should fix that as well by making sure that when the code is serialized all holes are skipped instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or you could just define the holes as something and specify that they always contain zeros or some other value.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel we overcomplicate this. Just write any value there.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with Philip and Zoltan. My PR was just writing a value in. That's all we need.

@NWilson NWilson merged commit edc111a into master Oct 25, 2025
36 of 37 checks passed
@NWilson NWilson deleted the user/niwilson/valgrind-charlist-padding branch October 25, 2025 09:50
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.

5 participants