Skip to content

Conversation

@jmcarcell
Copy link
Member

@jmcarcell jmcarcell commented Sep 18, 2025

BEGINRELEASENOTES

  • Add ugly code to trigger an error when reading garbage

ENDRELEASENOTES

This prevents an infinite loop from happening and consuming all the memory. Tested on GCC 15 and Clang 20 with all the combinations of {Debug,RelWithDebInfo,Release} builds, in 5 out of 6 it triggers one of the errors and with GCC in Debug it crashes from ROOT.

I think that s is a random 64 bit number (or at least it was big one when I checked with gdb), so the probability of not triggering the error should 1e15/2**64=5e-5 if this is true.

To test, from the build directory: export ROOT_LIBRARY_PATH=$PWD/tests before #841 is merged.

Copy link
Collaborator

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

Is there a conceivable way to test that this truly triggers? Not sure how we would realistically get the garbage data, but maybe creating a faulty file with a slightly different EDM and then trying to read it similar as we do for the backwards compatibility tests?

@jmcarcell jmcarcell force-pushed the add-read-garbage-fix branch from 363ea4b to 281fa7f Compare October 13, 2025 19:46
@jmcarcell
Copy link
Member Author

I think the test is working now with either the exception or a crash. I'm not sure if this will hold in the future with newer compilers.

@jmcarcell jmcarcell force-pushed the add-read-garbage-fix branch from b64cd4a to b9c3887 Compare October 14, 2025 12:34
This prevents an infinite loop from happening and consuming all the memory.
Tested on GCC 15 and Clang 20 with all the combinations of
{Debug,RelWithDebInfo,Release} builds, in 5 out of 6 it triggers one of the
errors and with GCC in Debug it crashes from ROOT.
At least one happening with GCC < 15
@tmadlener tmadlener force-pushed the add-read-garbage-fix branch from b9c3887 to cdf0b09 Compare October 20, 2025 16:04
@tmadlener tmadlener enabled auto-merge (squash) October 20, 2025 16:57
@tmadlener tmadlener merged commit ff3de05 into AIDASoft:master Oct 20, 2025
27 of 28 checks passed
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