Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions FWCore/Framework/interface/global/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "FWCore/Utilities/interface/RunIndex.h"
#include "FWCore/Utilities/interface/LuminosityBlockIndex.h"
#include "FWCore/Utilities/interface/propagate_const.h"
#include "FWCore/Utilities/interface/disable_ubsan.h"
#include "DataFormats/Common/interface/Wrapper.h"

// forward declarations
Expand Down Expand Up @@ -164,7 +165,9 @@ namespace edm {
C const* runCache(edm::RunIndex iID) const { return caches_[iID].get(); }

private:
void doBeginRun_(Run const& rp, EventSetup const& c) final { caches_[rp.index()] = globalBeginRun(rp, c); }
void doBeginRun_(Run const& rp, EventSetup const& c) final DISABLE_UBSAN {
caches_[rp.index()] = globalBeginRun(rp, c);
}
void doEndRun_(Run const& rp, EventSetup const& c) final {
globalEndRun(rp, c);
caches_[rp.index()].reset();
Expand All @@ -189,7 +192,7 @@ namespace edm {
C const* luminosityBlockCache(edm::LuminosityBlockIndex iID) const { return caches_[iID].get(); }

private:
void doBeginLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final {
void doBeginLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final DISABLE_UBSAN {
caches_[lp.index()] = globalBeginLuminosityBlock(lp, c);
}
void doEndLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final {
Expand Down Expand Up @@ -219,7 +222,7 @@ namespace edm {

friend class EndRunSummaryProducer<T, C>;

void doBeginRunSummary_(edm::Run const& rp, EventSetup const& c) final {
void doBeginRunSummary_(edm::Run const& rp, EventSetup const& c) final DISABLE_UBSAN {
caches_[rp.index()] = globalBeginRunSummary(rp, c);
}
void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c) final {
Expand Down Expand Up @@ -259,7 +262,7 @@ namespace edm {

friend class EndLuminosityBlockSummaryProducer<T, C>;

void doBeginLuminosityBlockSummary_(edm::LuminosityBlock const& lb, EventSetup const& c) final {
void doBeginLuminosityBlockSummary_(edm::LuminosityBlock const& lb, EventSetup const& c) final DISABLE_UBSAN {
caches_[lb.index()] = globalBeginLuminosityBlockSummary(lb, c);
}

Expand Down
11 changes: 7 additions & 4 deletions FWCore/Framework/interface/limited/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "FWCore/Utilities/interface/RunIndex.h"
#include "FWCore/Utilities/interface/LuminosityBlockIndex.h"
#include "FWCore/Utilities/interface/propagate_const.h"
#include "FWCore/Utilities/interface/disable_ubsan.h"
#include "DataFormats/Common/interface/Wrapper.h"

// forward declarations
Expand Down Expand Up @@ -164,7 +165,9 @@ namespace edm {
C const* runCache(edm::RunIndex iID) const { return caches_[iID].get(); }

private:
void doBeginRun_(Run const& rp, EventSetup const& c) final { caches_[rp.index()] = globalBeginRun(rp, c); }
void doBeginRun_(Run const& rp, EventSetup const& c) final DISABLE_UBSAN {
caches_[rp.index()] = globalBeginRun(rp, c);
}
void doEndRun_(Run const& rp, EventSetup const& c) final {
globalEndRun(rp, c);
caches_[rp.index()].reset();
Expand All @@ -190,7 +193,7 @@ namespace edm {
private:
void preallocLumis(unsigned int iNLumis) final { caches_.reset(new std::shared_ptr<C>[iNLumis]); }

void doBeginLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final {
void doBeginLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final DISABLE_UBSAN {
caches_[lp.index()] = globalBeginLuminosityBlock(lp, c);
}
void doEndLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final {
Expand Down Expand Up @@ -220,7 +223,7 @@ namespace edm {
void preallocRunsSummary(unsigned int iNRuns) final { caches_.reset(new std::shared_ptr<C>[iNRuns]); }

friend class EndRunSummaryProducer<T, C>;
void doBeginRunSummary_(edm::Run const& rp, EventSetup const& c) final {
void doBeginRunSummary_(edm::Run const& rp, EventSetup const& c) final DISABLE_UBSAN {
caches_[rp.index()] = globalBeginRunSummary(rp, c);
}
void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c) final {
Expand Down Expand Up @@ -260,7 +263,7 @@ namespace edm {

friend class EndLuminosityBlockSummaryProducer<T, C>;

void doBeginLuminosityBlockSummary_(edm::LuminosityBlock const& lb, EventSetup const& c) final {
void doBeginLuminosityBlockSummary_(edm::LuminosityBlock const& lb, EventSetup const& c) final DISABLE_UBSAN {
caches_[lb.index()] = globalBeginLuminosityBlockSummary(lb, c);
}

Expand Down
7 changes: 5 additions & 2 deletions FWCore/Framework/interface/one/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "FWCore/Utilities/interface/RunIndex.h"
#include "FWCore/Utilities/interface/LuminosityBlockIndex.h"
#include "FWCore/Utilities/interface/propagate_const.h"
#include "FWCore/Utilities/interface/disable_ubsan.h"
#include "DataFormats/Common/interface/Wrapper.h"

// forward declarations
Expand Down Expand Up @@ -280,7 +281,9 @@ namespace edm {
C const* runCache(edm::RunIndex iID) const { return caches_[iID].get(); }

private:
void doBeginRun_(Run const& rp, EventSetup const& c) final { caches_[rp.index()] = globalBeginRun(rp, c); }
void doBeginRun_(Run const& rp, EventSetup const& c) final DISABLE_UBSAN {
caches_[rp.index()] = globalBeginRun(rp, c);
}
void doEndRun_(Run const& rp, EventSetup const& c) final {
globalEndRun(rp, c);
caches_[rp.index()].reset();
Expand All @@ -307,7 +310,7 @@ namespace edm {
C* luminosityBlockCache(edm::LuminosityBlockIndex iID) { return caches_[iID].get(); }

private:
void doBeginLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final {
void doBeginLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final DISABLE_UBSAN {
caches_[lp.index()] = globalBeginLuminosityBlock(lp, c);
}
void doEndLuminosityBlock_(LuminosityBlock const& lp, EventSetup const& c) final {
Expand Down
13 changes: 13 additions & 0 deletions FWCore/Utilities/interface/disable_ubsan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef FWCore_Utilites_disable_ubsan_h
#define FWCore_Utilites_disable_ubsan_h
// With gcc 13.4.0, some summary routines are failing with unreachable program point
// UBSAN errors. No UB has been identified, so for now this workaround suppresses
// UBSAN checking for the routines that are failing.
//
// details at https://github.com/cms-sw/cmssw/issues/49151
Comment on lines +3 to +7
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be better to move this comment to the places where the DISABLE_UBSAN is being used?

I see the DISABLE_UBSAN might end up being used for other problems as well.

#ifdef CMS_UNDEFINED_SANITIZER
#define DISABLE_UBSAN __attribute__((no_sanitize("undefined")))
#else
#define DISABLE_UBSAN
#endif
#endif