bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-GnuCOBOL] gnucobol 2.2 latest download ... sigsegv crash on CLO


From: Edward Hart
Subject: Re: [Bug-GnuCOBOL] gnucobol 2.2 latest download ... sigsegv crash on CLOSE-statement
Date: Sun, 17 Sep 2017 19:51:28 +0100

Also, is your original program INITIAL?

On 17 September 2017 at 19:11, Edward Hart <address@hidden> wrote:
Hi Veit,

I'm afraid I can't reproduce the segfault. I tried extending your example to:

       >>source free
IDENTIFICATION 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-ERROR
        WHEN 35 PERFORM
            OPEN OUTPUT FILE002
            CLOSE FILE002
            OPEN I-O FILE002
       END-PERFORM
       END-EVALUATE
       .
END DECLARATIVES.

    display "hello, world!"
    open input file002
    close 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]