|
From: | Edward Hart |
Subject: | Re: [Bug-GnuCOBOL] gnucobol 2.2 latest download ... sigsegv crash on CLOSE-statement |
Date: | Wed, 20 Sep 2017 18:55:51 +0100 |
Hello Edward :)
Sorry, I use a index/dynamic file ... opening all o.k. , but still on the close statement, the program
crashed. I had used also this version gnu-cobol-2.2 on a cygwin-installation as also ubuntu-16.04 lts gnome.
On both installations (either under windows-10/cywin as ubuntu too) this program crashes on close-statement
on a indexed/dynamic file.Greatings Veit
Am 17.09.2017 um 20:11 schrieb Edward Hart:
Hi Veit,
I'm afraid I can't reproduce the segfault. I tried extending your example to:
>>source freeIDENTIFICATION DIVISION.PROGRAM-ID. prog.
ENVIRONMENT DIVISION.INPUT-OUTPUT SECTION.FILE-CONTROL.SELECT file002 ASSIGN "blah.txt"FILE STATUS IS file002-status.
DATA DIVISION.FILE SECTION.FD file002.01 file002-rec PIC X.
WORKING-STORAGE SECTION.01 zz-errfile PIC X(30).01 file002-status PIC XX.01 zz-error PIC 99.01 zz-errmessage PIC X(100).
PROCEDURE DIVISION.DECLARATIVES.
FILE002-HANDLER SECTION.USE AFTER STANDARD ERROR PROCEDURE ON FILE002.FILE002-ERROR.MOVE "FILE002" TO ZZ-ERRFILE.MOVE FILE002-STATUS TO ZZ-ERROR.CALL "ERROR-MESSAGE" USING ZZ-ERRFILE, ZZ-ERROR, ZZ-ERRMESSAGE.EVALUATE ZZ-ERRORWHEN 35 PERFORMOPEN OUTPUT FILE002CLOSE FILE002OPEN I-O FILE002END-PERFORMEND-EVALUATE.END DECLARATIVES.
display "hello, world!"open input file002close file002.END PROGRAM prog.
Is there something I'm missing?
Also, what command are you using to compile this and what is the output of cobc -info?
Edward
On 17 September 2017 at 18:30, Veit Heise <address@hiddende > wrote:
Hello....
DECLARATIVES.
FILE002-HANDLER SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON FILE002.
FILE002-ERROR.
MOVE "FILE002" TO ZZ-ERRFILE.
MOVE FILE002-STATUS TO ZZ-ERROR.
CALL "ERROR-MESSAGE" USING ZZ-ERRFILE, ZZ-ERROR,
ZZ-ERRMESSAGE.
EVALUATE ZZ-ERROR
WHEN 35 PERFORM
OPEN OUTPUT FILE002
CLOSE FILE002
OPEN I-O FILE002
END-PERFORM
END-EVALUATE.
END DECLARATIVES.
such as example in the source code ends with this crash-message:
artikel01.cob: 171: attempt to reference unallocated memory (signal SIGSEGV)
abnormal termination - file contents may be incorrect
implemented yesterday from latest download on source-forge on ubuntu 16.04-lts-64bit on an
asus Intel® Core™ i7-6700K CPU @ 4.00GHz × 8
Gallium 0.4 on llvmpipe (LLVM 4.0, 256 bits), Ubuntu 16.04.3 LTS 64-Bit
--
Veit Heise, Breslauer Str. 24, D-63477 Maintal Germany Member of ACM, Association for Computer Machinery, Chapter Munich, Germany Member of AFCEA, Armed Forces Communication and Electronics Association, Brussels, Chapter Bonn Member of FREELENS, Bundesvereinig. d. FotojournalistInnen, Hamburg, Germany
--
--
Veit Heise, Breslauer Str. 24, D-63477 Maintal Germany
Member of ACM, Association for Computer Machinery, Chapter Munich, Germany
Member of AFCEA, Armed Forces Communication and Electronics Association, Brussels, Chapter Bonn
Member of FREELENS, Bundesvereinig. d. FotojournalistInnen, Hamburg, Germany
[Prev in Thread] | Current Thread | [Next in Thread] |