pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/devel/glib2
Module Name: pkgsrc
Committed By: tsutsui
Date: Thu Apr 30 16:23:47 UTC 2026
Modified Files:
pkgsrc/devel/glib2: Makefile distinfo
Added Files:
pkgsrc/devel/glib2/patches: patch-gmodule_gmodule-dl.c
Log Message:
glib2: avoid false g_module_symbol() failures on NetBSD
On NetBSD, do not turn a non-NULL dlsym() result into a
g_module_symbol() failure only because dlerror() has a non-NULL value.
POSIX specifies that it is implementation-defined whether dlerror()
is thread-safe:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/dlerror.html
as already noted in gmodule-dl.c comments.
On NetBSD, dlerror(3) state is process-global and not thread-safe,
so a non-NULL dlerror() value is not a reliable reason to reject
a non-NULL dlsym() result. Marking dlerror() as not thread-safe
in GLib by DLERROR_IS_THREADSAFE=0 would only serialize GLib's
own dynamic linker calls and would not protect against dynamic
linker calls made outside GLib.
POSIX also specifies that dlsym() returns a null pointer if the
symbol cannot be found. However, glibc documents cases where
a successful dlsym() lookup may return NULL:
https://man7.org/linux/man-pages/man3/dlsym.3.html
so keep the existing dlerror()-based check there.
This fixes intermittent startup failures in packages using
GObject-Introspection, observed with net/mikutter.
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.313 -r1.314 pkgsrc/devel/glib2/Makefile
cvs rdiff -u -r1.343 -r1.344 pkgsrc/devel/glib2/distinfo
cvs rdiff -u -r0 -r1.6 pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/devel/glib2/Makefile
diff -u pkgsrc/devel/glib2/Makefile:1.313 pkgsrc/devel/glib2/Makefile:1.314
--- pkgsrc/devel/glib2/Makefile:1.313 Wed Apr 15 08:33:00 2026
+++ pkgsrc/devel/glib2/Makefile Thu Apr 30 16:23:46 2026
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.313 2026/04/15 08:33:00 adam Exp $
+# $NetBSD: Makefile,v 1.314 2026/04/30 16:23:46 tsutsui Exp $
.include "Makefile.common"
+PKGREVISION= 1
CATEGORIES= devel gnome
COMMENT= Some useful routines for C programming (glib2)
Index: pkgsrc/devel/glib2/distinfo
diff -u pkgsrc/devel/glib2/distinfo:1.343 pkgsrc/devel/glib2/distinfo:1.344
--- pkgsrc/devel/glib2/distinfo:1.343 Fri Apr 24 08:02:58 2026
+++ pkgsrc/devel/glib2/distinfo Thu Apr 30 16:23:46 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.343 2026/04/24 08:02:58 mrg Exp $
+$NetBSD: distinfo,v 1.344 2026/04/30 16:23:46 tsutsui Exp $
BLAKE2s (glib-2.88.0.tar.xz) = 4623f7355733d27a2637c92f216d218ef316f5898b97d43e7d2d45a63fee6dd7
SHA512 (glib-2.88.0.tar.xz) = ceead8d88720db17dc6bbff7aff14f261f90afc5e8261448aae0657f89b5fcc616cf62f4b049be88a4ddd3f50a869bbcdb66b29777da4969a47987828ecac280
@@ -24,6 +24,7 @@ SHA1 (patch-glib_tests_hash.c) = a7e19ca
SHA1 (patch-glib_tests_include.c) = 12d98caebfb87c1146821d518c37c45f97fc7be0
SHA1 (patch-glib_tests_meson.build) = 40ce43a49ae7084116facac6b3926c5e545f6721
SHA1 (patch-glib_tests_thread.c) = 84f46a31cbc7cdfd9503da73f8b4f9654201964f
+SHA1 (patch-gmodule_gmodule-dl.c) = a4b562db74a861abc7e2c7033237cd34c27626d4
SHA1 (patch-gmodule_gmodule.c) = b5105399d693d3e127abfde9b32e643b8150aa94
SHA1 (patch-gobject_glib-mkenums.in) = c177cf9b1ea81542665240678f47f68351a3760d
SHA1 (patch-gobject_meson.build) = a3953d33ba7e906ff1df024221ac3ab32f6c0c66
Added files:
Index: pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c
diff -u /dev/null pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c:1.6
--- /dev/null Thu Apr 30 16:23:47 2026
+++ pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c Thu Apr 30 16:23:46 2026
@@ -0,0 +1,31 @@
+$NetBSD: patch-gmodule_gmodule-dl.c,v 1.6 2026/04/30 16:23:46 tsutsui Exp $
+
+- Avoid false g_module_symbol() failures in non glibc cases (PR/60215)
+
+--- gmodule/gmodule-dl.c.orig 2026-03-16 13:53:50.000000000 +0000
++++ gmodule/gmodule-dl.c
+@@ -292,6 +292,24 @@ _g_module_symbol (gpointer handle,
+ p = dlsym (handle, symbol_name);
+ msg = fetch_dlerror (FALSE);
+ #ifndef CYGWIN_WORKAROUND
++#if defined(__NetBSD__)
++ /*
++ * POSIX specifies that dlsym() returns a null pointer when the symbol
++ * cannot be found. The dlerror()-based check is mainly for glibc
++ * implementations, which document successful NULL-valued symbol lookups.
++ *
++ * POSIX also says it is implementation-defined whether dlerror() is
++ * thread-safe. NetBSD's dlerror() state is process-global, and
++ * !DLERROR_IS_THREADSAFE would only serialize GLib's own calls,
++ * not dlopen()/dlsym()/dlerror() calls outside GLib, such as
++ * libc NSS module probes etc.
++ *
++ * Therefore, do not turn a non-NULL dlsym() result into failure only
++ * because dlerror() has a non-NULL value.
++ */
++ if (p != NULL)
++ msg = NULL;
++#endif
+ if (msg)
+ g_module_set_error (msg);
+ unlock_dlerror ();
Home |
Main Index |
Thread Index |
Old Index