Skip to content

Commit

Permalink
[vdt]Apply patch to avoid UBSan signed integer overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Oct 17, 2024
1 parent 853f4f9 commit 8e512ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions vdt-integer-overflow.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/include/sincos.h b/include/sincos.h
index 563ae93..2ca2855 100644
--- a/include/sincos.h
+++ b/include/sincos.h
@@ -204,6 +204,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

0 comments on commit 8e512ce

Please sign in to comment.