Getting a reference to unallocated memory when trying to read an indexed file. A simple test program is able to write a few records to new indexed file but attempts to read them will cause the memory reference error.
Test program fails when the env variable DB_HOME is defined.
Test program run when DB_HOME is not defined.
Compiler configure: ./configure --with-curses=curses --prefix /home/rinn/cobol
host is AIX 7.2
All tests are successful.
compiled test program: cobc -ftraceall -x -t test1.lst test1.cbl
Have traced the error to the last 2 statements in the fileio routine set_dbt.
Getting a reference to unallocated memory when trying to read an indexed file. A simple test program is able to write a few records to new indexed file but attempts to read them will cause the memory reference error.
Test program fails when the env variable DB_HOME is defined.
Test program run when DB_HOME is not defined.
Compiler configure: ./configure --with-curses=curses --prefix /home/rinn/cobol
host is AIX 7.2
All tests are successful.
compiled test program: cobc -ftraceall -x -t test1.lst test1.cbl
Have traced the error to the last 2 statements in the fileio routine set_dbt.
mvsx1:/home/njdev/utl# env |grep DB_HOME
DB_HOME=/home/njdev/agfiles
mvsx1:/home/njdev/utl#
mvsx1:/home/njdev/utl# test1
open output status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
close status: 00
input open status: 00
test1.cbl:49: attempt to reference unallocated memory (signal SIGSEGV)
libcob: test1.cbl:49: warning: implicit CLOSE of TEST-FILE ('test-file')
Last statement of TEST1 was at line 49 of test1.cbl
mvsx1:/home/njdev/utl# unset DB_HOME
mvsx1:/home/njdev/utl# test1
open output status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
write status: 00
close status: 00
input open status: 00
read status: 00
M01 0001
read status: 00
M01 0002
read status: 00
M01 0003
read status: 00
M01 0004
read status: 00
M01 0005
read status: 00
M01 0006
read status: 00
M01 0007
read status: 00
M01 0008
read status: 00
M01 0009
read status: 00
M01 0010
read status: 10
close status: 00
I think that's [bugs:#701] and the patch found there will solve the issue - please recheck.
Related
Bugs:
#701Looks like that was the issue. Thanks Simon.
Jim