public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
	Adhemerval Zanella via Libc-help <libc-help@sourceware.org>
Cc: N <dundir@gmail.com>
Subject: Re: Bug Report: ldd introduces non-deterministic behavior in subsequent piped commands
Date: Tue, 12 Jul 2022 07:40:29 -0300	[thread overview]
Message-ID: <3a73adb0-5e98-30aa-bbfc-646e30ab4c47@linaro.org> (raw)
In-Reply-To: <87sfn71oh2.fsf@oldenburg.str.redhat.com>



On 11/07/22 15:41, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-help:
> 
>> Although I do not characterize this as a bug, since it represents the
>> ELF objects are already being loaded by the kernel, it is already
>> done since d7703d3176d225d5743b21811d888619eba39e82 (to be included
>> in 2.36):
>>
>> $ LD_TRACE_LOADED_OBJECTS=1 ./elf/ld-linux-x86-64.so.2 /bin/true
>>          linux-vdso.so.1 => linux-vdso.so.1 (0x00007fff4c1d1000)
>>          libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7e75469000)
>>          /lib64/ld-linux-x86-64.so.2 => ./elf/ld-linux-x86-64.so.2 (0x00007f7e756ba000)
>>
>> Using LD_TRACE_LOADED_OBJECTS=2 also prints the binary itself:
>>
>> $ LD_TRACE_LOADED_OBJECTS=2 ./elf/ld-linux-x86-64.so.2 /bin/true
>>          /bin/true => /bin/true (0x00007f0aebc1c000)
>>          linux-vdso.so.1 => linux-vdso.so.1 (0x00007ffc0f9b3000)
>>          libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0aeb9d3000)
>>          /lib64/ld-linux-x86-64.so.2 => ./elf/ld-linux-x86-64.so.2 (0x00007f0aebc24000)
>>
>> And now that you brought it, I wonder if this would case some disruption.
>> I think we might need to filter this out to keep the current lld behavior,
>> I am not sure.
> 
> Should we always print the soname on the LHS (except maybe when printing
> the main executable)?  /lib64/ld-linux-x86-64.so.2 is a bit of an
> outlier because it's not the soname, but its default installation path.

The LHS for loader does make sense if the loader is issued manually
(as per testrun.sh for instance), although it is not usual.  What
does not make much sense is printing the vDSO path, but since the
idea is keep all the entries in same format I don't see it as a deal
breaker.

I am more worried about the possible breakage of LD_TRACE_LOADED_OBJECTS
consumers.

      reply	other threads:[~2022-07-12 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  1:28 N
2022-07-11 18:21 ` Adhemerval Zanella
2022-07-11 18:41   ` Florian Weimer
2022-07-12 10:40     ` Adhemerval Zanella Netto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a73adb0-5e98-30aa-bbfc-646e30ab4c47@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=dundir@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).