Re: [open-cobol-list] [GNU Cobol 2.0] crash on Solaris (sparc) while exe
Paul . Meinhardt
Re: [open-cobol-list] [GNU Cobol 2.0] crash on Solaris (sparc) while executing SET ADDRESS OF Y2 UP BY 4
Tue, 16 Dec 2014 08:37:56 +0100
thanks for your response. The Solaris problem
is currently not urgent. We can postpone the Solaris version of our software
until the compiler problem is fixed.
Ron Norman <address@hidden>
[GNU Cobol 2.0] crash on Solaris (sparc) while executing SET ADDRESS OF
Y2 UP BY 4
I have verified this is a bug in OpenCOBOL 1.1 and GNUCobol
The program works on x86 but not on Sun due to differences
in the generated code due to hardware differences.
The sample code is correct and does work using Micro Focus
It will just take a bit of time to work up the solution,
test it and post it back.
the following small program causes a crash (Signal SIGSEGV) on Solaris
(sparc). The same program runs without problems on Windows and shows the
prog.cob: 16: Attempt to reference unallocated memory (Signal SIGSEGV)
Abnormal termination - File contents may be incorrect
I used the gnu cobol branch 2.0 r470
PIC X(4) VALUE "1234".
PIC X(4) VALUE "5678".
01 P-XX-1 POINTER.
01 P-XX-2 POINTER.
01 Y2 PIC
SET P-XX-1 TO ADDRESS OF XX-1
SET P-XX-2 TO ADDRESS OF XX-2
SET ADDRESS OF Y2 TO ADDRESS OF XX-1
SET ADDRESS OF Y2 UP BY 4
IF Y2 NOT = XX-2
DISPLAY "Test 2 '"
IF ADDRESS OF Y2 NOT= P-XX-2
DISPLAY "Pointer test failed"
/* LINKAGE SECTION (Items not referenced by USING clause) */
static unsigned char *b_10 = NULL; /*
but the cob_pointer_manip function expects a pointer to a cob_field structure
and therefore f1->data points to nowhere.
During compilation I get the following warnings:
address@hidden: ~/pme-test/cob-address $ cobc -g -x prog.cob
prog.c: In function 'prog_':
prog.c:124:3: warning: passing argument 1 of 'cob_pointer_manip' from incompatible
prog.c.h:33:1: note: expected 'struct cob_field *' but argument is of type
'unsigned char *'
The enclosed ZIP (crash.zip) file contains the sample program and the generated
C source and config.log.zip contains the configure log file.
Some data about my solaris system:
SunOS sol10d 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V440