From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#30785: Man pages truncated, repeated Date: Mon, 14 Jan 2019 21:27:35 +0100 Message-ID: <874labq91k.fsf@gnu.org> References: <87va2s8row.fsf@ambrevar.xyz> <87tvic8rfq.fsf@ambrevar.xyz> <878szo5w6z.fsf@gnu.org> <87r2dg8nxd.fsf@ambrevar.xyz> <87pnt08ndl.fsf@ambrevar.xyz> <8736pw5mmh.fsf@gnu.org> <87muo48fay.fsf@ambrevar.xyz> <87r2dfy6t0.fsf@gnu.org> <87k1j78vzd.fsf@ambrevar.xyz> <87imyr8rsg.fsf@ambrevar.xyz> <87ef9f8ei5.fsf@ambrevar.xyz> <87a7k3rzio.fsf@gnu.org> <87won78aw8.fsf@ambrevar.xyz> <20190114174240.557e64b5@scratchpost.org> <87va2r89ef.fsf@ambrevar.xyz> <20190114184853.1d1fe010@scratchpost.org> <20190114185054.37ddef40@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:59592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj8q3-0005tb-1c for bug-guix@gnu.org; Mon, 14 Jan 2019 15:28:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gj8q2-00059M-CN for bug-guix@gnu.org; Mon, 14 Jan 2019 15:28:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gj8q2-00059C-8g for bug-guix@gnu.org; Mon, 14 Jan 2019 15:28:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gj8q2-0007qd-25 for bug-guix@gnu.org; Mon, 14 Jan 2019 15:28:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190114185054.37ddef40@scratchpost.org> (Danny Milosavljevic's message of "Mon, 14 Jan 2019 18:50:54 +0100") 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: Danny Milosavljevic Cc: Pierre Neidhardt , 30785@debbugs.gnu.org Danny Milosavljevic skribis: > On Mon, 14 Jan 2019 18:48:53 +0100 > Danny Milosavljevic wrote: > >> set_current_prefix() searches for the current program executable file in= $PATH, >> and it can fail and return 0.=20 >>=20 >> In that case, relocatep will probably segfault at the location marked be= low: >>=20 >> > char *relocated_path =3D new char[curr_prefix_len + relative_path_le= n + 1]; >> > strcpy(relocated_path, curr_prefix);=20=20 >> ^^^^^^^^^^^ > > This probably happens when argv[0] is not an absolute path, but still the= program > somehow got started, but it is not found in $PATH either. The =E2=80=98set_current_prefix=E2=80=99 logic is extremely fragile; it sho= uld readlink from /proc/self/exe on GNU/Linux. But in our case, no relocation happens, so we can just patch it to do: void set_current_prefix (void) { curr_prefix =3D "/gnu/store/=E2=80=A6"; } Ludo=E2=80=99.