Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2023 18:20:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 269568] strip(1) creates an executable which crashes in ld-elf.so.1
Message-ID:  <bug-269568-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269568

            Bug ID: 269568
           Summary: strip(1) creates an executable which crashes in
                    ld-elf.so.1
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: tom@hur.st

In updating the sysutils/jdupes port to 1.21.3, I came across a reproducible
crash in the LOW_MEMORY=3D1 executable after it's been stripped:

Process 46048 launched:
'/usr/local/poudriere/ports/default/sysutils/jdupes/work/jdupes-1.21.3/jdup=
es.stripped'
(x86_64)
Process 46048 stopped
* thread #1, name =3D 'jdupes.stripped', stop reason =3D signal SIGSEGV: ad=
dress
access protected (fault address: 0x7fffffffd768)
    frame #0: 0x0000000800211c90 ld-elf.so.1`_rtld [inlined]
init_rtld(mapbase=3D"\U0000007fELF\U00000002\U00000001\U00000001\t",
aux_info=3D0x00007fffffffe100) at rtld.c:2406:5
   2403      * The "path" member can't be initialized yet because string
constants
   2404      * cannot yet be accessed. Below we will set it correctly.
   2405      */
-> 2406     memset(&objtmp, 0, sizeof(objtmp));
   2407     objtmp.path =3D NULL;
   2408     objtmp.rtld =3D true;
   2409     objtmp.mapbase =3D mapbase;

Here's a small script to reproduce the issue more directly:

#!/bin/sh
set -e
test -e jdupes || git clone --depth=3D50 https://github.com/jbruchon/jdupes=
.git
cd jdupes
git checkout v1.21.3
gmake clean all LOW_MEMORY=3D1
strip ./jdupes
lldb ./jdupes

If /usr/local/bin/strip (GNU binutils) is used the crash doesn't occur.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269568-227>