Kbase P166033: Progress client crashes when calling XStream_Write method of XAM API
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/14/2010 |
|
Status: Unverified
SYMPTOM(s):
Progress client crashes when calling XStream_Write method of XAM API
Stack trace from fpos32.dll reads:
fp_newTmpfile
FPTag::prefetchData
ABL procedure signature for XStream_Write:
PROCEDURE EXTERNAL {&XAMDLL} CDECL PERSISTENT:
DEFINE INPUT PARAMETER xamStream AS INT64.
DEFINE INPUT PARAMETER xamBuffer AS MEMPTR.
DEFINE INPUT PARAMETER xamInputBytes AS LONG.
DEFINE OUTPUT PARAMETER xamOutBytes AS LONG.
DEFINE RETURN PARAMETER xamRetval AS LONG.
END PROCEDURE.
XStream_Write procedure is called as follows:
RUN XStream_Write(INPUT XStream, INPUT obsah, INPUT insize, OUTPUT outsize, OUTPUT retval).
XStream is defined as:
DEFINE VARIABLE XStream AS INTEGER NO-UNDO.
Setting XStream to 0 or 1 prevents the crash, although the library returns error 1005 (invalid xstream_handle)
FACT(s) (Environment):
Using XAM libraries from EMC Centera
XStream_Write method signature from XAM documentation is:
XStream_Write (
const xstream_handle inHandle,
const char* const inBuffer,
const xam_int inByteCount,
xam_int* const outByteWritten
);
Referring to xam_types.h (as the customer instructed), these types are:
xstream_handle __int64
xam_int __int64
OpenEdge Category: Language (4GL/ABL)
OpenEdge 10.1B
OpenEdge 10.1C
OpenEdge 10.2x
Windows
CAUSE:
XAM library causes the Progress client to crash as a result of using iincorrect data-types are used in the ABL procedure signature. The XAM library expects an INT64-based value rather than a INTEGER-/LONG-based value. As a result, only 4 bytes are passed instead of 8. The DLL still extracted 8 bytes from the stack, meaning the number of input bytes is very much larger than intended.
FIX:
Modify the ABL procedure signature to use the data-type expected by the XAM library:
PROCEDURE XStream_Write EXTERNAL {&XAMDLL} CDECL PERSISTENT:
DEFINE INPUT PARAMETER xamStream AS INT64.
DEFINE INPUT PARAMETER xamBuffer AS MEMPTR.
DEFINE INPUT PARAMETER xamInputBytes AS INT64.
DEFINE OUTPUT PARAMETER xamOutBytes AS INT64.
DEFINE RETURN PARAMETER xamRetval AS LONG.
END PROCEDURE.