Skip to content

Comments

io: Correct handling of byte count pos in TBufferFile::ReadObjectAny#21192

Open
pcanal wants to merge 16 commits intoroot-project:Arlesiennefrom
pcanal:Arlesienne_ByteCount
Open

io: Correct handling of byte count pos in TBufferFile::ReadObjectAny#21192
pcanal wants to merge 16 commits intoroot-project:Arlesiennefrom
pcanal:Arlesienne_ByteCount

Conversation

@pcanal
Copy link
Member

@pcanal pcanal commented Feb 8, 2026

This is a missing commit for #21183 which was merge a bit too soon.

@pcanal pcanal requested a review from jblomer February 8, 2026 16:48
@pcanal pcanal self-assigned this Feb 8, 2026
@pcanal
Copy link
Member Author

pcanal commented Feb 8, 2026

Note that 588b29e was also not reviewed.

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Test Results

    21 files  ± 0      21 suites  ±0   3d 1h 52m 4s ⏱️ - 10h 31m 34s
 3 778 tests + 1   3 770 ✅ +   42    0 💤  -   1  8 ❌  -  40 
72 382 runs  +73  72 253 ✅ +1 084  121 💤  - 134  8 ❌  - 877 

For more details on these failures, see this check.

Results for commit 733ac65. ± Comparison against base commit 588b29e.

♻️ This comment has been updated with latest results.

@ferdymercury
Copy link
Collaborator

Closing #20498 since it seems this is an alternative / better approach

This fixes TBufferFile::ReadObjectAny handling of long range byte counts
Those were essentially replaced by a 'set the cursor to the end'
call in commit 7d25b75.
It is dubious whether these changes are needed or were an heurestic
to ignore (temporarily !?) race conditions.
Due to the need for using a stack of bytecount position, we can no longer support redundant
calls to CheckByteCount.
@pcanal pcanal force-pushed the Arlesienne_ByteCount branch from 1ca66ec to 33e27a1 Compare February 17, 2026 18:33
@pcanal pcanal requested a review from linev as a code owner February 17, 2026 18:33
This simplify the implementation of calling `ReserveByteCount`
and then `SetByteCount` and could also simplify removing the
use of the ByteCountStack in some/most cases.

Note: `ReserveByteCount` is protected and the existing code
that does the same semantic action was only recording the position
in a 32 bits integer.  That code needs to be updated by either
making `ReserverByteCount` public (making removal of external use
of the ByteCountStack more difficult) or by introducing a RAII
that hides the size of the integer.
In order to allow using the roottest CMake macro outside of the roottest sub-directory,
we need to make the variable used by those macros 'cache variable' so that they can use
elsewhere.

This is a hack and works only after the second CMake configuration/invocation.
@pcanal
Copy link
Member Author

pcanal commented Feb 18, 2026

@jblomer This is ready for a final review. Note that the last commit (733ac65) is not really part of this PR but is necessary to make the test work as is (That last commit will be replaced on the master by a more general solution).

When using the Microsoft Visual Studio generator we have the exact same problem,
that it might trigger a rebuild of ROOT so we need to apply the same solution.

See 06e00a2.

PS. We might want to eventually rename the resource lock.
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.

3 participants