[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] found a bug in the open-cobol runtime-system (or compi
Christian . Groove . extern
[open-cobol-list] found a bug in the open-cobol runtime-system (or compiler as you like)
Wed Apr 3 06:57:44 2002
A) the situation
I wrote a server (in C), that calls a cobol subprogram. In order to
distinguish between several modes insode the cobol code,
i declared a swith over several modes. The switch is a
SELECTOR PIC 9(4) BINARY.
The call is performed from C by means of a simple "external" function
call and the cobol code is compiled in static and -m mode.
Later i bound both, the C and the COB object files together.
B) what happened
After calling the COBOL subprogram, the application caused a
SEGViolation inside the function __gmpz_set_si().
The stack looks like this:
C) The problem
When calling a sub-program, wether coblib nor the compiled
intermediate C code calls the cob_init_math() function, that
in turns initialize the gmp-functions.
A direct subprogramm call will not initialize a internal stack
for numerics. On this ground cob_decimal_set_int() will
pass an illegal pointer reference to the gmp functions that
cause the crash !!!
C) The solution
I once call cob_init_math() by my own from the c code.
If the compiler would do this for me, then the run-time
system would require an application wide register, that
allows to initialze the registers once for any other
subprograms, or you use a hidden initialize register
targit GmbH bei:
HVB Systems GmbH
Quadriga Haus 3
Apianstr. 2 - 6
Mobile: +49-160-382 6915
- [open-cobol-list] found a bug in the open-cobol runtime-system (or compiler as you like),
Christian . Groove . extern <=