MaxMind-DB-Reader-java icon indicating copy to clipboard operation
MaxMind-DB-Reader-java copied to clipboard

Unsafe memory access operation

Open Aashima89 opened this issue 3 years ago • 2 comments

Did read through the same error that occurred before, https://github.com/maxmind/MaxMind-DB-Reader-java/issues/81. We are using File Mode as memory mapped. The issue shows up on one of the containers and it fails some calls while passes few.

org.springframework.web.util.NestedServletException: Async processing failed; nested exception is java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod$ConcurrentResultHandlerMethod.lambda$new$0(ServletInvocableHandlerMethod.java:223) at java.base/jdk.internal.reflect.GeneratedMethodAccessor312.invoke(Unknown Source)

Does not look like underlying file was not loaded properly, else no request should have been successful after the failure. Any pointers or the reasoning behind why it occurs and sustains on one of the containers. Was the file reference not correct? but if thats the case none of the requests to resolve ip would have been successful.

For now we had to restart the container to fix the issue.

Aashima89 avatar Dec 14 '21 16:12 Aashima89

Is it possible something is modifying the file after it opens, e.g., is the database being updated? Is the file on a network file system or something like that?

oschwald avatar Dec 14 '21 16:12 oschwald

The file is on EFS and we are just reading from the file. There are no writes. We do replace the file once a week but we are using atomic reference to load it into memory and re-initializing the readers when the file is replaced.

Aashima89 avatar Dec 15 '21 15:12 Aashima89

I am not sure there is much we can do about this. Although it isn't clear exactly what led up to the issue, internal Java errors like this are a risk of using memory mapping. I am going to close this, but I am happy to reopen if there is something that is actionable.

oschwald avatar Nov 17 '23 18:11 oschwald