1 |
commit: 93f9253163fced331c183be24b515b8c22666fa0 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 2 17:27:51 2022 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 2 20:16:53 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93f92531 |
7 |
|
8 |
net-libs/webkit-gtk: Fix crash regression |
9 |
|
10 |
Closes: https://bugs.gentoo.org/863008 |
11 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
12 |
|
13 |
net-libs/webkit-gtk/files/2.36.5-fix-crash.patch | 82 ++++++++++++++++++++++ |
14 |
...k-2.36.5.ebuild => webkit-gtk-2.36.5-r1.ebuild} | 2 + |
15 |
2 files changed, 84 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/webkit-gtk/files/2.36.5-fix-crash.patch b/net-libs/webkit-gtk/files/2.36.5-fix-crash.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..0f676a942d06 |
20 |
--- /dev/null |
21 |
+++ b/net-libs/webkit-gtk/files/2.36.5-fix-crash.patch |
22 |
@@ -0,0 +1,82 @@ |
23 |
+https://bugs.gentoo.org/863008 |
24 |
+https://bugs.webkit.org/show_bug.cgi?id=243401 |
25 |
+ |
26 |
+From a6277d4834cce0dea2f999d4c06ffa57abfbb82d Mon Sep 17 00:00:00 2001 |
27 |
+From: Michael Catanzaro <mcatanzaro@××××××.com> |
28 |
+Date: Mon, 1 Aug 2022 14:07:04 -0700 |
29 |
+Subject: [PATCH] REGRESSION(252485@main): [GTK] |
30 |
+ webkit_web_context_get_default() crashes in Eclipse since webkit-gtk v2.36.5, |
31 |
+ v2.36.4 was fine https://bugs.webkit.org/show_bug.cgi?id=243401 |
32 |
+ |
33 |
+Reviewed by Adrian Perez de Castro. |
34 |
+ |
35 |
+Turns out WebKit's "main thread" may not actually be the real main |
36 |
+thread. This is OK as long as it matches the GTK "main thread," and as |
37 |
+long as the application is careful to iterate the default main context |
38 |
+only on the WebKit/GTK "main thread," as as long as the application does |
39 |
+not ever attempt to use these libraries on any other thread. |
40 |
+ |
41 |
+The motivation to do this is if the programming language controls the |
42 |
+real thread 1, as is the case with Java, where the Java main thread that |
43 |
+applications can use to run GTK and WebKit is apparently not the same as |
44 |
+the real main thread that's running the JVM. These applications have no |
45 |
+control over what their "main thread" is, and it seems unkind to break |
46 |
+them. |
47 |
+ |
48 |
+I've checked in with the GTK developers, and consensus is that this |
49 |
+is actually expected to work, so let's not break it. |
50 |
+ |
51 |
+* Source/WTF/wtf/generic/MainThreadGeneric.cpp: |
52 |
+(WTF::initializeMainThreadPlatform): |
53 |
+(WTF::isMainThread): |
54 |
+ |
55 |
+Canonical link: https://commits.webkit.org/253010@main |
56 |
+--- |
57 |
+ Source/WTF/wtf/generic/MainThreadGeneric.cpp | 13 ++----------- |
58 |
+ 1 file changed, 2 insertions(+), 11 deletions(-) |
59 |
+ |
60 |
+diff --git a/Source/WTF/wtf/generic/MainThreadGeneric.cpp b/Source/WTF/wtf/generic/MainThreadGeneric.cpp |
61 |
+index 3a9208b0f9ab..b51e2e456047 100644 |
62 |
+--- a/Source/WTF/wtf/generic/MainThreadGeneric.cpp |
63 |
++++ b/Source/WTF/wtf/generic/MainThreadGeneric.cpp |
64 |
+@@ -31,29 +31,22 @@ |
65 |
+ */ |
66 |
+ |
67 |
+ #include "config.h" |
68 |
+-#if !OS(LINUX) |
69 |
+ #include <pthread.h> |
70 |
+-#endif |
71 |
+ #if HAVE(PTHREAD_NP_H) |
72 |
+ #include <pthread_np.h> |
73 |
+ #endif |
74 |
+-#if OS(LINUX) |
75 |
+-#include <sys/syscall.h> |
76 |
+-#include <sys/types.h> |
77 |
+-#include <unistd.h> |
78 |
+-#endif |
79 |
+ |
80 |
+ #include <wtf/RunLoop.h> |
81 |
+ |
82 |
+ namespace WTF { |
83 |
+ |
84 |
+-#if !HAVE(PTHREAD_MAIN_NP) && !OS(LINUX) |
85 |
++#if !HAVE(PTHREAD_MAIN_NP) |
86 |
+ static pthread_t mainThread; |
87 |
+ #endif |
88 |
+ |
89 |
+ void initializeMainThreadPlatform() |
90 |
+ { |
91 |
+-#if !HAVE(PTHREAD_MAIN_NP) && !OS(LINUX) |
92 |
++#if !HAVE(PTHREAD_MAIN_NP) |
93 |
+ mainThread = pthread_self(); |
94 |
+ #endif |
95 |
+ } |
96 |
+@@ -62,8 +55,6 @@ bool isMainThread() |
97 |
+ { |
98 |
+ #if HAVE(PTHREAD_MAIN_NP) |
99 |
+ return pthread_main_np(); |
100 |
+-#elif OS(LINUX) |
101 |
+- return getpid() == static_cast<pid_t>(syscall(SYS_gettid)); |
102 |
+ #else |
103 |
+ return pthread_equal(pthread_self(), mainThread); |
104 |
+ #endif |
105 |
|
106 |
diff --git a/net-libs/webkit-gtk/webkit-gtk-2.36.5.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.36.5-r1.ebuild |
107 |
similarity index 99% |
108 |
rename from net-libs/webkit-gtk/webkit-gtk-2.36.5.ebuild |
109 |
rename to net-libs/webkit-gtk/webkit-gtk-2.36.5-r1.ebuild |
110 |
index ac5ee1a431b0..ad7b4de216cf 100644 |
111 |
--- a/net-libs/webkit-gtk/webkit-gtk-2.36.5.ebuild |
112 |
+++ b/net-libs/webkit-gtk/webkit-gtk-2.36.5-r1.ebuild |
113 |
@@ -153,6 +153,8 @@ pkg_setup() { |
114 |
} |
115 |
|
116 |
src_prepare() { |
117 |
+ eapply "${FILESDIR}"/${PV}-fix-crash.patch |
118 |
+ |
119 |
cmake_src_prepare |
120 |
gnome2_src_prepare |
121 |
} |