Skip to content
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] RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h #11735

Closed
davidlt opened this issue Oct 12, 2015 · 12 comments
Closed

[UBSAN] RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h #11735

davidlt opened this issue Oct 12, 2015 · 12 comments

Comments

@davidlt
Copy link
Contributor

davidlt commented Oct 12, 2015

Undefined behaviour was detected with GCC 4.9.3 with UBSAN:

10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:97:8
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:96:8
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:95:8
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:94:3
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:136:3
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:131:3
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:125:3
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:102:97
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:101:97
10 CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:100:97

These happens 10 times while running CMSSW.

This one is rather trivial: https://github.com/cms-sw/cmssw/blob/CMSSW_7_6_X/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h

It looks like fTimeSlew, fTimeSlewBias and fNegStrat are never set.

Example of issues:

RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:94:3: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:95:8: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:96:8: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:97:8: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:100:97: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:101:97: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:102:97: runtime error: load of value 81, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:136:3: runtime error: load of value 81, which is not a valid value for type 'NegStrategy'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:125:3: runtime error: load of value 81, which is not a valid value for type 'NegStrategy'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:131:3: runtime error: load of value 81, which is not a valid value for type 'NegStrategy'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:94:3: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:95:8: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:96:8: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:97:8: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:100:97: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:101:97: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:102:97: runtime error: load of value 78, which is not a valid value for type 'ParaSource'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:136:3: runtime error: load of value 78, which is not a valid value for type 'NegStrategy'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:131:3: runtime error: load of value 78, which is not a valid value for type 'NegStrategy'
RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:125:3: runtime error: load of value 78, which is not a valid value for type 'NegStrategy'

This happens in 140.53, 1000.0, 140.51, etc.

I guess, init(..) is not called and there are no defaults. Class contains user provided ctor, thus everything is default-initialized to indeterminate value.

@davidlt
Copy link
Contributor Author

davidlt commented Oct 12, 2015

@slava77

@davidlt
Copy link
Contributor Author

davidlt commented Oct 12, 2015

Stack trace:

#0  0x00007ffff355da30 in __ubsan::Diag::~Diag() () from /mnt/build/davidlt/asan/a/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/external/slc6_amd64_gcc493/lib/libCore.so
#1  0x00007ffff35545dd in __ubsan_handle_load_invalid_value () from /mnt/build/davidlt/asan/a/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/external/slc6_amd64_gcc493/lib/libCore.so
#2  0x00007fffbf6a6206 in HcalDeterministicFit::apply<HBHEDataFrame> (this=this@entry=0x7fff6c353d60, cs=..., capidvec=..., calibs=..., digi=..., Output=...)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h:100
#3  0x00007fffbf6a6b34 in HcalSimpleRecAlgoImpl::recoHBHE<HBHEDataFrame, HBHERecHit> (digi=..., coder=..., calibs=..., ifirst=<optimized out>, n=<optimized out>, slewCorrect=true, pulseCorrect=true, corr=0x7fff2130b810, slewFlavor=HcalTimeSlew::Medium, runnum=165121,
    useLeak=false, pileupCorrection=<optimized out>, bxInfo=0x200000002, lenInfo=4294967295, puCorrMethod=0, psFitOOTpuCorr=0x0, hltOOTpuCorr=0x7fff6c353d60, hltPedSub=0x7fff6c703690)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc:492
#4  0x00007fffbf69af1e in HcalSimpleRecAlgo::reconstruct (this=this@entry=0x7fffe3de6f50, digi=..., first=first@entry=0, toadd=toadd@entry=4, coder=..., calibs=...)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc:539
#5  0x00007fffa12b1ddb in HcalSimpleReconstructor::process<edm::SortedCollection<HBHEDataFrame, edm::StrictWeakOrdering<HBHEDataFrame> >, edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit> > > (this=this@entry=0x7fffe3de6e80, e=..., eventSetup=...,
    tok=...) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc:133
#6  0x00007fffa12aeaaa in HcalSimpleReconstructor::produce (this=0x7fffe3de6e80, e=..., eventSetup=...) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc:236
#7  0x00007ffff790e051 in edm::stream::EDProducerAdaptorBase::doEvent (this=<optimized out>, ep=..., c=..., act=<optimized out>, mcc=mcc@entry=0x7fff6aff9bc0)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/stream/EDProducerAdaptorBase.cc:57
#8  0x00007ffff78e79a5 in edm::WorkerT<edm::stream::EDProducerAdaptorBase>::implDo (this=0x7fff6aff9ba0, ep=..., c=..., mcc=0x7fff6aff9bc0) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/WorkerT.cc:120
#9  0x00007ffff7694446 in call (mcc=<optimized out>, es=..., ep=..., iWorker=0x7fff6aff9ba0) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Worker.h:289
#10 operator() (__closure=0x7fffffff2570) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Worker.h:498
#11 edm::convertException::wrap<bool edm::Worker::doWork<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::MyPrincipal&, edm::EventSetup const&, edm::StreamID, edm::ParentContext co
nst&, edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::Context const*)::{lambda()#1}>(bool edm::Worker::doWork<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>:
:MyPrincipal&, edm::EventSetup const&, edm::StreamID, edm::ParentContext const&, edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::Context const*)::{lambda()#1}) (iFunc=...)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Utilities/interface/ConvertException.h:20
#12 0x00007ffff7694c71 in edm::Worker::doWork<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (this=0x7fff6aff9ba0, ep=..., es=..., streamID=..., parentContext=..., context=0x7fffb1cb9da8)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Worker.h:474
#13 0x00007ffff78cba08 in edm::UnscheduledCallProducer::tryToFillImpl (this=<optimized out>, moduleLabel=..., event=..., eventSetup=..., mcc=<optimized out>)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/interface/UnscheduledCallProducer.h:84
#14 0x00007ffff765e677 in operator() (__closure=0x7fffffff2960) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/EventPrincipal.cc:498
#15 edm::EventPrincipal::unscheduledFill (this=<optimized out>, moduleLabel=..., sra=0x0, mcc=0x7fff6b1bf080) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/EventPrincipal.cc:503
#16 0x00007ffff77abca7 in edm::UnscheduledProductHolder::resolveProduct_ (this=0x7fff6075c970, resolveStatus=@0x7fffffff2bac: edm::ProductHolderBase::ProductNotFound, skipCurrentProcess=<optimized out>, sra=0x0, mcc=0x7fff6b1bf080)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/ProductHolder.cc:107
#17 0x00007ffff7787040 in resolveProduct (mcc=<optimized out>, sra=0x0, skipCurrentProcess=false, resolveStatus=@0x7fffffff2bac: edm::ProductHolderBase::ProductNotFound, this=0x7fff6075c970)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/interface/ProductHolder.h:53
#18 edm::Principal::prefetch (this=<optimized out>, index=index@entry=348, skipCurrentProcess=<optimized out>, mcc=<optimized out>) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Principal.cc:535
#19 0x00007ffff76943e2 in operator() (__closure=0x7fffffff2c50) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Worker.h:492
#20 edm::convertException::wrap<bool edm::Worker::doWork<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::MyPrincipal&, edm::EventSetup const&, edm::StreamID, edm::ParentContext co
nst&, edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::Context const*)::{lambda()#1}>(bool edm::Worker::doWork<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>:
:MyPrincipal&, edm::EventSetup const&, edm::StreamID, edm::ParentContext const&, edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::Context const*)::{lambda()#1}) (iFunc=...)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Utilities/interface/ConvertException.h:20
#21 0x00007ffff7694c71 in edm::Worker::doWork<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (this=0x7fff6b1bf060, ep=..., es=..., streamID=..., parentContext=..., context=context@entry=0x7fffb1cb9da8)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Worker.h:474
#22 0x00007ffff76a2004 in runWorker<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (context=0x7fffb1cb9da8, streamID=..., es=..., ep=..., this=0x7fff6b216dc0)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/WorkerInPath.h:76
#23 operator() (__closure=0x7fffffff2da0) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Path.h:175
#24 edm::convertException::wrap<void edm::Path::processOneOccurrence<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::MyPrincipal&, edm::EventSetup const&, edm::StreamID const&, ed
m::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::Context const*)::{lambda()#1}>(void edm::Path::processOneOccurrence<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType
)1>::MyPrincipal&, edm::EventSetup const&, edm::StreamID const&, edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::Context const*)::{lambda()#1}) (iFunc=...)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Utilities/interface/ConvertException.h:20
#25 0x00007ffff76a2587 in edm::Path::processOneOccurrence<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (this=0x7fff6b238910, ep=..., es=..., streamID=..., context=context@entry=0x7fffb1cb9da8)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/Path.h:173
#26 0x00007ffff76a2fd1 in runEndPaths<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (context=0x7fffb1cb9da8, es=..., ep=..., this=0x7fffb1cb9c10)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/StreamSchedule.h:487
#27 void edm::StreamSchedule::processOneEvent<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::MyPrincipal&, edm::EventSetup const&, bool)::{lambda()#1}::operator()() const (
    __closure=0x7fffffff32b0) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/StreamSchedule.h:419
#28 0x00007ffff76a3632 in edm::convertException::wrap<void edm::StreamSchedule::processOneEvent<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::MyPrincipal&, edm::EventSetup const
&, bool)::{lambda()#1}>(void edm::StreamSchedule::processOneEvent<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> >(edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1>::MyPrincipal&, edm::EventSetup const&, bool)::{lambda()#1}) (
    iFunc=...) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Utilities/interface/ConvertException.h:20
#29 0x00007ffff76a39db in edm::StreamSchedule::processOneEvent<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (this=0x7fffb1cb9c10, ep=..., es=..., cleaningUpAfterException=cleaningUpAfterException@entry=false)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/StreamSchedule.h:388
#30 0x00007ffff7686d98 in processOneEvent<edm::OccurrenceTraits<edm::EventPrincipal, (edm::BranchActionType)1> > (cleaningUpAfterException=false, es=..., ep=..., iStreamID=0, this=<optimized out>)
    at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/interface/Schedule.h:296
#31 edm::EventProcessor::processEvent (this=this@entry=0x7fffe34a6300, iStreamIndex=iStreamIndex@entry=0) at /opt/cmssw/slc6_amd64_gcc493/cms/cmssw/CMSSW_7_6_UBSAN_X_2015-10-09-1100/src/FWCore/Framework/src/EventProcessor.cc:2011

Most of it happens on 1st event. It happens once on 4th event. I used 1000.0 step2.

@davidlt
Copy link
Contributor Author

davidlt commented Oct 12, 2015

diff --git a/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h b/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h
index acbbf7f..f876f9f 100644
--- a/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h
+++ b/RecoLocalCalo/HcalRecAlgos/interface/HcalDeterministicFit.h
@@ -30,6 +30,7 @@ class HcalDeterministicFit {
   HcalTimeSlew::BiasSetting fTimeSlewBias;
   NegStrategy fNegStrat;
   PedestalSub fPedestalSubFxn_;
+  bool inited=false;

   double fpars[9];
   double frespCorr;
@@ -57,6 +58,11 @@ class HcalDeterministicFit {

 template<class Digi>
 void HcalDeterministicFit::apply(const CaloSamples & cs, const std::vector<int> & capidvec, const HcalCalibrations & calibs, const Digi & digi, std::vector<double> & Output) const {
+  if (!inited) {
+    std::cerr << "NOT_INIT" << std::endl;
+    std::terminate();
+  }
+
   std::vector<double> corrCharge;
   std::vector<double> inputCharge;
   std::vector<double> inputPedestal;
diff --git a/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc b/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc
index 8e14aa3..7409e9d 100644
--- a/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc
+++ b/RecoLocalCalo/HcalRecAlgos/src/HcalDeterministicFit.cc
@@ -17,6 +17,7 @@ HcalDeterministicFit::~HcalDeterministicFit() {
 }

 void HcalDeterministicFit::init(HcalTimeSlew::ParaSource tsParam, HcalTimeSlew::BiasSetting bias, NegStrategy nStrat, PedestalSub pedSubFxn_, std::vector<double> pars, double respCorr) {
+  inited=true;
   for(int fi=0; fi<9; fi++){
        fpars[fi] = pars.at(fi);
   }

It's not initialised. Protected should be added against such case.

@slava77
Copy link
Contributor

slava77 commented Oct 12, 2015

Interesting.

  • hbheprereco is HcalHitReconstructor comes in the regular reconstruction path
  • hbherecoNoise is HcalSimpleReconstructor comes from seqALCARECOHcalCalMinBias

@lihux25 @igv4321
Please update HcalSimpleReconstructor either the setMeth3Params is always called, or the method3 is not called itself.

@davidlt
Copy link
Contributor Author

davidlt commented Oct 13, 2015

@slava77 Could we also add a protection in HcalDeterministicFit to make it stops a workflow if such thing happens? In that case it's easy to catch if it happens again.

@slava77
Copy link
Contributor

slava77 commented Oct 13, 2015

@davidlt I agree, it makes sense to detect failure in configuration.
The implementation will have to use cms::Exception (no cerr or std::terminate allowed)

@davidlt
Copy link
Contributor Author

davidlt commented Oct 13, 2015

Agreed, the above patch was only used as a quick check.

@davidlt
Copy link
Contributor Author

davidlt commented Oct 13, 2015

I can test any patches before merging with UBSAN, just ping me.

@igv4321
Copy link
Contributor

igv4321 commented Oct 13, 2015

Should be fixed in PR #11769

@davidlt
Copy link
Contributor Author

davidlt commented Oct 14, 2015

@slava77 should I check PR with UBSan? The PR does not add protection to HcalDeterministicFit. There are two options:

  • Keep HcalDeterministicFit as-is and document that init must be called. In this case we gonna need keep running run-time checkers to validate that this issues does not happen.
  • Modify HcalDeterministicFit to make sure that this issue can never happen.

@slava77
Copy link
Contributor

slava77 commented Oct 14, 2015

I think we should move the init call to the constructor and possibly cleanup the initialization.

Since setMeth3Params is now mandatory, it makes more sense to move its functionality to
the constructor of HcalSimpleRecAlgo.
The PedestalSub::init and HcalDeterministicFit::init could be eliminated and the default constructors deleted.
If additional reinitialization is desired, the ::init methods could stay, but default constructors should go.
e.g. slava77@62449ed

@igv4321
Igor, please confirm if it makes sense and if you can complete it
(IBs are still broken, so, the full integration with jenkins will be delayed for these technical reasons)

Thank you

@davidlt
Copy link
Contributor Author

davidlt commented Oct 27, 2015

Closing. Issue seems to be resolved.

@davidlt davidlt closed this as completed Oct 27, 2015
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

No branches or pull requests

3 participants