Skip to content

Commit c84eada

Browse files
committed
Fix OOB access in case the ROF bin has no tracks
1 parent a43e1f5 commit c84eada

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Detectors/GlobalTracking/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ o2_add_library(GlobalTracking
5555
O2::Steer
5656
$<$<BOOL:${ENABLE_UPGRADES}>:O2::ITS3Reconstruction>)
5757

58+
target_compile_options(${targetName} PRIVATE -fsanitize=address -fno-omit-frame-pointer)
59+
target_link_options(${targetName} PRIVATE -fsanitize=address)
60+
5861
o2_target_root_dictionary(GlobalTracking
5962
HEADERS include/GlobalTracking/MatchTPCITSParams.h
6063
include/GlobalTracking/MatchGlobalFwd.h

Detectors/GlobalTracking/src/MatchTPCITS.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,6 @@ void MatchTPCITS::doMatching(int sec)
880880
int idxMinTPC = timeStartTPC[minROFITS]; // index of 1st cached TPC track within cached ITS ROFrames
881881
auto t2nbs = tpcTimeBin2MUS(mZ2TPCBin * mParams->tpcTimeICMatchingNSigma);
882882
bool checkInteractionCandidates = mUseFT0 && mParams->validateMatchByFIT != MatchTPCITSParams::Disable;
883-
884883
int itsROBin = 0;
885884
for (int itpc = idxMinTPC; itpc < nTracksTPC; itpc++) {
886885
auto& trefTPC = mTPCWork[cacheTPC[itpc]];
@@ -893,6 +892,11 @@ void MatchTPCITS::doMatching(int sec)
893892
break;
894893
}
895894
int iits0 = timeStartITS[itsROBin];
895+
if (iits0 < 0) {
896+
LOGP(alarm, "doMatching sec={} itpc={} itsROBin={} timeStartITS.size={} iits0={} tmn={} triggered={}",
897+
sec, itpc, itsROBin, timeStartITS.size(), iits0, tmn, mITSTriggered);
898+
continue; // no ITS tracks start at this ROF bin
899+
}
896900
nCheckTPCControl++;
897901
for (auto iits = iits0; iits < nTracksITS; iits++) {
898902
auto& trefITS = mITSWork[cacheITS[iits]];

Detectors/GlobalTrackingWorkflow/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
# FIXME: do we actually need a library here, or is the executable enough ?
1313

14-
#add_compile_options(-O0 -g -fPIC -fno-omit-frame-pointer)
14+
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
15+
add_link_options(-fsanitize=address)
1516

1617
o2_add_library(GlobalTrackingWorkflow
1718
SOURCES src/TrackWriterTPCITSSpec.cxx

0 commit comments

Comments
 (0)