From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: bug#30785: Man pages truncated, repeated Date: Wed, 16 Jan 2019 20:57:28 +0100 Message-ID: <20190116205728.616a0b7b@scratchpost.org> References: <20190114185054.37ddef40@scratchpost.org> <874labq91k.fsf@gnu.org> <20190114224249.6bd4452f@scratchpost.org> <20190114231406.1a1654ac@scratchpost.org> <87ef9e2jfl.fsf@gnu.org> <87o98g7wfr.fsf@ambrevar.xyz> <20190116115654.21ab97d6@scratchpost.org> <87ef9c7o31.fsf@ambrevar.xyz> <20190116151737.41ccbd88@scratchpost.org> <878szk7b94.fsf@ambrevar.xyz> <20190116181200.GE25281@macbook41> <877ef479f0.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/iRO2yL1BURp9fEsSRaYeI/F"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:42872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjrKA-0002Mf-E6 for bug-guix@gnu.org; Wed, 16 Jan 2019 14:58:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjrK9-0001ns-DY for bug-guix@gnu.org; Wed, 16 Jan 2019 14:58:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjrK6-0001iQ-FV for bug-guix@gnu.org; Wed, 16 Jan 2019 14:58:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gjrK5-0004Gi-UX for bug-guix@gnu.org; Wed, 16 Jan 2019 14:58:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877ef479f0.fsf@ambrevar.xyz> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Pierre Neidhardt Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 30785@debbugs.gnu.org --Sig_/iRO2yL1BURp9fEsSRaYeI/F Content-Type: multipart/mixed; boundary="MP_/YZzwNWqhxZW7P6_+hRk=Vbm" --MP_/YZzwNWqhxZW7P6_+hRk=Vbm Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Apparently, man-db has groff-minimal as a regular input, so I guess we are = lucky. So we could adapt groff-minimal only if we wanted to. But that would mean that even after that, the "groff" package would still contain a memory corruption bug in preconv - which is arguably a security problem. Should we use grafts instead? Patch for the former is attached. --MP_/YZzwNWqhxZW7P6_+hRk=Vbm Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-groff-minimal-Disable-relocatability.patch =46rom adc9e7940b54e467732ec923c6a3fcec810dce48 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 16 Jan 2019 15:00:04 +0100 Subject: [PATCH] gnu: groff-minimal: Disable relocatability. Tags: patch * gnu/packages/groff.scm (groff-minimal)[arguments]<#:phases> [disable-relocatability]: New phase. --- gnu/packages/groff.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm index 77728a5d7..cf392f546 100644 --- a/gnu/packages/groff.scm +++ b/gnu/packages/groff.scm @@ -96,6 +96,36 @@ is usually the formatter of \"man\" documentation pages.= ") ,@(substitute-keyword-arguments (package-arguments groff) ((#:phases phases) `(modify-phases ,phases + (add-after 'unpack 'disable-relocatability + (lambda _ + ;; Groff contains a Rube Goldberg-esque relocator for t= he + ;; file "charset.alias". + ;; It tries to find the current executable using realpa= th, + ;; a do-it-yourself search in $PATH and so on. + ;; Furthermore, the routine that does the search is bug= gy + ;; in that it doesn't handle error cases when they aris= e. + ;; This causes preconv to segfault when trying to look = up + ;; the file "charset.alias" in the NULL location. + ;; The "charset.alias" parser is a copy of gnulib's, an= d a + ;; non-broken version of gnulib's "charset.alias" parser + ;; is part of glibc's libcharset. + ;; However, groff unconditionally uses their own + ;; "charset.alias" parser, but then DOES NOT INSTALL the + ;; file "charset.alias" when glibc is too new. + ;; In Guix, our file "charset.alias" only contains an + ;; obscure alias for ASCII and nothing else. + ;; So just disable relocation and make the entire + ;; "charset.alias" lookup fail. + ;; See + ;; for details. + (substitute* "src/libs/libgroff/Makefile.sub" + (("-DENABLE_RELOCATABLE=3D1") "")) + ;; That file contains a crash bug--so make sure that + ;; its contents are not there. + (call-with-output-file "src/libs/libgroff/relocate.cpp" + (lambda (port) + #t)) + #t)) (add-after 'install 'remove-non-essential-programs (lambda* (#:key outputs #:allow-other-keys) ;; Keep only the programs that man-db needs at run time, --MP_/YZzwNWqhxZW7P6_+hRk=Vbm-- --Sig_/iRO2yL1BURp9fEsSRaYeI/F Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlw/jKgACgkQ5xo1VCww uqX0hAgAnWVq+B6WF6XaW3DngAW6RT08Y+gfsd/foX6RQX4JdbfQZviUUiDn/X3v AnRqjU31zwA1EN/xWEP5ufxMXrIl9Xrmyov3J9mWC5qhI294TNILeFr6sNmYJzs4 9SMkPPRK+6ZYfywhp6BSqPdZyDxhhc13mc2gQf5TJV6GhysZ2tXdg4BE3gRWDRbF UQ7KH7ZTPE9p6bHMQCPXrYn9njdxjLInFPps4sg6l/7+SR8xZcv+JQFxi0Akc4bT H55db6A96owEwQDDFUJaon4EqUzm+JI4bh0f5ojSPgvkr3gFtVBgm/F7v2cs7ThD sCVAH/YNTYmlmY/mtL4QQbq6gLniFg== =+aGe -----END PGP SIGNATURE----- --Sig_/iRO2yL1BURp9fEsSRaYeI/F--