The data area passed to a system call is too small.
843829Jan 7 2006 — edited Jan 9 2006Hi All,
I am using JNI and Windows native code. In the native code I return the handle to a pointer like this:
return reinterpret_cast<jint> pObj; // pObj is a pointer.
In another JNI method, I pass the integer to the C++ code and re cast it back to the pointer and use it.
This works most of the time, but sometimes the JVM crashes. So I found the code where the crash occurs and wrapped it in a try-catch block. Then I found the error with the GetLastError() method. The error code that is returned is "The data area passed to a system call is too small." I am not sure what this error really means. Microsoft is not much help. My theory is that somehow either the pointer is getting corrupted or the data it points to is. But why would this work in some cases and not others? If I just use the straight C++ code without going through JNI, then it works 100% of the time. So here has to be something going wrong with the JNI access. Does anyone have a clue? Has anyone had a similar issue?
many many thanks,
B