Closed jifffffy closed 5 years ago
It would be interesting to see the contents of the buffer, e.g. log or print the contents in the constructor:
public CashInStatus3(Pointer p) {
this();
System.out.println(Arrays.toString(p.buffer(getSize()).get()));
assignBuffer(p);
}
The error message says WORD wStatus
has a value of 15
, which isn't defined in XFS. You can try to add a enum in CashInStatus.java
with a value of 15
.
The XFS specification also says, wStatus
should be UNKNOWN
when This status is also set if the lpNoteNumberList details are not known or are not reliable.
, which seems to be the case since the other tool does say WFS_CIM_CIUNKNOWN
.
So I don't know what exactly is going on, WORD wStatus
has a value of 15 according to O²Xfs, but this maybe a misinterpretation of the memory contents. But maybe this is the value set by the Service provider - does the value change? And maybe O²XFS should handle this value as UNKNOWN
.
Thank you very much for your quick reply.
I follow what you said. I added a log and add a enum in CashInStatus.java
with a value of 15.
I executed it twice:
1、This time there is no crash, but a java.lang.NullPointerException: Pointer points to NULL
2、The JVM crashed again.
the value is [15, 0, -108, -84, -64, 125, 3, 0, 4, 0, 0, 0]
, I don't know what it means.
Is there any other idea?
I found the error, CashInStatusCommand
requests BANKNOTE_TYPES
instead of CASH_IN_STATUS
. Please pull develop
branch and try again.
Hi, I have tested the modified CashInStatusCommand
with CASH_IN_STATUS
, there isn't crash the JVM, thanks very much.
But I still get a null pointer error. I find the error is in NoteNumberList3#set
. If numOfNoteNumbers
is 0, no need to set noteNumber
.
if I check the noteNumber
value, the error is gone.
protected void set(NoteNumberList3 copy) {
numOfNoteNumbers.set(copy.getNumOfNoteNumbers());
if(numOfNoteNumbers.get() > 0) {
noteNumber.pointTo(new NoteNumber3Array(copy.getNoteNumber()));
}
}
and the NoteNumberList3#getNoteNumber
is also modify . I change it like this:
public NoteNumber3[] getNoteNumber() {
if(getNumOfNoteNumbers() == 0) {
return null;
}
return new NoteNumber3Array(noteNumber, getNumOfNoteNumbers()).get();
}
When I execute CashInStatusCommand every time, the JVM crashed and generate the following log:
this is the error file: https://github.com/sunyuyangg555/O2Xfs/blob/057ebbe84a70e36149e846e2f406e31ce94e0f8e/hs_err_pid_4064.txt#L1
I debug the code and find this function https://github.com/sunyuyangg555/O2Xfs/blob/057ebbe84a70e36149e846e2f406e31ce94e0f8e/at.o2xfs.win32/src/main/java/at/o2xfs/win32/Struct.java#L72 crash the jvm when it finishs.
this is another tool's result:
wStatus: WFS_CIM_CIUNKNOWN (4) usNumOfRefused: 0 NoteNumberList usNumOfNoteNumbers: 0 lpszExtra: NULL
so how can I fix this error? thanks!