Possible bug in jdk.naming.dns. I need guidance on how get someone smarter to look at it.

Marko Bakšić Marko.Baksic at infobip.com
Wed Sep 4 14:02:38 UTC 2024


Thank you Daniel.

The part that was suspicious to me is

```
int timeoutLeft = pktTimeout;
do {
      ...
      timeoutLeft = pktTimeout - ((int) (end - start));
} while (timeoutLeft > MIN_TIMEOUT);
```

Here, timeoutLeft is not iteratively decreased, but is always derived from `pktTimeout`.
I can see a case where `timeoutLeft` never drops below `MIN_TIMEOUT` (this is the part where I'm not sure if I'm missing some deeper knowledge).

Kind regards,
-- Marko



[cid:Infobip_logo_vertical_signature_e28e13d2-255b-4571-a70c-8292f2d75c0b.png]

Marko Bakšić

Software Engineer


E Marko.Baksic at infobip.com

M


A Utinjska 29A, 10000 Zagreb, Croatia

www.infobip.com<http://www.infobip.com>







________________________________
From: Daniel Fuchs <daniel.fuchs at oracle.com>
Sent: Wednesday, September 4, 2024 15:27
To: Marko Bakšić <Marko.Baksic at infobip.com>
Subject: [EXTERNAL] Re: Possible bug in jdk.naming.dns. I need guidance on how get someone smarter to look at it.

Hi Marko,

This is not the proper list for this kind of question:
I'm moving the discussion to core-libs-dev at openjdk.org.

There's definitely a bug here: that code should use
System.nanoTime() and not System.currentTimeMillis()
since the latter is not guaranteed to be monotonic.

It may not explain the issue you are observing, but
again, it may cause the timeout to punctually increase.

I have logged
https://bugs.openjdk.org/browse/JDK-8339538

I wonder if that has an impact on what you are observing.

best regards,

-- daniel

On 04/09/2024 13:50, Marko Bakšić wrote:
> Hey there!
>
> Sorry for coming here with a technical question, but I would appreciate
> if you could point me in the right direction.
>
> We experienced a bug in production a few times already and through
> profiling we suspect it is an infinite loop here:
> https://github.com/openjdk/jdk/blob/master/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java#L475 <https://github.com/openjdk/jdk/blob/master/src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java#L475>
>
> I came here before opening a bug report, because I'm not sure I am
> right. We haven't been able to reproduce the bug in a dev environment.
> Before spending much more time trying to reproduce this, I was hoping
> someone smarter could give me a hint if this is even the right direction.
>
> If no one here can help, I'd appreciate if you could point me in a
> direction of somewhere where I could have a casual discussion about
> this, or get some more eyes on this.
>
> Thank you very much.
>
> -- ​Marko
>
>
>
>
> *Marko Bakšić*
>
> Software Engineer
>
>
>
> *E *Marko.Baksic at infobip.com
>
> *M*
>
>
>
> *A *Utinjska 29A, 10000 Zagreb, Croatia
>
> www.infobip.com<http://www.infobip.com>
>
> <https://www.infobip.com/news/infobip-named-to-fast-companys-annual-list-of-the-worlds-most-innovative-companies-of-2024>
>
> <https://www.facebook.com/infobip>
> <https://www.linkedin.com/company/infobip>
> <https://twitter.com/Infobip>  <https://www.instagram.com/infobip/>
> <https://www.youtube.com/channel/UCUPSTy53VecI5GIir3J3ZbQ>
>
> *GSMA Associate Member*
> This email message and any attachments are intended solely for the use
> of the addressee. If you are not the intended recipient, you are
> prohibited from reading, disclosing, reproducing, distributing,
> disseminating or otherwise using this transmission. If you have received
> this message in error, please promptly notify the sender by reply email
> and immediately delete this message from your system. This message and
> any attachments may contain information that is confidential, privileged
> or exempt from disclosure. Delivery of this message to any person other
> than the intended recipient is not intended to waive any right or privilege.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240904/60a58161/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2551 bytes
Desc: Infobip_logo_vertical_signature_e28e13d2-255b-4571-a70c-8292f2d75c0b.png
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240904/60a58161/attachment-0001.png>


More information about the core-libs-dev mailing list