From ac38dfa7bbd836705de4fca932dd393cf2efeeb5 Mon Sep 17 00:00:00 2001 From: Antonio Trande Date: Jul 20 2021 09:12:51 +0000 Subject: Patched for Mozilla bug #1721326 --- diff --git a/icecat-PTHREAD_STACK_MIN-porting-1983645-19.patch b/icecat-PTHREAD_STACK_MIN-porting-1983645-19.patch new file mode 100644 index 0000000..026d13f --- /dev/null +++ b/icecat-PTHREAD_STACK_MIN-porting-1983645-19.patch @@ -0,0 +1,68 @@ +From bfd45aefe777e9b07df52fc52a5621e9a9ad67c2 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Mon, 19 Jul 2021 12:54:46 +0200 +Subject: [PATCH] Python 3.10 and PTHREAD_STACK_MIN porting (#1983645, + #1983696) + +@@ -0,0 +1,64 @@ +diff -ur a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp +--- a/js/xpconnect/src/XPCJSContext.cpp 2021-07-05 21:16:02.000000000 +0200 ++++ b/js/xpconnect/src/XPCJSContext.cpp 2021-07-19 15:01:24.083460460 +0200 +@@ -81,14 +81,6 @@ + using namespace JS; + using mozilla::dom::AutoEntryScript; + +-// The watchdog thread loop is pretty trivial, and should not require much stack +-// space to do its job. So only give it 32KiB or the platform minimum. +-#if !defined(PTHREAD_STACK_MIN) +-# define PTHREAD_STACK_MIN 0 +-#endif +-static constexpr size_t kWatchdogStackSize = +- PTHREAD_STACK_MIN < 32 * 1024 ? 32 * 1024 : PTHREAD_STACK_MIN; +- + static void WatchdogMain(void* arg); + class Watchdog; + class WatchdogManager; +@@ -161,7 +153,7 @@ + // watchdog, we need to join it on shutdown. + mThread = PR_CreateThread(PR_USER_THREAD, WatchdogMain, this, + PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, +- PR_JOINABLE_THREAD, kWatchdogStackSize); ++ PR_JOINABLE_THREAD, 0); + if (!mThread) { + MOZ_CRASH("PR_CreateThread failed!"); + } +diff -ur a/security/sandbox/linux/launch/SandboxLaunch.cpp b/security/sandbox/linux/launch/SandboxLaunch.cpp +--- a/security/sandbox/linux/launch/SandboxLaunch.cpp 2021-07-05 18:20:36.000000000 +0200 ++++ b/security/sandbox/linux/launch/SandboxLaunch.cpp 2021-07-20 08:39:17.272136982 +0200 +@@ -489,7 +489,7 @@ + // we don't currently support sandboxing under valgrind. + MOZ_NEVER_INLINE MOZ_ASAN_BLACKLIST static pid_t DoClone(int aFlags, + jmp_buf* aCtx) { +- uint8_t miniStack[PTHREAD_STACK_MIN]; ++ uint8_t miniStack[4096] __attribute__((aligned(kStackAlignment))); + #ifdef __hppa__ + void* stackPtr = miniStack; + #else +@@ -523,13 +522,19 @@ + CLONE_CHILD_CLEARTID; + MOZ_RELEASE_ASSERT((aFlags & kBadFlags) == 0); + ++ // Block signals due to small stack in DoClone. ++ sigset_t oldSigs; ++ BlockAllSignals(&oldSigs); ++ ++ int ret = 0; + jmp_buf ctx; + if (setjmp(ctx) == 0) { + // In the parent and just called setjmp: +- return DoClone(aFlags | SIGCHLD, &ctx); ++ ret = DoClone(aFlags | SIGCHLD, &ctx); + } ++ RestoreSignals(&oldSigs); + // In the child and have longjmp'ed: +- return 0; ++ return ret; + } + + static bool WriteStringToFile(const char* aPath, const char* aStr, diff --git a/icecat.spec b/icecat.spec index b8cbdb8..3add227 100644 --- a/icecat.spec +++ b/icecat.spec @@ -27,7 +27,7 @@ ExcludeArch: ppc64le ### Optimization ### # Builds for debugging -%global debug_build 1 +%global debug_build 0 # Downgrade optimization %global less_optbuild 0 @@ -108,7 +108,7 @@ ExcludeArch: ppc64le Name: icecat Version: 78.12.0 -Release: 2%{extra_ver}.%{redhat_ver}%{?pre_tag}%{?dist} +Release: 3%{extra_ver}.%{redhat_ver}%{?pre_tag}%{?dist} Summary: GNU version of Firefox browser # Tri-licensing scheme for Gnuzilla/IceCat in parentheses, and licenses for the extensions included @@ -177,6 +177,7 @@ Patch219: rhbz-1173156.patch Patch220: firefox-nss-version.patch Patch221: firefox-nss-addon-hack.patch Patch222: %{name}-porting_to_python310.patch +Patch223: %{name}-PTHREAD_STACK_MIN-porting-1983645-19.patch # ARM run-time patch Patch226: rhbz-1354671.patch @@ -397,6 +398,7 @@ tar -xf %{SOURCE5} %if 0%{?python3_version_nodots} > 39 %patch222 -p1 -b .porting_to_python310 %endif +%patch223 -p1 -b .PTHREAD_STACK_MIN # ARM run-time patch %ifarch aarch64 @@ -886,6 +888,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %{_datadir}/applications/%{name}-wayland.desktop %changelog +* Tue Jul 20 2021 Antonio Trande - 78.12.0-3.rh2.test +- Disable debug build mode +- Patched for Mozilla bug #1721326 + * Thu Jul 15 2021 Antonio Trande - 78.12.0-2.rh2.test - Enable debug build mode