Re: [open-cobol-list] [GNU Cobol 2.0] crash on Solaris (sparc) while exe
From:
Paul . Meinhardt
Subject:
Re: [open-cobol-list] [GNU Cobol 2.0] crash on Solaris (sparc) while executing SET ADDRESS OF Y2 UP BY 4
Date:
Thu, 18 Dec 2014 07:53:22 +0100
Hi Sergey,
thanks for your response. Can you create
the tickets for me. It seems that I am not allowed to do so.
Best Regards
Paul Meinhardt
(Development)
From:
Sergey Kashyrin <address@hidden>
To:
address@hidden,
address@hidden
Date:
17.12.2014 20:41
Subject:
Re: [open-cobol-list]
[GNU Cobol 2.0] crash on Solaris (sparc) while executing SET ADDRESS OF
Y2 UP BY 4
the following small program causes a crash (Signal SIGSEGV) on Solaris
(sparc). The same program runs without problems on Windows and shows the
expected results.
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
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 XX.
02 XX-1
PIC X(4) VALUE "1234".
02 XX-2
PIC X(4) VALUE "5678".
01 P-XX-1 POINTER.
01 P-XX-2 POINTER.
LINKAGE SECTION.
01 Y2 PIC
X(4).
PROCEDURE DIVISION.
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 '"
Y2 "'"
END-DISPLAY
END-IF
IF ADDRESS OF Y2 NOT= P-XX-2
DISPLAY "Pointer test failed"
END-IF
STOP RUN.
/* LINKAGE SECTION (Items not referenced by USING clause) */
static unsigned char *b_10 = NULL; /*
Y2 */
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
pointer type
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:
uname -a
SunOS sol10d 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Fire-V440
Any suggestions?
Best Regards
Paul Meinhardt
(Development)
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration &
more
Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk