larsbrinkhoff / pdp10-its-disassembler

Disassembler and other tools for files in ITS formats
GNU General Public License v2.0
19 stars 13 forks source link

tito.c SIGSEGV faults when accessing a Tymshare tape #163

Closed nigwil closed 6 months ago

nigwil commented 6 months ago

Using tito with 169279.tape results in this output:

$ ./pdp10-its-disassembler/tito -x -Wtape -f 169279.tape Segmentation fault (core dumped)

gdb backtrace:

$ gdb pdp10-its-disassembler/tito core.853650 
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pdp10-its-disassembler/tito...
[New LWP 853650]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by './pdp10-its-disassembler/tito -x -Wtape -f 169279.tape'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055c5b6298693 in write_tape_word (f=0x55c5b782c8f0, word=24696227045) at tape-word.c:384
384   record[reclen++] = word;
(gdb) bt
#0  0x000055c5b6298693 in write_tape_word (f=0x55c5b782c8f0, word=24696227045) at tape-word.c:384
#1  0x000055c5b629544c in write_word (f=0x55c5b782c8f0, word=24696227045) at word.c:140
#2  0x000055c5b628c279 in write_data (data=0x55c5b62acbf8 <block+23384>, size=3739) at tito.c:310
#3  0x000055c5b628c9c3 in process_data (f=0x55c5b782a2a0, word=137438957211) at tito.c:434
#4  0x000055c5b628ca50 in process_file (f=0x55c5b782a2a0, word=137438957211) at tito.c:447
#5  0x000055c5b628ca9d in process_user (f=0x55c5b782a2a0, word=206158171803) at tito.c:457
#6  0x000055c5b628cb2f in process_saveset (f=0x55c5b782a2a0) at tito.c:473
#7  0x000055c5b628ce1c in main (argc=5, argv=0x7ffc40394f78) at tito.c:546
(gdb) print reclen
$1 = -1392377847
(gdb) 
quit

Linux is

$ uname -a Linux nw-Latitude-7420 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ cc --version cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

larsbrinkhoff commented 6 months ago

Should have been fixed by #165.