Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 736601

Summary: app-misc/pax-utils[-python] slightly broken with {binutils,gcc}-config USE="-native-symlinks" (lddtree: line 163: strings: command not found)
Product: Gentoo Linux Reporter: Kent Fredric (IRC: kent\n) (RETIRED) <kentnl>
Component: Current packagesAssignee: Sergei Trofimovich (RETIRED) <slyfox>
Status: RESOLVED FIXED    
Severity: normal CC: toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502    

Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-08-10 10:27:31 UTC
lddtree /usr/bin/perl
perl => /usr/bin/perl (interpreter => /lib64/ld-linux-x86-64.so.2)/usr/bin/lddtree: line 163: strings: command not found

    libperl.so.5.32 => /usr/lib64/libperl.so.5.32
        libdl.so.2 => /lib64/libdl.so.2
            ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
        libm.so.6 => /lib64/libm.so.6
        libcrypt.so.1 => /usr/lib64/libcrypt.so.1
    libc.so.6 => /lib64/libc.so.6


 grep -C10 -nH strings /usr/bin/lddtree 
> /usr/bin/lddtree-150-		[[ -n ${interp} ]] && interp="${ROOT}${interp#/}"
> /usr/bin/lddtree-151-
> /usr/bin/lddtree-152-		if ${LIST} ; then
> /usr/bin/lddtree-153-			[[ -n ${interp} ]] && echo "${interp}"
> /usr/bin/lddtree-154-		else
> /usr/bin/lddtree-155-			printf " (interpreter => ${interp:-none})"
> /usr/bin/lddtree-156-		fi
> /usr/bin/lddtree-157-		if [[ -r ${interp} ]] ; then
> /usr/bin/lddtree-158-			# Extract the default lib paths out of the ldso.
> /usr/bin/lddtree-159-			lib_paths_ldso=$(
> /usr/bin/lddtree:160:				strings "${interp}" | \
> /usr/bin/lddtree-161-				sed -nr -e "/^\/.*lib/{s|^/?|${ROOT}|;s|/$||;s|/?:/?|\n${ROOT}|g;p}"
> /usr/bin/lddtree-162-			)
> /usr/bin/lddtree-163-		fi
> /usr/bin/lddtree-164-		full_interp=${interp}
> /usr/bin/lddtree-165-		interp=${interp##*/}
> /usr/bin/lddtree-166-		# If we are in non-list mode, then we want to show the "duplicate" interp
> /usr/bin/lddtree-167-		# lines -- first the header (interp=>xxx), and then the DT_NEEDED line to
> /usr/bin/lddtree-168-		# show that the ELF is directly linked against the interp.
> /usr/bin/lddtree-169-		# If we're in list mode though, we only want to show the interp once.
> /usr/bin/lddtree-170-		${LIST} && allhits+=",${interp}"
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-11 08:33:02 UTC
Does not happen to me:

$ strings
-bash: strings: command not found

$ lddtree /usr/bin/perl
/usr/bin/perl (interpreter => /lib64/ld-linux-x86-64.so.2)
    libperl.so.5.30 => /usr/lib64/libperl.so.5.30
        libdl.so.2 => /lib64/libdl.so.2
        libm.so.6 => /lib64/libm.so.6
        libcrypt.so.1 => /lib64/libcrypt.so.1
    libc.so.6 => /lib64/libc.so.6

Probably because app-misc/pax-utils[python] installs python implementation:

$ file /usr/bin/lddtree                                                                                                                                                                   
/usr/bin/lddtree: Python script, ASCII text executable
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-08-11 22:57:13 UTC
(In reply to Sergei Trofimovich from comment #1)
> Does not happen to me:
> 
> $ strings
> -bash: strings: command not found
> 
> $ lddtree /usr/bin/perl
> /usr/bin/perl (interpreter => /lib64/ld-linux-x86-64.so.2)
>     libperl.so.5.30 => /usr/lib64/libperl.so.5.30
>         libdl.so.2 => /lib64/libdl.so.2
>         libm.so.6 => /lib64/libm.so.6
>         libcrypt.so.1 => /lib64/libcrypt.so.1
>     libc.so.6 => /lib64/libc.so.6
> 
> Probably because app-misc/pax-utils[python] installs python implementation:
> 
> $ file /usr/bin/lddtree                                                     
> 
> /usr/bin/lddtree: Python script, ASCII text executable

Confirming I don't have USE="python"
Comment 3 Larry the Git Cow gentoo-dev 2020-08-14 22:17:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=9206a1f79eee279e4171bd2146fc70bff133cb31

commit 9206a1f79eee279e4171bd2146fc70bff133cb31
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-08-14 22:13:32 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-08-14 22:13:32 +0000

    lddtree.sh: drop /lib extraction heuristics
    
    Avoid using 'strings' to extract libpaths.
    Let's use hardcoded fallback values unconditionally
    until we get more robust way to fetch default libpath.
    
    Reported-by: Kent Fredric
    Bug: https://bugs.gentoo.org/736601
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 lddtree.sh | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2020-12-19 21:50:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8a71ff746b3b2d48443df0452795166e5a42325

commit d8a71ff746b3b2d48443df0452795166e5a42325
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-12-19 21:49:29 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-12-19 21:50:03 +0000

    app-misc/pax-utils: bump up to 1.2.7
    
    A few chages:
    - drop strings based /lib extraction heuristics
    - new --ldcache variable to redirect path to ld.so.cache
      (mostly for tests)
    
    Closes: https://bugs.gentoo.org/736601
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 app-misc/pax-utils/Manifest               |  1 +
 app-misc/pax-utils/pax-utils-1.2.7.ebuild | 78 +++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)