-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UBSAN][L1] Fix read out of bounds issue #46372
Conversation
cms-bot internal usage |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46372/42213 Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
6f1116c
to
5fa788a
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46372/42215 |
A new Pull Request was created by @smuzaffar for master. It involves the following packages:
@Moanwar, @aloeliger, @cmsbuild, @epalencia, @srimanob, @subirsarkar can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
test parameters:
|
please test for CMSSW_14_2_UBSAN_X |
+1 Size: This PR adds an extra 24KB to repository Comparison SummarySummary:
|
@cms-sw/l1-l2 , can you please review this PR ? |
Some of this goes beyond my ability to comment on. @skkwan Could you please take a look at this and comment on these changes? |
Hi @smuzaffar, thanks for raising this issue and thanks Andrew for the tag. The out-of-bounds error can be resolved by increasing the temp array size and I'm happy to open a PR with just a few changes to fix it, if that's OK with you and @aloeliger. The reasoning for the +7 index in Regarding the |
thanks @skkwan for looking in to it. Feel free to open a PR to apply the changes you feel necessary to avoid the out of bound issue |
Hi @smuzaffar, @aloeliger, I've opened PR #46472 regarding the out-of-bounds. I've checked that it doesn't affect the original outputs, but please let me know if this solves the error in your tests. Thanks. |
closing this in favor of #46472 |
This should fix the UBSAN error like [a]. There are few issues with this code
ap_uint<12> temp[p2eg::CRYSTAL_IN_ETA + 2][p2eg::CRYSTAL_IN_PHI + 4];
but then assign value totemp[CRYSTAL_IN_ETA + 1][CRYSTAL_IN_PHI + 7]
.seed eta and phi
so I think there is no need to loop over every itemseed eta and phi
+ some offset. So we do not need to allocatetemp[p2eg::CRYSTAL_IN_ETA + 2][p2eg::CRYSTAL_IN_PHI + 4];
a smaller memory just to hold the values forseed eta and phi
+ some offset should be enough.I am opening this PR but would like @cms-sw/l1-l2 to review this code and may be propose a batter change
[a] https://cmssdt.cern.ch/SDT/cgi-bin/buildlogs/raw/el8_amd64_gcc12/CMSSW_14_2_UBSAN_X_2024-10-11-2300/pyRelValMatrixLogs/run/23634.0_TTbar_14TeV+2026D95/step2_TTbar_14TeV+2026D95.log