Thread View: linux.debian.bugs.dist
1 messages
1 total messages
Started by Trevor Stone
Tue, 27 Oct 2026 03:40
Bug#1152243: graphviz: gvpr incorrect iteration for arrays indexed by double
Author: Trevor Stone
Date: Tue, 27 Oct 2026 03:40
Date: Tue, 27 Oct 2026 03:40
92 lines
4751 bytes
4751 bytes
Package: graphviz
Version: 2.42.4-3
Severity: normal
X-Debbugs-Cc: debian@trevorstone.org
Dear Maintainer,
The gvpr(1) graphviz scripting language treats arrays as a key-value
data structure. The for loop iterates over an array's indices in
numeric order, while the forr loop iterates in lexicographic order.
The man page says "This can be used for sorting."
When iterating through an array with double indices, Debian trixie's
gvpr can skip entries and pair mismatched keys and values.
This script should print the first five US presidents in order:
#!/usr/bin/env -S gvpr -f
BEGIN {
string presidents[double];
presidents[1.1] = "Washington";
presidents[2.1] = "Adams";
presidents[3.1] = "Jefferson";
presidents[4.1] = "Madison";
presidents[5.1] = "Monroe";
double i;
for (presidents[i]) {
printf("President %f was %s\n", i, presidents[i]);
}
}
Instead, it prints only three keys, out of order. Further, it prints
key 4.1 with the fifth value (Monroe instead of Madison) and key 2.1
with the third value (Jefferson instead of Adams):
President 4.100000 was Monroe
President 1.100000 was Washington
President 2.100000 was Jefferson
If the keys are changed to 1.0, 2.0, 3.0, 4.0, and 5.0 then it only
prints one row, with the wrong key-value pair:
President 1.000000 was Monroe
The output is the same if the variables are declared "float" rather than
"double". It's possible this is related to incorrect handling of 64-bit
integers in bug #1152240.
The program produces the expected output in Ubuntu 24.04 grapvis version
2.42.2-9ubuntu0.1. I didn't run this program before upgrading from
bookworm, but I do have a program which now gets incorrect array
iteration for double indexes:
https://github.com/flwyd/adventofcode/blob/main/2025/day8/day8.gv
Run as 2025/day8/day8.gv -v 2025/day8/input.example.txt
-- System Information:
Debian Release: 13.7
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.6.143-09589-gf9e106250941 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages graphviz depends on:
ii libann0 1.1.2+doc-9+b1
ii libc6 2.41-12+deb13u4
ii libcdt5 2.42.4-3
ii libcgraph6 2.42.4-3
ii libexpat1 2.8.3-1~deb13u1
ii libgcc-s1 14.2.0-19
ii libgd3 2.3.3-14~deb13u1
ii libglib2.0-0t64 2.84.4-3~deb13u5
ii libgts-0.7-5t64 0.7.6+darcs121130-5.2+b1
ii libgvc6 2.42.4-3
ii libgvpr2 2.42.4-3
ii liblab-gamut1 2.42.4-3
ii libstdc++6 14.2.0-19
ii libx11-6 2:1.8.12-1
ii libxaw7 2:1.0.16-1
ii libxmu6 2:1.1.3-3+b4
ii libxt6t64 1:1.2.1-1.2+b2
Versions of packages graphviz recommends:
ii fonts-liberation 1:2.1.5-3
Versions of packages graphviz suggests:
ii graphviz-doc 2.42.4-3
pn gsfonts <none>
-- no debconf information
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads