AndreasFagschlunger / O2Xfs

Java API for accessing CEN/XFS API, EMV Level 2 Kernel
47 stars 28 forks source link

trouble with ZList and XfsZPointerArray. The problem is in the size of the given pointers #69

Closed VitalyEG closed 6 years ago

VitalyEG commented 6 years ago

Hi, Andreas! I have a trouble with ZList and XfsZPointerArray. These stuctures crash JVM 1.8.31 x86. When I read positions.pointTo(new Positions3(copy.getPositions())); in Status3 of CIM-class and positions.pointTo(new OutputPositions3(copy.getPositions())); in CdmStatus3 of CDM-class.

The problem is in the size of the given pointers. For example, there is an array of 20 bytes instead of 12 bytes. 8, 8, 4 instead of 4, 4, 4. These array contains 2 pointer on structures and NULL-terminate.

AndreasFagschlunger commented 6 years ago

I don't quite understand what the problem is. Both basically say Pointer to a NULL-terminated array of pointers to WFS... structures.. So if you say lppPositions points to a memory with 20 bytes, in a 32 bit environment this would mean 4 Positions (Bytes 1-16) and NULL terminator (16-20).

I don't see how "8,8,4" is even possible, only in a 64 Bit environment, but than also the NULL terminator should have a sizeof 8 bytes.

VitalyEG commented 6 years ago

Perhaps somehow, the results are accumulated with previous requests, if I do not call XfsServiceManager.getInstance (). Shutdown () when the software is shutdown.

VitalyEG commented 6 years ago

I ran several information commands and do not call XfsServiceManager.getInstance (). Shutdown () when the software is shutdown.... and so many times... After a while, errors of this kind began to appear, constantly. When I began to call XfsServiceManager.getInstance (). Shutdown () these problem went away.