Skip to content

Fix OOB access in case the ROF bin has no tracks#15345

Open
ktf wants to merge 1 commit intoAliceO2Group:devfrom
ktf:pr15345
Open

Fix OOB access in case the ROF bin has no tracks#15345
ktf wants to merge 1 commit intoAliceO2Group:devfrom
ktf:pr15345

Conversation

@ktf
Copy link
Copy Markdown
Member

@ktf ktf commented Apr 30, 2026

No description provided.

@ktf ktf requested review from davidrohr and sgorbuno as code owners April 30, 2026 10:24
for (int is = 0; is < 3; is++) {
nextDynOffs = FlatObject::alignSize(nextDynOffs, SplineType::getParameterAlignmentBytes());
nextDynOffs += origCorr.mSectorDataSizeBytes[is] * TPCFastTransformGeo::getNumberOfSectors();
nextDynOffs += FlatObject::alignSize(origCorr.mSectorDataSizeBytes[is], SplineType::getParameterAlignmentBytes()) * TPCFastTransformGeo::getNumberOfSectors();
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.

Are you sure this is needed?
TPCFastSpaceChargeCorrection::FinishConstruction ends with

mSectorDataSizeBytes[is] = alignSize(mSectorDataSizeBytes[is], SplineType::getParameterAlignmentBytes());

So this should already be aligned correctly. Did you check that it happens that this size comes in as not a multiple of the alignment? If yes, I'd check why that happens instead of changing it here.

Actually, do we have a way to reproduce it and fix it properly? And I am also a bit puzzled why this triggers an alignment issue on ARM, but I do not see anything in the sanitizers on x86. Alignment requirements on the language level should be the same.

@ktf ktf requested a review from shahor02 as a code owner April 30, 2026 21:02
@ktf ktf changed the title More alignment issues Fix OOB access in case the ROF bin has no tracks May 4, 2026
@ktf
Copy link
Copy Markdown
Member Author

ktf commented May 4, 2026

After a little bit more debugging, it looks like for some reason we have:

[9711:itstpc-track-matcher]: [10:18:03][ALARM] doMatching sec=15 nTPC=14 nITS=43 idxMinTPC=0 mTPCWork.size=230 mITSWork.size=751
[9711:itstpc-track-matcher]: [10:18:03][ALARM] OOB ITS: iits=-10 cacheITS[iits]=2048175687 mITSWork.size=751

in doMatching. This is the new tentative fix. @davidrohr @shahor02

@shahor02
Copy link
Copy Markdown
Collaborator

shahor02 commented May 4, 2026

timeStartITS should not be negative, there should be some other problem. Was this happening in the FST?

@ktf
Copy link
Copy Markdown
Member Author

ktf commented May 4, 2026

Was this happening in the FST?

Yes. I have updated the PR with some extra debug information.

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.

3 participants