This report refers to the gnu-cobol-2.0 branch, checked out today from:
svn://svn.code.sf.net/p/open-cobol/code/branches/gnu-cobol-2.0
Under certain conditions, a segmentation fault occurs on line 212 of
libcob/common.c.
A minimal test program (compiled with `cobc -xg test.cbl`):
IDENTIFICATION DIVISION.
PROGRAM-ID. test.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CALL-STATUS BINARY-LONG.
PROCEDURE DIVISION.
CALL "C$COPY"
USING "test.cbl" "copy.cbl" "S"
GIVING CALL-STATUS
END-CALL
GOBACK
.
The output from running the program:
test.cbl: 14 Attempt to reference unallocated memory (Signal
SIGSEGV)
Abnormal termination - File contents may be incorrect
Line 14 is the GOBACK statement. When run in gdb, with a breakpoint
set in cob_exit_common, it can be seen that the seg fault occurs on
the free statement in line 212 of libcob/common.c:
if (cobglobptr->cob_term_buff) {
free (cobglobptr->cob_term_buff);
}
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list