Summary: | net-mgmt/collectd5: crashes with Segmentation fault (core dumped) after update of devel/gettext-runtime from 0.21.1 to 0.22 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Fabian Wenk <fabian> | ||||||
Component: | Individual Port(s) | Assignee: | Tijl Coosemans <tijl> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Some People | CC: | dfr, marklmi26-fbsd, ports, tijl | ||||||
Priority: | --- | Keywords: | crash | ||||||
Version: | Latest | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
See Also: |
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272210 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272472 |
||||||||
Attachments: |
|
Description
Fabian Wenk
2023-07-15 14:53:45 UTC
(In reply to Fabian Wenk from comment #0) Addition to make the mention similar case bug #272472 clickable. Created attachment 243420 [details]
patch
Please try the attached patch.
(In reply to Tijl Coosemans from comment #2) Thank you Tijl, this patch solved it and collectd5-5.12.0_9 runs with gettext-runtime-0.22. I'm seeing something similar with podman and buildah - upgrading to gettext-runtime-0.22 makes both start crashing: lab2# podman version zsh: segmentation fault podman version lab2# sudo pkg add -f /var/cache/pkg/gettext-runtime-0.21.1.pkg Installing gettext-runtime-0.21.1... package gettext-runtime is already installed, forced install Extracting gettext-runtime-0.21.1: 100% lab2# podman version Client: Podman Engine Version: 4.6.0-rc2 API Version: 4.6.0-rc2 Go Version: go1.20.3 Built: Mon Jul 17 10:44:05 2023 OS/Arch: freebsd/amd64 With gettext-0.21.1, when /usr/local/lib/libintl.so.8 constructors are called, _libpthread_init is called which initialises current pthread and later init_rwlock is called which needs current pthread. WIth gettext-0.22, init_rwlock is called befpre _libpthread_init and current pthread is null and things go pear shaped For buildah, podman and skopeo, the dependency on gettext is coming via security/gpgme https://lists.freebsd.org/archives/dev-commits-src-main/2023-July/017009.html from Sunday is for "git: ad056b5d35d9 - main - libthr: trigger library initialization on rwlock calls" in FreeBSD main (so: 14) Created attachment 243431 [details]
gettext-runtime patch
Please try this patch for devel/gettext-runtime. It should fix all crashes.
The gettext-runtime patch works for podman, buildah and skopeo. Thanks for the quick response! (In reply to Tijl Coosemans from comment #7) I can also confirm, that with the patched version gettext-runtime-0.22_1 the non-patched build of collectd5-5.12.0_8 does not crash any more. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f0fc81e147d6851546b712b4403b4584ac4e02b7 commit f0fc81e147d6851546b712b4403b4584ac4e02b7 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2023-07-16 13:48:11 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2023-07-17 18:55:15 +0000 net-mgmt/collectd5: Eliminate -lgcrypt from LIBS ...so it isn't linked into every executable and library. This came up when trying to fix a crash involving libgcrypt, libgpg-error and libintl from gettext 0.22. This crash has been fixed in fb889ca82944. PR: 272517 net-mgmt/collectd5/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=fb889ca82944e04d4b3dfa2a13c51456bbde0094 commit fb889ca82944e04d4b3dfa2a13c51456bbde0094 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2023-07-17 13:06:02 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2023-07-17 18:53:17 +0000 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 Mk/Uses/gettext-runtime.mk | 5 ++-- devel/gettext-runtime/Makefile | 2 +- .../gettext-runtime/files/patch-intl_osdep.c (new) | 28 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) |