JVM error while querying for events.

Support for the Milan Intelligent interface, sold by Money Controls as the Paylink USB unit and for the earlier PCI card version.

Moderators: aardvark, davebush, Admin

Post Reply
dcabru
Posts: 7
Joined: Tue May 29, 2018 1:52 pm

JVM error while querying for events.

Post by dcabru »

Hi.
I have developped a web application in Java to work in a system where a Paylink is installed.
To monitor the status of the components connected to the Paylink, I look every second for the list of events with the methods provided in the SDK for Java (AESImhei.java).
Specifically I make calls on the methods NextAcceptorEvent, NextDispenserEvent and NextSystemEvent.

The problem is that the application crashes and kills the web server with the following message in the log at an undetermined moment.

Code: Select all

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f83ed49b0a3, pid=32105, tid=0x00007f83dbaac700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_161-b12) (build 1.8.0_161-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.161-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x9960a3]  oopDesc* PSPromotionManager::copy_to_survivor_space<false>(oopDesc*)+0x143
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /root/hs_err_pid32105.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted
This error appears when the application has been running for about 4-24 hours long.

If I comment the methods responsible for checking events, the jvm never crashes, so it must be a problem with AESImhei.NextXXXXXEvent. That's why I'm asking for help in this forum.

The methods that are executed every second are implemented as follows:

Code: Select all

private List<PaySystemComponentEvent> checkAcceptorEvents(int acceptorIndex) {
        AESImhei.EventDetailBlock eventDetailBlock = new AESImhei.EventDetailBlock(); //null = jvm exception
        List<PaySystemComponentEvent> eventCodes = new ArrayList<>();
        EventCode eventCode = EventCode.valueOf(AESImhei.NextAcceptorEvent(acceptorIndex, eventDetailBlock));

        while (!EventCode.IMHEI_NULL.equals(eventCode)) {
            eventCodes.add(toPaySystemComponentEvent(eventCode));
            eventCode = EventCode.valueOf(AESImhei.NextAcceptorEvent(acceptorIndex, eventDetailBlock));
        }

        return eventCodes;
    }

    private List<PaySystemComponentEvent> checkDispenserEvents(int dispenserIndex) {
        AESImhei.EventDetailBlock eventDetailBlock = new AESImhei.EventDetailBlock(); //null = jvm exception
        List<PaySystemComponentEvent> eventCodes = new ArrayList<>();
        EventCode eventCode = EventCode.valueOf(AESImhei.NextDispenserEvent(dispenserIndex, eventDetailBlock));

        while (!EventCode.IMHEI_NULL.equals(eventCode)) {
            eventCodes.add(toPaySystemComponentEvent(eventCode));
            eventCode = EventCode.valueOf(AESImhei.NextDispenserEvent(dispenserIndex, eventDetailBlock));
        }

        return eventCodes;
    }

    private List<PaySystemComponentEvent> checkSystemEvents() {
        AESImhei.EventDetailBlock eventDetailBlock = new AESImhei.EventDetailBlock(); //null = jvm exception
        List<PaySystemComponentEvent> eventCodes = new ArrayList<>();
        EventCode eventCode = EventCode.valueOf(AESImhei.NextSystemEvent(eventDetailBlock));

        while (!EventCode.IMHEI_NULL.equals(eventCode)) {
            eventCodes.add(toPaySystemSystemEvent(eventCode));
            eventCode = EventCode.valueOf(AESImhei.NextSystemEvent(eventDetailBlock));
        }

        return eventCodes;
    }
Here are the host pc specs:
- Operating system: Linux Debian 9 "Stretch"
- JDK/JRE 1.8
- Web server: Wildfly 12.0.0-final


Do you have any idea of what I am doing wrong?

Thank you very much.
davebush
Posts: 492
Joined: Fri Oct 22, 2004 12:20 pm

Re: JVM error while querying for events.

Post by davebush »

Hi,

I've double checked the Paylink code that you are invoking and all memory accesses apart from the EventDetailBlock are to static data. There's no good reason why it should fail after such a long time.

My only idea is that it's an exotic memory assignment problem with either the creation of the EventDetailBlock or the eventCodes list.

Maybe you could leave the methods in your code, but to replace the actual call to AESImhei.NextXXXXXEvent with a simple assignment to the eventCode variable.

If I come up with anything else I'll post again.

Dave
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
Post Reply