pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
webkit-gtk60: candidate workaround for core dumps on NetBSD
Module Name: pkgsrc-wip
Committed By: Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By: wiz
Date: Thu Aug 27 22:39:26 2026 +0200
Changeset: 8be2d2510e5993797f0088b5e72d7e73237b7768
Modified Files:
webkit-gtk60/distinfo
Added Files:
webkit-gtk60/patches/patch-Source_WTF_wtf_StackBounds.cpp
Removed Files:
webkit-gtk60/TODO
Log Message:
webkit-gtk60: candidate workaround for core dumps on NetBSD
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8be2d2510e5993797f0088b5e72d7e73237b7768
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
webkit-gtk60/TODO | 3 --
webkit-gtk60/distinfo | 1 +
.../patches/patch-Source_WTF_wtf_StackBounds.cpp | 51 ++++++++++++++++++++++
3 files changed, 52 insertions(+), 3 deletions(-)
diffs:
diff --git a/webkit-gtk60/TODO b/webkit-gtk60/TODO
deleted file mode 100644
index d2109f25bb..0000000000
--- a/webkit-gtk60/TODO
+++ /dev/null
@@ -1,3 +0,0 @@
-Test with $PREFIX/libexec/webkitgtk-6.0/MiniBrowser
-
-start, but often gets 'WebProcess CRASHED' error
diff --git a/webkit-gtk60/distinfo b/webkit-gtk60/distinfo
index 7330db4b81..3e6313f683 100644
--- a/webkit-gtk60/distinfo
+++ b/webkit-gtk60/distinfo
@@ -16,6 +16,7 @@ SHA1 (patch-Source_ThirdParty_skia_src_gpu_ganesh_GrAutoLocaleSetter.h) = 6a854b
SHA1 (patch-Source_ThirdParty_skia_src_ports_SkMemory__malloc.cpp) = e277d988eeaacb7ec8b7f051342b77c5e8ac06a7
SHA1 (patch-Source_WTF_wtf_InlineASM.h) = 35afdd5143f4a2df8a5554a0b0b35141a8784c6c
SHA1 (patch-Source_WTF_wtf_PlatformEnable.h) = 905b2b4bf4b8c90cf91eb8ecf1d414013cc3bcbb
+SHA1 (patch-Source_WTF_wtf_StackBounds.cpp) = c6c0a38f3a8c4357e9cfd9a412fd89ea69436535
SHA1 (patch-Source_WebCore_loader_cache_CachedResource.h) = 5d82e4797336f3dc0af9f313ac80f3a72be9a22a
SHA1 (patch-Source_WebCore_page_NavigatorBase.cpp) = 40a1c832e0df382e39cecb6c57527731e7c63c52
SHA1 (patch-Source_WebCore_platform_graphics_gbm_MemoryMappedGPUBuffer.cpp) = 3e95b73709a3a39cd130dcaf4bf440e9c0195fa5
diff --git a/webkit-gtk60/patches/patch-Source_WTF_wtf_StackBounds.cpp b/webkit-gtk60/patches/patch-Source_WTF_wtf_StackBounds.cpp
new file mode 100644
index 0000000000..d6b29b0de6
--- /dev/null
+++ b/webkit-gtk60/patches/patch-Source_WTF_wtf_StackBounds.cpp
@@ -0,0 +1,51 @@
+$NetBSD$
+
+--- Source/WTF/wtf/StackBounds.cpp.orig 2026-02-23 14:40:54.556305400 +0000
++++ Source/WTF/wtf/StackBounds.cpp
+@@ -42,6 +42,14 @@
+ #include <unistd.h>
+ #endif
+
++#if OS(NETBSD)
++#include <sys/exec.h>
++#include <sys/param.h>
++#include <sys/resource.h>
++#include <unistd.h>
++extern "C" struct ps_strings* __ps_strings;
++#endif
++
+ #if OS(QNX)
+ #include <sys/storage.h>
+ #endif
+@@ -140,6 +148,31 @@ StackBounds StackBounds::currentThreadStackBoundsInter
+ StackBounds StackBounds::currentThreadStackBoundsInternal()
+ {
+ auto ret = newThreadStackBounds(pthread_self());
++#if OS(NETBSD)
++#if __NetBSD_Version__ < 1199000700
++ // Due to a bug in posix_spawn(3), AT_STACKBASE is wrong for the main thread.
++ // Use __ps_strings to find the top of the stack, and use that if the current
++ // stack falls in the computed range on affected NetBSD versions.
++ // https://gnats.netbsd.org/60653
++ if (__ps_strings) {
++WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN
++ char* origin = reinterpret_cast<char*>(__ps_strings) + sizeof(struct ps_strings);
++WTF_ALLOW_UNSAFE_BUFFER_USAGE_END
++ rlimit limit;
++ rlim_t size = 8 * MB;
++ if (!getrlimit(RLIMIT_STACK, &limit) && limit.rlim_cur != RLIM_INFINITY)
++ size = limit.rlim_cur;
++WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN
++ char* bound = origin - size;
++WTF_ALLOW_UNSAFE_BUFFER_USAGE_END
++ // Only the initial thread lives in that range; everybody else keeps
++ // the libpthread-reported bounds.
++ char* here = reinterpret_cast<char*>(&limit);
++ if (here > bound && here < origin)
++ return StackBounds { origin, bound };
++ }
++#endif
++#endif
+ #if OS(LINUX)
+ // on glibc, pthread_attr_getstack will generally return the limit size (minus a guard page)
+ // for the main thread; this is however not necessarily always true on every libc - for example
Home |
Main Index |
Thread Index |
Old Index