1
0
libqt5-qtwebengine/QTBUG-82186.patch
Luca Beltrame b836a597c6 Accepting request 777988 from home:Vogtinator:qt5.14
- Fix a deadlock causing audio/video playback to fail (boo#1163744):
  * QTBUG-82186.patch

- Fix an issue with selections breaking replying in KMail:
  * QTBUG-81574.patch

OBS-URL: https://build.opensuse.org/request/show/777988
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.14/libqt5-qtwebengine?expand=0&rev=12
2020-02-22 14:07:32 +00:00

49 lines
2.2 KiB
Diff

From c729361f9f8f6c0602d401d5e230ba63ab11a682 Mon Sep 17 00:00:00 2001
From: Jüri Valdmann <juri.valdmann@qt.io>
Date: Wed, 19 Feb 2020 14:15:34 +0100
Subject: [PATCH] Fix recursive deadlock in sandbox::InitLibcLocaltimeFunctions
QtWebEngineProcess overrides the C library's localtime* functions by redefining
the symbols in src/process/main.cpp and then using dlsym(RTLD_NEXT, ...) to
fetch the original symbols in //sandbox/linux/services/libc_interceptor.cc. The
functions InitLibcLocaltimeFunctions{,Impl} use pthread_once to guarantee that
this symbol resolution happens only once.
If dlsym fails, for example because the C library is earlier in the search path
than QtWebEngineCore, then InitLibcLocaltimeFunctionsImpl tries to print an
error message with LOG(ERROR). However, printing a log message involves also
printing the timestamp in the local time zone, using, of course, localtime_r.
Thus, InitLibcLocaltimeFunctions depends on localtime_r depends on
InitLibcLocaltimeFunctions, and we get a deadlock due to the recursive use of
pthread_once.
This deadlock happens only for utility processes and not for zygotes or
renderers, since the latter proxy the localtime* calls back to the main process.
(See service_manager::ZygoteMain, where the first function call is to
sandbox::SetAmZygoteOrRenderer, and compare with content::UtilityMain)
Task-number: QTBUG-82186
Change-Id: I32009e8482b2634c47082a4c89393dc61c22507e
---
diff --git a/src/3rdparty/chromium/sandbox/linux/services/libc_interceptor.cc b/chromium/sandbox/linux/services/libc_interceptor.cc
index ed4dd02..fad77f9 100644
--- a/src/3rdparty/chromium/sandbox/linux/services/libc_interceptor.cc
+++ b/src/3rdparty/chromium/sandbox/linux/services/libc_interceptor.cc
@@ -199,6 +199,7 @@
g_libc_funcs->localtime64_r =
reinterpret_cast<LocaltimeRFunction>(dlsym(RTLD_NEXT, "localtime64_r"));
+#if !defined(TOOLKIT_QT)
if (!g_libc_funcs->localtime || !g_libc_funcs->localtime_r) {
// https://bugs.chromium.org/p/chromium/issues/detail?id=16800
//
@@ -210,6 +211,7 @@
" time related functions to misbehave. "
"https://bugs.chromium.org/p/chromium/issues/detail?id=16800";
}
+#endif
if (!g_libc_funcs->localtime)
g_libc_funcs->localtime = gmtime;