From c872dd19954e4fd37666d84b8e218e76db6fd5a7 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 12 Aug 2025 17:11:26 +0200 Subject: [PATCH] Fix unhandled python exception in ./mach Related: RHEL-108091 --- ...nHandled-for-IO-error-processhandler.patch | 29 +++++++++++++++++++ firefox.spec | 4 ++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 exceptionHandled-for-IO-error-processhandler.patch diff --git a/exceptionHandled-for-IO-error-processhandler.patch b/exceptionHandled-for-IO-error-processhandler.patch new file mode 100644 index 0000000..e6267a5 --- /dev/null +++ b/exceptionHandled-for-IO-error-processhandler.patch @@ -0,0 +1,29 @@ +diff -up firefox-140.1.0/testing/mozbase/mozprocess/mozprocess/processhandler.py.exceptionHandled-for-IO-error-processhandler firefox-140.1.0/testing/mozbase/mozprocess/mozprocess/processhandler.py +--- firefox-140.1.0/testing/mozbase/mozprocess/mozprocess/processhandler.py.exceptionHandled-for-IO-error-processhandler 2025-07-14 19:14:55.000000000 +0200 ++++ firefox-140.1.0/testing/mozbase/mozprocess/mozprocess/processhandler.py 2025-08-05 18:05:54.329479764 +0200 +@@ -1098,11 +1098,22 @@ class ProcessReader: + + def _read_stream(self, stream, queue, callback): + sentinel = "" if isinstance(stream, io.TextIOBase) else b"" +- for line in iter(stream.readline, sentinel): +- queue.put((line, callback)) ++ try: ++ for line in iter(stream.readline, sentinel): ++ queue.put((line, callback)) ++ except ValueError as e: ++ if "I/O operation on closed file" in str(e): ++ # Stream was closed by the process, this is normal ++ pass ++ else: ++ raise + # Give a chance to the reading loop to exit without a timeout. + queue.put((b"", None)) +- stream.close() ++ try: ++ stream.close() ++ except ValueError: ++ # Stream might already be closed ++ pass + + def start(self, proc): + queue = Queue() diff --git a/firefox.spec b/firefox.spec index d4bd9a4..3df4f73 100644 --- a/firefox.spec +++ b/firefox.spec @@ -250,7 +250,8 @@ Patch13: disable-vsync-for-kiosk.patch Patch14: rhbz-71999-fips-youtube.patch # -- Upstreamed patches -- -Patch51: mozilla-bmo1170092.patch +Patch51: mozilla-bmo1170092.patch +Patch52: exceptionHandled-for-IO-error-processhandler.patch # -- Submitted upstream, not merged -- Patch101: mozilla-bmo1636168-fscreen.patch @@ -1237,6 +1238,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil # -- Upstreamed patches -- %patch -P51 -p1 -b .mozilla-bmo1170092 +%patch -P52 -p1 -b .exceptionHandled-for-IO-error-processhandler # -- Submitted upstream, not merged -- %patch -P101 -p1 -b .mozilla-bmo1636168-fscreen