Kbase P112828: Application calling C DLL terminates with no stack trace
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  24/01/2006 |
|
Status: Unverified
FACT(s) (Environment):
OpenEdge 10.0B
SYMPTOM(s):
Application is terminated by the Operating System with no messages
No stack trace or protrace files are produced
Application makes many calls to DLLs written in C
CHANGE:
Migrated from 10.0A to 10.0B
CAUSE:
The application was passing integer values to the C routines as a SHORT (2 bytes). The C routines were incorrectly defining the parameter to be an int (4 bytes).
When parameters are pushed onto the stack they are word aligned (i.e. 4 byte alignment) so when the SHORT integer value was pushed onto the stack two more bytes were added to maintain the 4 byte alignment.
In versions of Progress prior to OpenEdge 10.0B these bytes just happened to be zeroes. In 10.0B these bytes are no longer zeroes. Given that we have no control over the layout of data in memory when the Progress executables are compiled it was sheer luck that the padding bytes had been zeroes for so long.
FIX:
Modify either the 4GL code so that a LONG is passed rather than a SHORT or modify the C code so that the parameter is defined as a short rather than an int.