This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use correct exit status in ldd (bug 24150)


On 2/3/20 11:52 AM, Andreas Schwab wrote:
> On Feb 03 2020, Carlos O'Donell wrote:
> 
>> On 2/3/20 10:58 AM, Andreas Schwab wrote:
>>> On Feb 03 2020, Carlos O'Donell wrote:
>>> 
>>>> If all rtld in ${RTLDLIST} are non-executable this will cause
>>>> the script to return success when it should not.
>>> 
>>> Why should it not?
>> 
>> It is an error if the script has an internal error (lack of
>> executable helper program i.e. ld.so) and cannot carry out the
>> requested user function.
> 
> This is not unlike any shared library including ld.so itself where
> ldd returns sucessful. This case wasn't intended to be an error,
> otherwise the message would have been formatted as an error.

We should derive what is or is not an error from first principles
based on a desire to maintain compatibility with existing scripts
and to do what is logical for ldd.

If all rtld in ${RTLDLIST} are non-executable then I think we should
return a non-zero exit code. We did not do what the user asked and
so this is a failure. It is also a relatively obscure corner case
so I am not that worried.

It is less clear what should happen in the case of your patch where
the user-requested file is not something that ldd can process and so
there is nothing to do. In that case I'm arguing that we should have
a strong reason to change this since it has the potential to impact
existing scripts written to use ldd.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]