[UBSAN]Fix runtime error for invalid bool value assignment#46907
[UBSAN]Fix runtime error for invalid bool value assignment#46907cmsbuild merged 1 commit intocms-sw:masterfrom
Conversation
|
cms-bot internal usage |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46907/42957 |
|
A new Pull Request was created by @smuzaffar for master. It involves the following packages:
@bbilin, @cmsbuild, @lviliani, @menglu21, @mkirsano can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
|
test parameters:
|
|
please test |
|
please test for CMSSW_15_0_UBSAN_X |
|
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-4303dc/43351/summary.html |
|
-1 Failed Tests: RelVals-INPUT
RelVals-INPUT
Comparison SummarySummary:
|
|
please test |
|
+1 Size: This PR adds an extra 16KB to repository Comparison SummarySummary:
|
|
please test lets refresh the tests @cms-sw/generators-l2 can you please review this? this just contains changes needed for code-format |
|
+1 Size: This PR adds an extra 16KB to repository Comparison SummarySummary:
|
|
+1 |
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @antoniovilela, @sextonkennedy, @rappoccio, @mandrenguyen (and backports should be raised in the release meeting by the corresponding L2) |
|
+1 |
| //std::swap(fTimeOffset, other.fTimeOffset); | ||
| isVtxGenApplied_ = other.isVtxGenApplied_; | ||
| isVtxBoostApplied_ = other.isVtxBoostApplied_; | ||
| isPBoostApplied_ = other.isPBoostApplied_; |
There was a problem hiding this comment.
Sorry but strictly speaking this is not a correct implementation of swap(), because the values from this do not end up in other (see https://en.cppreference.com/w/cpp/named_req/Swappable). I'm puzzled though why
cmssw/DataFormats/Common/interface/Wrapper.h
Lines 89 to 94 in 684a740
ends up calling
swap().
Ah, it's because the move constructor and assignment are implemented with swap()
cmssw/SimDataFormats/GeneratorProducts/src/HepMCProduct.cc
Lines 146 to 150 in 684a740
Maybe the real problem is that the move constructor does not initialize the bools?
There was a problem hiding this comment.
ah you are right @makortel . Let me revert this change and initialize bools in move constructor
For UBSAN IBs, few workflows show runtime errors like [a]. Looks like this happens when we try to swap uninitialized bool values here e.g from https://github.com/cms-sw/cmssw/blob/master/SimDataFormats/GeneratorProducts/src/HepMCProduct.cc#L149 . If I am not wrong, there is no need to use swap for boolean types, just assignment should be enough
Also removed using
fTimeOffsetcomments[a]