[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] bug report: SIGSEGV in GOBACK
From: |
Matthew Fisher |
Subject: |
[open-cobol-list] bug report: SIGSEGV in GOBACK |
Date: |
Sat, 23 Nov 2013 20:48:13 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 |
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);
}
- [open-cobol-list] bug report: SIGSEGV in GOBACK,
Matthew Fisher <=