FreeBSD Bugzilla – Attachment 243431 Details for
Bug 272517
net-mgmt/collectd5: crashes with Segmentation fault (core dumped) after update of devel/gettext-runtime from 0.21.1 to 0.22
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
gettext-runtime patch
0001-devel-gettext-runtime-Fix-crash-triggered-by-libgpg-.patch (text/plain), 2.47 KB, created by
Tijl Coosemans
on 2023-07-17 14:21:27 UTC
(
hide
)
Description:
gettext-runtime patch
Filename:
MIME Type:
Creator:
Tijl Coosemans
Created:
2023-07-17 14:21:27 UTC
Size:
2.47 KB
patch
obsolete
>From ee2ceba92f661d6c844209abb7685c69b8dfcc1d Mon Sep 17 00:00:00 2001 >From: Tijl Coosemans <tijl@FreeBSD.org> >Date: Mon, 17 Jul 2023 15:06:02 +0200 >Subject: [PATCH] devel/gettext-runtime: Fix crash triggered by libgpg-error > >Libgpg-error has an initialisation function with >__attribute__((constructor)) that calls a libintl function that >calls pthread_rwlock_wrlock that segfaults if libpthread wasn't >initialised yet. This can happen because libintl doesn't link to >libpthread to avoid the overhead for non-threaded programs. To >fix this, add an initialisation function to libintl that triggers >initialisation of libpthread. > >RTLD_NOLOAD suggested by kib. > >dlopen was fixed to work during initialisation in >https://cgit.FreeBSD.org/src/commit/?id=1005d3d05362 > >PR: 272472, 272517 >--- > devel/gettext-runtime/Makefile | 2 +- > .../gettext-runtime/files/patch-intl_osdep.c | 27 +++++++++++++++++++ > 2 files changed, 28 insertions(+), 1 deletion(-) > create mode 100644 devel/gettext-runtime/files/patch-intl_osdep.c > >diff --git a/devel/gettext-runtime/Makefile b/devel/gettext-runtime/Makefile >index 618340e867f9..1e57b4fb24d7 100644 >--- a/devel/gettext-runtime/Makefile >+++ b/devel/gettext-runtime/Makefile >@@ -3,7 +3,7 @@ > # discretion. > > PORTNAME= gettext-runtime >-PORTREVISION= 0 >+PORTREVISION= 1 > > COMMENT= GNU gettext runtime libraries and programs > WWW= https://www.gnu.org/software/gettext/ >diff --git a/devel/gettext-runtime/files/patch-intl_osdep.c b/devel/gettext-runtime/files/patch-intl_osdep.c >new file mode 100644 >index 000000000000..1b0d6f7b9bb5 >--- /dev/null >+++ b/devel/gettext-runtime/files/patch-intl_osdep.c >@@ -0,0 +1,27 @@ >+--- intl/osdep.c.orig 2019-05-11 11:29:32 UTC >++++ intl/osdep.c >+@@ -18,6 +18,24 @@ >+ # include "intl-exports.c" >+ #elif defined __EMX__ && !defined __KLIBC__ >+ # include "os2compat.c" >++#elif defined __FreeBSD__ >++#include <config.h> >++#include <sys/param.h> >++#include <dlfcn.h> >++#include <pthread.h> >++static __attribute__((constructor)) void >++libintl_init (void) >++{ >++#if __FreeBSD_version >= 1400094 >++ /* We don't link with libpthread to avoid overhead for non-threaded >++ programs. Instead we dlopen it with RTLD_NOLOAD here to ensure >++ it is initialised when present. */ >++ (void) dlopen ("libpthread.so", RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD); >++#else >++ /* This hack also triggers libpthread initialisation. */ >++ (void) pthread_self (); >++#endif >++} >+ #else >+ /* Avoid AIX compiler warning. */ >+ typedef int dummy; >-- >2.41.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 272517
:
243420
| 243431