URL: <https://savannah.gnu.org/bugs/?68942>
Summary: [grotty] SEGV on large vertical motion since groff
1.25.0
Group: GNU roff
Submitter: gbranden
Submitted: Sat 21 Nov 2026 07:35:53 PM UTC
Category: Driver grotty
Severity: 4 - Important
Item Group: Crash/Unresponsive
Status: Confirmed
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 21 Nov 2026 07:35:53 PM UTC By: G. Branden Robinson <gbranden>
I think this is the same issue as
[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1153649 Debian #1153649]
but I'm not sure yet. Hoping to get confirmation from Colin.
Exhibit:
$ cat DELTA
x T ascii
x res 240 24 40
x init
p1
x font 1 R
f1
s10
V40
H0
md
DFd
tA
v16000
tB
n40 0
x trailer
V2640
x stop
$ ~/groff-1.25.0/bin/grotty DELTA
Segmentation fault (core dumped)
$ ./build/grotty DELTA
=================================================================
==21454==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x619000001c00 at pc 0x55ca0526ee5d bp 0x7ffd6c338de0 sp 0x7ffd6c338dd8
READ of size 8 at 0x619000001c00 thread T0
#0 0x55ca0526ee5c in tty_printer::add_char(unsigned int, int, int, int,
color*, color*, unsigned char) ../src/devices/grotty/tty.cpp:474
#1 0x55ca0527507a in tty_printer::set_char(glyph*, font*, environment
const*, int, char const*) ../src/devices/grotty/tty.cpp:395
#2 0x55ca05276650 in printer::set_ascii_char(unsigned char, environment
const*, int*) ../src/libs/libdriver/printer.cpp:222
#3 0x55ca0527c74f in interpret_troff_output_file(char const*)
../src/libs/libdriver/input.cpp:1792
#4 0x55ca05282e19 in main ../src/devices/grotty/tty.cpp:1154
#5 0x7f96b9a45249 in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
#6 0x7f96b9a45304 in __libc_start_main_impl ../csu/libc-start.c:360
#7 0x55ca05260580 in _start
(/home/branden/src/GIT/groff/build/grotty+0x1f580)
0x619000001c00 is located 2144 bytes to the right of 1056-byte region
[0x619000000f80,0x6190000013a0)
allocated by thread T0 here:
#0 0x7f96ba0b9628 in operator new[](unsigned long)
../../../../src/libsanitizer/asan/asan_new_delete.cpp:98
#1 0x55ca0526e925 in tty_printer::add_char(unsigned int, int, int, int,
color*, color*, unsigned char) ../src/devices/grotty/tty.cpp:431
SUMMARY: AddressSanitizer: heap-buffer-overflow
../src/devices/grotty/tty.cpp:474 in tty_printer::add_char(unsigned int, int,
int, int, color*, color*, unsigned char)
Shadow bytes around the buggy address:
0x0c327fff8330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8360: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8370: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c327fff8380:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff8390: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff83a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff83b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff83c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c327fff83d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==21454==ABORTING
Does not affect older versions of _groff_. I think I know what the problem
is, and when I introduced it.
$ ~/groff-1.24.0/bin/grotty DELTA | cat -s
A
B
Setting Severity to Important as it's a crasher, and also worth backporting to
an eventual 1.25.x branch.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68942>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
