|
From: | Márcio Conceição Goulart |
Subject: | Re: [GnuCOBOL 3.1-rc1] testsuite: 696 failed |
Date: | Sat, 19 Dec 2020 12:42:14 -0300 |
cobc (GnuCOBOL) 3.1.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
Este programa é livre; ver a origem para condições de cópia. NÃO existe
garantia; nem sequer para COMERCIALIZAÇÃO ou ADEQUAÇÃO A UM DETERMINADO FIM.
Escrito por Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Compilado em: Dec 19 2020 11:55:19
Empacotado em: Dec 08 2020 22:56:13 UTC
C version "7.5.0"
build information
build environment : x86_64-pc-linux-gnu
CC : gcc
C version : "7.5.0"
CPPFLAGS :
CFLAGS : -O2 -pipe -finline-functions -fsigned-char
-Wall -Wwrite-strings -Wmissing-prototypes
-Wno-format-y2k
LD : /usr/x86_64-suse-linux/bin/ld -m elf_x86_64
LDFLAGS : -Wl,-z,relro,-z,now,-O1
GnuCOBOL information
COB_CC : gcc
COB_CFLAGS : -pipe -I/usr/local/include -Wno-unused
-fsigned-char -Wno-pointer-sign
COB_DEBUG_FLAGS : -ggdb3 -fasynchronous-unwind-tables
COB_LDFLAGS :
COB_LIBS : -L/usr/local/lib64 -lcob -lm
COB_CONFIG_DIR : /usr/local/share/gnucobol/config
COB_COPY_DIR : /usr/local/share/gnucobol/copy
COB_MSG_FORMAT : GCC
COB_OBJECT_EXT : o
COB_MODULE_EXT : so
COB_EXE_EXT :
64bit-mode : yes
BINARY-C-LONG : 8 octetos (bytes)
endianness : little-endian
native EBCDIC : não
entrada/saída de ecrã : ncursesw
variable file format : 0
sequential file handler : integrado
indexed file handler : BDB
mathematical library : GMP
XML library : libxml2
JSON library : json-c
Hello Edward,"p errno" wasn't 0, as follows:Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f217855f1a1 in read () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.26-lp152.25.10.x86_64 libdb-4_8-debuginfo-4.8.30-lp152.8.73.x86_64 libgmp10-debuginfo-6.1.2-lp152.5.26.x86_64 libncurses6-debuginfo-6.1-lp152.7.67.x86_64
(gdb) b fileio.c:3202
Breakpoint 1 at 0x7f2178b98be7: file fileio.c, line 3202.
(gdb) c
Continuing.
Breakpoint 1, indexed_file_delete (f=0xdbaac0, filename=0xdb7230 "testfile") at fileio.c:3202
3202 for (i = 0; i < f->nkeys; ++i) {
(gdb) p filename
$1 = 0xdb7230 "testfile"
(gdb) p errno
$2 = 2
(gdb) n
3203 if (i == 0) {
(gdb) n
3204 snprintf (file_open_buff, (size_t)COB_FILE_MAX, "%s",
(gdb) n
3210 file_open_buff[COB_FILE_MAX] = 0;
(gdb) n
3211 unlink (file_open_buff);
(gdb) p errno
$3 = 2
(gdb) q
A debugging session is active.
Inferior 1 [process 5239] will be detached.
Quit anyway? (y or n) y
Detaching from program: /home/marcio/Downloads/gnucobol-3.1-rc1/tests/testsuite.dir/0696/prog, process 5239
[Inferior 1 (process 5239) detached]
marcio@lentium:~/Downloads/gnucobol-3.1-rc1/tests/testsuite.dir/0696>DISPLAYs of the prog:marcio@lentium:~/Downloads/gnucobol-3.1-rc1/tests/testsuite.dir/0696> ./prog
STATUS WRITE:48
STATUS DELETE FILE (closed):35
marcio@lentium:~/Downloads/gnucobol-3.1-rc1/tests/testsuite.dir/0696>I don't know the cause of FILE-STATUS 48 on WRITE clause too.Let me know if I can help.Att.Márcio.Em dom., 9 de ago. de 2020 às 14:58, Edward Hart <edward.dan.hart@gmail.com> escreveu:Hi Márcio,Thanks for the report!Would you be able to donate some time to debugging it? I'd be very grateful if you could; all you should need is to install the debugger GDB (if it isn't already on your system) and hopefully 20 minutes at most. Here's a step-by-step guide:If you are free to do this, let me know if the instructions work and what the output is for steps 15, 17 and 18.
- In the GnuCOBOL source directory, run ./configure with the --enable-debug flag (and any other flags you needed for compilation).
- Run make.
- cd to ./tests
- Run ". atconfig && . atlocal" (to temporarily make the terminal command cobc point to the compiler that's just been built in the source directory).
- cd to ./testsuite.dir/0696.
- Edit prog.cob to insert ACCEPT OMITTED at the start of the procedure division.
- Run "cobc -x -g -debug ./prog.cob"
- Start the prog executable, but do not press enter to terminate the ACCEPT.
- In another terminal, attach the GDB debugger to prog: "sudo gdb -p $(pidof prog)" (sudo is needed (at least for me) because the program is paused and waiting for input, so the debugger needs access to system debugging symbols).
- You will be prompted with a list of debugging symbols GDB will load; we don't care about this. To continue, press "c".
- Enter "b fileio.c:3202". This will set a breakpoint in the function indexed_file_delete, specifically at the start of the loop which deletes all the files for a BDB INDEXED file.
- Enter "c" in GDB.
- Switch to the terminal with prog and press enter to allow it to run.
- Switch back to GDB. The breakpoint should have triggered.
- In GDB, enter "p filename" to print the contents of the variable filename. GDB should output something like '$1 = 0x555555573e10 "testfile"'
- Check that the testsuite.dir/0696/ directory now contains a file named testfile.
- In GDB, enter "p errno". GDB should show that errno is 0: '$2 = 0'.
- Step forward a line by entering "n". Step forward repeatedly until you have passed the line "unlink (file_open_buff)". Enter "p errno" again and confirm it is still zero.
- You can stop debugging here. Enter q to quit GDB.
EdwardOn Sat, 8 Aug 2020 at 13:59, Márcio Conceição Goulart <marcio.goulart@gmail.com> wrote:Hi there,I installed GnuCOBOL 3.1 with zypper but I was getting strange compile time erros on a program that used to work fine with 2.1 version. So I decided to compile it from the sources.I'm sending the testlog after an error on 'make check'. Despite having experience with COBOL, I only know the basics of C and I don't know the cause of the error and how to investigate it myself. It would be my pleasure to help somehow.Best regards,Márcio.
[Prev in Thread] | Current Thread | [Next in Thread] |