Versions: GnuCOBOL 3.2.0 (Ubuntu gnucobol3 3.2-4build1) and 3.3-dev r5751 (CI snapshot 3.3-dev.138 of 2026-10-29), x86_64 Linux. Both re-run 2026-10-30.
Attached: objc.cob (crashes on both versions) and b3.cob (crashes on 3.2.0, refused with an ordinary error on 3.3-dev).
objc.cob:
IDENTIFICATION DIVISION.
PROGRAM-ID. OBJC.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 R1 USAGE OBJECT REFERENCE.
01 R2 USAGE OBJECT REFERENCE.
PROCEDURE DIVISION.
IF R1 = R2 DISPLAY "EQ" ELSE DISPLAY "NE" END-IF
STOP RUN.
3.2.0, cobc -std=cobol2014 -fformat=free -x objc.cob, exit 134 (also with the default dialect):
objc.cob:5: warning: OBJECTS is not implemented [-Wpending]
3 | DATA DIVISION.
4 | WORKING-STORAGE SECTION.
5 > 01 R1 USAGE OBJECT REFERENCE.
6 | 01 R2 USAGE OBJECT REFERENCE.
7 | PROCEDURE DIVISION.
objc.cob:6: warning: OBJECTS is not implemented [-Wpending]
4 | WORKING-STORAGE SECTION.
5 | 01 R1 USAGE OBJECT REFERENCE.
6 > 01 R2 USAGE OBJECT REFERENCE.
7 | PROCEDURE DIVISION.
8 | IF R1 = R2 DISPLAY "EQ" ELSE DISPLAY "NE" END-IF
cobc: unexpected category: 0
cobc: tree.c:1606: internal compiler error
cobc: aborting codegen for objc.cob, last statement at line 8 (PROGRAM-ID: OBJC)
cobc: Please report this!
Aborted
3.3-dev r5751, the same command, exit 139 (also with the default dialect). The internal error is now followed by a segmentation fault:
objc.cob:5: warning: OBJECTS is not implemented [-Wpending]
3 | DATA DIVISION.
4 | WORKING-STORAGE SECTION.
5 > 01 R1 USAGE OBJECT REFERENCE.
6 | 01 R2 USAGE OBJECT REFERENCE.
7 | PROCEDURE DIVISION.
objc.cob:6: warning: OBJECTS is not implemented [-Wpending]
6 > 01 R2 USAGE OBJECT REFERENCE.
7 | PROCEDURE DIVISION.
8 | IF R1 = R2 DISPLAY "EQ" ELSE DISPLAY "NE" END-IF
cobc: unexpected category: 0
cobc: tree.c:1613: internal compiler error
cobc: aborting codegen for objc.cob, last statement at line 8 (PROGRAM-ID: OBJC)
attempt to reference invalid memory address (signal SIGSEGV)
cobc: aborting codegen for objc.cob, last statement at line 8 (PROGRAM-ID: OBJC)
cobc: Please report this!
Segmentation fault
On both versions -fsyntax-only prints only the two warnings and exits 0, so the error is in code generation.
IDENTIFICATION DIVISION.
PROGRAM-ID. OBJREF.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-OBJ USAGE OBJECT REFERENCE.
PROCEDURE DIVISION.
SET WS-OBJ TO NULL
STOP RUN.
3.2.0, cobc -std=cobol2014 -fformat=free -x b3.cob, exit 134 (-fsyntax-only exits 0):
b3.cob:5: warning: OBJECTS is not implemented [-Wpending]
3 | DATA DIVISION.
4 | WORKING-STORAGE SECTION.
5 > 01 WS-OBJ USAGE OBJECT REFERENCE.
6 | PROCEDURE DIVISION.
7 | SET WS-OBJ TO NULL
cobc: unexpected category: 0
cobc: tree.c:1606: internal compiler error
cobc: aborting codegen for b3.cob, last statement at line 7 (PROGRAM-ID: OBJREF)
cobc: Please report this!
Aborted
3.3-dev r5751 refuses it with an ordinary error instead (exit 1, also with -fsyntax-only):
b3.cob:7: error: invalid SET statement
7 > SET WS-OBJ TO NULL
8 | STOP RUN.
9 | <EOF>
So on 3.3-dev only the relation between two object references still reaches the abort.
Both programs are legal COBOL 2002/2014. ISO/IEC 1989:2023:
SET WS-OBJ TO NULL legal.Object orientation is not an optional feature in the standard. Even while it stays unimplemented, the expected result is an error diagnostic, not an internal compiler error.
In cb_tree_category (cobc/tree.c, the CB_TAG_FIELD branch), an elementary item with CB_USAGE_OBJECT has no PICTURE and matches none of the POINTER, PROGRAM-POINTER, PICTURE or external-form arms, so it gets CB_CATEGORY_UNKNOWN (0). cb_tree_type, called from output_attr in cobc/codegen.c for the comparison, then reaches its default arm and aborts. Its CB_CATEGORY_OBJECT_REFERENCE case is never reached for a field. Giving such a field CB_CATEGORY_OBJECT_REFERENCE in cb_tree_category should cover both programs. (Line numbers are from the 3.2 source.)