From 6b8de850ea325f2ed57753088c5748a7e69038d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 3 Feb 2022 21:05:09 +0000 Subject: [PATCH] explore i686 ICE further --- ...X-code-in-library-static-initializat.patch | 45 +++++++++++++++++++ ...lit-out-function-to-explore-i686-ICE.patch | 24 +++++----- libreoffice.spec | 3 +- 3 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 0001-Avoid-calling-AVX-code-in-library-static-initializat.patch diff --git a/0001-Avoid-calling-AVX-code-in-library-static-initializat.patch b/0001-Avoid-calling-AVX-code-in-library-static-initializat.patch new file mode 100644 index 0000000..f59aa65 --- /dev/null +++ b/0001-Avoid-calling-AVX-code-in-library-static-initializat.patch @@ -0,0 +1,45 @@ +From 3f96d70ce7f31d556b995733b44cb8715b64e329 Mon Sep 17 00:00:00 2001 +From: Thorsten Behrens +Date: Mon, 31 Jan 2022 22:45:37 +0100 +Subject: [PATCH 1/2] Avoid calling AVX code in library static initialization + +Despite 26072b8db7ba53f00c83197cb064229a76001989 and +12c6b1ef6a824b09778163ec83fc44bb196e65db, Linux builds using +RH devtoolset-7 gcc7 still hit occasional unit test crashes +with illegal instructions. + +Backtrace is always: + +> #0 __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at core/sc/source/core/tool/arraysumAVX.cxx:20 +> #1 _GLOBAL__sub_I_arraysumAVX.cxx(void) () at core/sc/source/core/tool/arraysumAVX.cxx:112 +> + +So lets make sure initializer is run only on function entry. + +Change-Id: I69f5cb725e4d72fb346166b21870612473f974b8 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129246 +Tested-by: Jenkins +Reviewed-by: Thorsten Behrens +(cherry picked from commit d140817428cdbb519efa496f578bf6c054c94361) +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129251 +Reviewed-by: Xisco Fauli +--- + sc/source/core/tool/arraysumAVX.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sc/source/core/tool/arraysumAVX.cxx b/sc/source/core/tool/arraysumAVX.cxx +index e256248047d0..4d9ee02285e7 100644 +--- a/sc/source/core/tool/arraysumAVX.cxx ++++ b/sc/source/core/tool/arraysumAVX.cxx +@@ -30,7 +30,7 @@ using namespace AVX; + */ + static inline void sumAVX(__m256d& sum, __m256d& err, const __m256d& value) + { +- const __m256d ANNULATE_SIGN_BIT ++ static const __m256d ANNULATE_SIGN_BIT + = _mm256_castsi256_pd(_mm256_set1_epi64x(0x7FFF'FFFF'FFFF'FFFF)); + // Temporal parameter + __m256d t = _mm256_add_pd(sum, value); +-- +2.33.1 + diff --git a/0001-split-out-function-to-explore-i686-ICE.patch b/0001-split-out-function-to-explore-i686-ICE.patch index ab5e7bc..bb93b46 100644 --- a/0001-split-out-function-to-explore-i686-ICE.patch +++ b/0001-split-out-function-to-explore-i686-ICE.patch @@ -1,14 +1,14 @@ -From 4358a5df96b0989b6074dde0509711598ab5d26e Mon Sep 17 00:00:00 2001 +From bc39839446e13e31ad4e95943446c08876853eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 3 Feb 2022 14:29:21 +0000 -Subject: [PATCH] split out function to explore i686 ICE +Subject: [PATCH 2/2] split out function to explore i686 ICE Change-Id: I75afe56b248236f30a96876e2aed96f5dd887df1 --- sc/Library_sc.mk | 1 + - sc/source/core/tool/bahttext.cxx | 242 +++++++++++++++++++++++++++++++ + sc/source/core/tool/bahttext.cxx | 238 +++++++++++++++++++++++++++++++ sc/source/core/tool/interpr2.cxx | 181 ----------------------- - 3 files changed, 243 insertions(+), 181 deletions(-) + 3 files changed, 239 insertions(+), 181 deletions(-) create mode 100644 sc/source/core/tool/bahttext.cxx diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk @@ -25,10 +25,10 @@ index 936ca33901ee..f31bbd3f5f8c 100644 sc/source/core/tool/cellform \ diff --git a/sc/source/core/tool/bahttext.cxx b/sc/source/core/tool/bahttext.cxx new file mode 100644 -index 000000000000..8d113019b2d8 +index 000000000000..76b99973271d --- /dev/null +++ b/sc/source/core/tool/bahttext.cxx -@@ -0,0 +1,242 @@ +@@ -0,0 +1,238 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. @@ -83,15 +83,13 @@ index 000000000000..8d113019b2d8 +#define UTF8_TH_MINUS "\340\270\245\340\270\232" + +// local functions -+namespace -+{ -+void lclSplitBlock(double& rfInt, sal_Int32& rnBlock, double fValue, double fSize) ++static void lclSplitBlock(double& rfInt, sal_Int32& rnBlock, double fValue, double fSize) +{ + rnBlock = static_cast(modf((fValue + 0.1) / fSize, &rfInt) * fSize + 0.1); +} + +/** Appends a digit (0 to 9) to the passed string. */ -+void lclAppendDigit(OStringBuffer& rText, sal_Int32 nDigit) ++static void lclAppendDigit(OStringBuffer& rText, sal_Int32 nDigit) +{ + switch (nDigit) + { @@ -134,7 +132,7 @@ index 000000000000..8d113019b2d8 + @param nDigit A digit in the range from 1 to 9. + @param nPow10 A value in the range from 2 to 5. + */ -+void lclAppendPow10(OStringBuffer& rText, sal_Int32 nDigit, sal_Int32 nPow10) ++static void lclAppendPow10(OStringBuffer& rText, sal_Int32 nDigit, sal_Int32 nPow10) +{ + OSL_ENSURE((1 <= nDigit) && (nDigit <= 9), "lclAppendPow10 - illegal digit"); + lclAppendDigit(rText, nDigit); @@ -158,7 +156,7 @@ index 000000000000..8d113019b2d8 +} + +/** Appends a block of 6 digits (value from 1 to 999,999) to the passed string. */ -+void lclAppendBlock(OStringBuffer& rText, sal_Int32 nValue) ++static void lclAppendBlock(OStringBuffer& rText, sal_Int32 nValue) +{ + OSL_ENSURE((1 <= nValue) && (nValue <= 999999), "lclAppendBlock - illegal value"); + if (nValue >= 100000) @@ -200,8 +198,6 @@ index 000000000000..8d113019b2d8 + lclAppendDigit(rText, nOne); +} + -+} // namespace -+ +void ScInterpreter::ScBahtText() +{ + sal_uInt8 nParamCount = GetByte(); diff --git a/libreoffice.spec b/libreoffice.spec index 4241232..030b0c5 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -248,8 +248,9 @@ Patch3: 0001-Revert-tdf-101630-gdrive-support-w-oAuth-and-Drive-A.patch Patch4: 0001-it-doesn-t-work-to-just-have-Roman-as-a-font-name-an.patch # disable another poor test Patch5: 0001-the-fedora-kacst-book-fonts-2.0-26-does-have-these-w.patch +Patch6: 0001-Avoid-calling-AVX-code-in-library-static-initializat.patch # see if ICE still happens -Patch6: 0001-split-out-function-to-explore-i686-ICE.patch +Patch7: 0001-split-out-function-to-explore-i686-ICE.patch # not upstreamed Patch500: 0001-disable-libe-book-support.patch