Skip to content

CTF: fill an existing branch from the object passed now, not the first one - #16172

Open
ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16172
Open

ktf wants to merge 1 commit into
AliceO2Group:devfrom
ktf:pr16172

Conversation

@ktf

@ktf ktf commented Nov 22, 2026

Copy link
Copy Markdown
Member

EncodedBlocks::fillTreeBranch creates the branch with the address of the
object passed at the first call and later only calls Fill(), so every
later call fills from that first address. The callers pass a local of
their own stack frame, so later fills read a dead object: with one
thread the stale frame still happens to hold the data, but when the CTF
writer runs on another thread it crashes at the second time frame. Point
the branch at the current object before filling.

…t one

EncodedBlocks::fillTreeBranch creates the branch with the address of the
object passed at the first call and later only calls Fill(), so every
later call fills from that first address. The callers pass a local of
their own stack frame, so later fills read a dead object: with one
thread the stale frame still happens to hold the data, but when the CTF
writer runs on another thread it crashes at the second time frame. Point
the branch at the current object before filling.
@ktf
ktf requested a review from shahor02 as a code owner November 22, 2026 11:21
@ktf

ktf commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Needed for the upcoming multithreaded DPL...

@shahor02 shahor02 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK for this, but this does not prevent a race condition with multiple threads.

@ktf

ktf commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Yes, sure. This simply prevents using an object on a different stack to be used by another thread. Serialisation between writes is ensured elsewhere and I will open the full PR once I get the FST working. Then I would propose we go through a similar approach of what David and myself did for the Metal port, where we review commits one by one.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants