-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal error with gaih_inet.constprop #410
Comments
What would be the best place to report this bug? The problem isn't just limited to Adoptium JDK 17, but also to Azul JDK 17, but doesn't occur in JDK 15. |
Have you tried with 17.0.2? |
I'll give 17.0.2 a try and report back when it crashes. (The production server will usually crash within a week. I haven't used JDK 17 anymore since I reported this issue.) |
I haven't seen the problem anymore, since the upgrade from 17.0.1_12 to 17.0.2_8, so from my perspective it seems that something was fixed in the JDK 👍 |
I encountered the same problem in jdk 1.8.0_302,But I don't know how to solve it because it is difficult to reproduce |
Summary
Since one of our Tomcat websites upgraded to JDK 17 from JDK15, there are random fatal JVM crashes on daily/weekly basis. These crashes occur under both Azul JDK 17 and Adoptium JDK 17.
The causing code uses
java.net.InetAddress
to resolve a hostname from a given IP address, and then performs a reverse lookup to see if the given hostname is correct (not spoofed). The hostname is correct if the IP found in the reverse lookup matches the original given IP address.This code runs for every new IP address that accesses the website, which can be about one to three times per second. Because of concurrency, a hostname lookup can happen multiple times in parallel for a single IP-address (this should be improved to only perform one lookup), until the hostname is resolved and stored in a MongoDB database.
When a HTTP requests for a new IP address comes in, the hostname resolving code runs in a separate threads using Reactor.
Because of this problem, I have logged all resolved IP addresses and hostnames, so that I have timestamps.
Currently, I don't think that a single IP-address is causing these crashes, although I haven't fully analyzed it. I think is more like a threading or concurrency problem inside or outside the JVM, which makes it difficult to reproduce.
I don't know how to fully interpret the attached error report, but it seems that one of the methods calls to
java.net.InetAddress
fails internally. The used methods calls are:InetAddress.getByName(String)
InetAddress.getCanonicalHostName()
InetAddress.getHostAddress()
One of these methods internally calls the native Java method
Inet6AddressImpl.lookupAllHostAddr(hostname, characteristics)
Which then calls native code of getaddrinfo (known as "gai"), after which the
gaih_inet.constprop
problem occurs.Steps to reproduce
I haven't found a way yet to reproduce this problem. It happens in an environment with multiple threads and clients. Simply running to code against a list of IP-addresses, isn't enough.
Triaging info
Java version:
Other specs:
Machine: a VPS
OS: CentOS Stream release 8
JDK: OpenJDK Runtime Environment Temurin-17.0.1+12
Tomcat: Apache Tomcat 9.0.54
Spring Framework boot-depencencies 2.6.0
Languages: Java mixed with Kotlin 1.6.0
Spring Reactor 3.4.8
How did you install Java?
I used: https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz
Did it work before?
Yes, under JDK 15 and lower.
Source code
Partial Error report
The full error report is: errorreport.txt
The error reports always look very similar. Always with this line:
C [libc.so.6+0xe53a1] gaih_inet.constprop.7+0x311
The text was updated successfully, but these errors were encountered: