On Fri, 13 Dec 2024 04:29:09 GMT, SendaoYan <s...@openjdk.org> wrote:

>>> better might be to just copy dlinfo.dli_fname into buf
>> 
>> "Something would be very, very broken if this were to fail.", So I think 
>> `perror` maybe better, it will print which file and the reason get realpath 
>> fail.
>
> Should I combine 3 similar 
> issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059))
>  to 1 issue

> `perror` will print the given message accrording the previous `errno` info to 
> stderr, so this change will not change the original behaviour.

What do you mean? The original behavior would not write anything to stderr 
under any circumstance.

Now since the file name comes from a loaded library, I can't possibly imagine 
anything (short of a provoked situation where someone deliberatly removes the 
library after starting the JVM or something like that) that would cause 
realpath to fail. So this is basically just about keeping the compiler quiet.

Had we *really* expected that this could happen, this would not have been an 
accepted solution. Then you'd had to raise an exception, perhaps, and see 
if/how the operation could be retried, what consequences a failure would have, 
etc.

But as I said, in this particular instance, it might be okay.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883520144

Reply via email to