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

[vdt]Apply patch to avoid UBSan signed integer overflow error #9470

Merged
merged 2 commits into from
Oct 19, 2024
Merged
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
24 changes: 24 additions & 0 deletions vdt-integer-overflow.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/include/sincos.h b/include/sincos.h
index 563ae93..e5708c5 100644
--- a/include/sincos.h
+++ b/include/sincos.h
@@ -129,6 +129,9 @@ inline void fast_sincos_m45_45( const double z, double & s, double &c ) {
} // End namespace details

/// Double precision sincos
+#ifdef CMS_UNDEFINED_SANITIZER
+__attribute__((no_sanitize("signed-integer-overflow")))
+#endif
inline void fast_sincos( const double xx, double & s, double &c ) {
// I have to use doubles to make it vectorise...

@@ -204,6 +207,9 @@ inline void fast_sincosf_m45_45( const float x, float & s, float &c ) {
} // end details namespace

/// Single precision sincos
+#ifdef CMS_UNDEFINED_SANITIZER
+__attribute__((no_sanitize("signed-integer-overflow")))
+#endif
inline void fast_sincosf( const float xx, float & s, float &c ) {


6 changes: 4 additions & 2 deletions vdt.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
### RPM cms vdt 0.4.3

Source: https://github.com/dpiparo/%{n}/archive/v%{realversion}.tar.gz

Source: https://github.com/dpiparo/%{n}/archive/v%{realversion}.tar.gz
# To avoid UBSan runtime errors about signed integer overflow: cms-sw/cmssw#46417
Patch0: vdt-integer-overflow
BuildRequires: cmake python3


%define keep_archives true

%prep
%setup -q -n %{n}-%{realversion}
%patch0 -p1

%build
cmake . \
Expand Down