Skip to content

stderr: C warnings the port does not print (unknown port, HTML attributes, unplaced labels, rankset/cluster, ortho labels, touching nodes, multispline failures, printpath dump)

Kind
Port bug
Severity
low
Engine
all
Category
error-path
Cases
0
Seeds
·
Tracking
GitHub issue
Labels
fidelity

C prints several agwarningf warnings (and one agerrorf follow-up dump) that the port leaves out. The output and exit status are the same; only stderr differs. Each warning is a small change on its own, and they are grouped here as one checklist.

Reproducer

graph G {
 splines=none
 a [xlabel=q, label=<<TABLE FOO="1"><TR><TD>x</TD></TR></TABLE>>]
 a:nosuch -- b [label=x]
}
GVBINDIR=<pango-free plugins> dot -Tsvg repro.gv
graphviz-pure -Tsvg repro.gv

C output vs port

--- c.stderr
+++ rust.stderr
-Warning: Illegal attribute FOO in <TABLE> - ignored
-in label of node a
-Warning: node a, port nosuch unrecognized
-Warning: no position for edge with label x

Root cause (checklist)

  • Unknown port name: unrecognized() (lib/common/shapes.c:362-365), called from poly_port (shapes.c:2909-2910) and record_port (shapes.c:3751-3752) when compassPort returns true. Also covers record_port's unrecognized compass point '%s' - ignored (shapes.c:3748-3749). In the port, compass_port returns that flag (crates/graphviz-pure-layout/src/common/ports.rs:126), but the callers at ports.rs:385 and ports.rs:407 ignore it. C warns once per port resolution, so the number of repeats should follow C's call sites.
  • HTML attribute warnings: doAttrs (lib/common/htmllex.c:540-552) warns Illegal attribute %s in %s - ignored and sets warn, and make_label then adds in label of <kind> <name>. The port's HTML parser (crates/graphviz-pure-geom/src/html_label.rs, see parse_html_report at line 1417 and the in label of handling at line 2105) reports only fatal HTML errors. Value warnings (Illegal value ...) in the same table should be checked too.
  • Unplaced edge labels: addXLabels (lib/common/postproc.c:500-504, 517, 532, 547) warns no position for edge with label|tail label|head label|xlabel %s when an unset label's edge has no spline (here splines=none together with a node xlabel, so addXLabels runs). The port skips the edge silently at crates/graphviz-pure-layout/src/common/xlabels.rs:878-881.
  • printpath dumps: after in checkpath, box N has LL coord > UR coord (lib/common/routespl.c:652-663), C prints the box list and port tangents (printpath, routespl.c:758-771). The port prints the error line but not the dump (crates/graphviz-pure-layout/src/common/routespl.rs:412). No reproducer was found in the corpus or the fuzz cases.
  • Rankset nodes removed from a cluster: "%s was already in a rankset, deleted from cluster %s" (lib/dotgen/cluster.c:318-320, mark_clusters). Fixed with issue #23: mark_clusters in crates/graphviz-pure-layout/src/dotgen/cluster.rs prints it. Seen in fuzz seeds 10107, 21064 and 31463.
  • Empty clusters: "removing empty cluster" (lib/dotgen/mincross.c:346). Fixed with issue #19: dot_mincross prints it.
  • Ortho with edge labels: "Orthogonal edges do not currently handle edge labels. Try using xlabels." (lib/ortho/ortho.c:1199). Fixed with issue #11.
  • Touching nodes in the neato-family router: "the bounding boxes of some nodes touch - falling back to straight line edges" and "some nodes with margin (%.02f,%.02f) touch - falling back to straight line edges" (lib/neatogen/neatosplines.c:623, :625). Reproduced with graph G { layout=neato; splines=true; a [pos="0,0!"]; b [pos="0.1,0!"]; c [pos="2,0!"]; a -- c; }: C warns, the port prints nothing. Only fdp's compoundEdges: nodes touch variant is handled (crates/graphviz-pure-layout/src/fdpgen/clusteredges.rs:220).
  • Failed multispline routes: "Could not create control points for multiple spline for edge (%s,%s)" (lib/neatogen/multispline.c:703, :723, :740, :759, :778). Ported with the record-obstacle fix (issue #13): route_failed in crates/graphviz-pure-layout/src/neatogen/multispline.rs.

Status

On branch fix/issue-30, the reproducer's stderr matches C for every engine. Each warning has a test in crates/graphviz-pure-cli/tests/cli.rs (issue30_*); the printpath format is unit-tested in crates/graphviz-pure-layout/src/common/routespl.rs (checkpath_failure_prints_the_path).

  • Unknown port name: fixed, with C's call order. Patchwork prints nothing because patchwork_init_edge never calls common_init_edge.
  • HTML attribute warnings: fixed for every doAttrs action, including Illegal value ..., the doInt range messages without a newline, and Unrecognized character ... in sides attribute. Only the tokens that C's on-demand lexer reads are reported. The fixed-size cell/table size too small for content and fixed cell/table size with unspecified width or height warnings are also printed. The root graph label is made first, as in graph_init, and patchwork makes node labels in walkTree order.
  • Unplaced edge labels: fixed for all four kinds, including the head label, using lp->text with escapes substituted (an HTML label without its delimiters, or <TABLE>).
  • printpath dumps: ported; there is still no CLI reproducer.
  • Touching nodes: fixed for both spline_edges_ warnings, and for fdp's compoundEdges: nodes touch with its pack value/sep value note. The port previously had only a comment for the fdp case.
  • Rankset/cluster, empty clusters, ortho labels and multispline failures: merged with issues #23, #19, #11 and #13.
  • Also fixed (found while testing): common_init_node's shape diagnostics. These are using box for unknown shape %s (once per name), node '%s', graph '%s' size too small for label (a fixedsize node), and bad label format %s, which the port printed once per sizing pass and now prints once per record node (issue30_node_shape_warnings).
  • Still missing (found while testing), filed separately: the port loads no images, so C's HTML <IMG> error (No or improper image file="F", exit status 1) and the shapefile/epsf warnings are absent (issue #130; ignored tests issue30_html_missing_image_error, issue30_missing_shapefile_warnings); and the expat encoding errors of HTML labels (not well-formed (invalid token), unknown encoding; issue #131). A stderr sweep of the tests/ corpora over all engines found no other difference in these messages.
  • Review fixes: repeat sizings run inside diag::quietly, so identical labels and every graph of a file are reported as in C; neato -n reports labels and ports per edge first; SIDES characters print as raw bytes; an empty unknown HTML element is reported twice, as expat does.

Cases

Not tied to fuzz seeds: stderr differences are only a side note in the fuzz harness (stderr_diff).

Files

tests/fuzz-open/021-stderr-missing-warnings

C and the port

No pair of C and port outputs in this reproducer.

c.stderr
Warning: Illegal attribute FOO in <TABLE> - ignored
in label of node a
Warning: node a, port nosuch unrecognized
Warning: no position for edge with label x
rust.stderr
Warning: Illegal attribute FOO in <TABLE> - ignored
in label of node a
Warning: node a, port nosuch unrecognized
Warning: no position for edge with label x

Reproduce

repro.gv
graph G {
splines=none
a [xlabel=q, label=<<TABLE FOO="1"><TR><TD>x</TD></TR></TABLE>>]
a:nosuch -- b [label=x]
}
cmd.txt
GVBINDIR=$HOME/src/gv-ref/lutplugins dot -Tsvg -o /dev/null repro.gv
graphviz-pure -Tsvg -o /dev/null repro.gv
cases.txt
(no fuzz cases; stderr differences are only recorded as stderr_diff in results.jsonl)

Files: c.stderr, cases.txt, cmd.txt, repro.gv, rust.stderr. Source: tests/fuzz-open/021-stderr-missing-warnings.

All open issues