bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [GnuCOBOL 3.1-rc1] testsuite: 696 failed


From: Márcio Conceição Goulart
Subject: Re: [GnuCOBOL 3.1-rc1] testsuite: 696 failed
Date: Sun, 9 Aug 2020 17:21:47 -0300

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:
  1. In the GnuCOBOL source directory, run ./configure with the --enable-debug flag (and any other flags you needed for compilation).
  2. Run make.
  3. cd to ./tests
  4. Run ". atconfig && . atlocal" (to temporarily make the terminal command cobc point to the compiler that's just been built in the source directory).
  5. cd to ./testsuite.dir/0696.
  6. Edit prog.cob to insert ACCEPT OMITTED at the start of the procedure division.
  7. Run "cobc -x -g -debug ./prog.cob"
  8. Start the prog executable, but do not press enter to terminate the ACCEPT.
  9. 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).
  10. You will be prompted with a list of debugging symbols GDB will load; we don't care about this. To continue, press "c".
  11. 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.
  12. Enter "c" in GDB.
  13. Switch to the terminal with prog and press enter to allow it to run.
  14. Switch back to GDB. The breakpoint should have triggered.
  15. In GDB, enter "p filename" to print the contents of the variable filename. GDB should output something like '$1 = 0x555555573e10 "testfile"'
  16. Check that the testsuite.dir/0696/ directory now contains a file named testfile.
  17. In GDB, enter "p errno". GDB should show that errno is 0: '$2 = 0'.
  18. 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.
  19. You can stop debugging here. Enter q to quit GDB.
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.

Edward

On 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.

reply via email to

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