Summary: | security/gnupg: dirmngr crashes with segfault after devel/gettext-runtime is updated to 0.22 | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Yasuhiro Kimura <yasu> | ||||
Component: | Individual Port(s) | Assignee: | Tijl Coosemans <tijl> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | adridg, marklmi26-fbsd, tijl | ||||
Priority: | --- | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272517 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 272589 | ||||||
Attachments: |
|
Description
Yasuhiro Kimura
![]() ![]() Created attachment 243362 [details]
patch-dirmngr_Makefile.in
See if rebuilding gnupg with this patch in security/gnupg/files/ fixes it.
(In reply to Tijl Coosemans from comment #1) By applying attached patch dirmngr works file without crash. Thank you! A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7fa24cff0d8a99e5d44839d4b358fafaf69cffbe commit 7fa24cff0d8a99e5d44839d4b358fafaf69cffbe Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2023-07-13 11:38:14 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2023-07-13 12:44:44 +0000 security/gnupg: Fix dirmngr crash caused by gettext 0.22 Link the threading library after libgpg-error (and libgcrypt, which also links to libgpg-error) so the threading library is initialised before libgpg-error. The initialisation function of libgpg-error calls gettext functions that call threading functions (mutex locking). PR: 272472 Tested by: yasu security/gnupg/Makefile | 1 + security/gnupg/files/patch-dirmngr_Makefile.in (new) | 12 ++++++++++++ 2 files changed, 13 insertions(+) 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) 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(-) A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=d0cbe7ba85c00f24f4b85a2c6221533e6a4db44d commit d0cbe7ba85c00f24f4b85a2c6221533e6a4db44d Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2023-07-17 18:59:17 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2023-07-17 19:08:47 +0000 Revert "security/gnupg: Fix dirmngr crash caused by gettext 0.22" This reverts commit 7fa24cff0d8a99e5d44839d4b358fafaf69cffbe. The problem has been fixed in libintl in fb889ca82944. PR: 272472 security/gnupg/Makefile | 2 +- security/gnupg/files/patch-dirmngr_Makefile.in (gone) | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) |