stderr: C warnings the port does not print (unknown port, HTML attributes, unplaced labels, rankset/cluster, ortho labels, touching nodes, multispline failures, printpath dump)
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 frompoly_port(shapes.c:2909-2910) andrecord_port(shapes.c:3751-3752) whencompassPortreturns true. Also coversrecord_port'sunrecognized compass point '%s' - ignored(shapes.c:3748-3749). In the port,compass_portreturns that flag (crates/graphviz-pure-layout/src/common/ports.rs:126), but the callers atports.rs:385andports.rs:407ignore 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) warnsIllegal attribute %s in %s - ignoredand setswarn, andmake_labelthen addsin label of <kind> <name>. The port's HTML parser (crates/graphviz-pure-geom/src/html_label.rs, seeparse_html_reportat line 1417 and thein label ofhandling 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) warnsno position for edge with label|tail label|head label|xlabel %swhen an unset label's edge has no spline (heresplines=nonetogether with a nodexlabel, soaddXLabelsruns). The port skips the edge silently atcrates/graphviz-pure-layout/src/common/xlabels.rs:878-881. -
printpathdumps: afterin 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_clustersincrates/graphviz-pure-layout/src/dotgen/cluster.rsprints it. Seen in fuzz seeds 10107, 21064 and 31463. - Empty clusters:
"removing empty cluster"(lib/dotgen/mincross.c:346). Fixed with issue #19:dot_mincrossprints 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 withgraph 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'scompoundEdges: nodes touchvariant 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_failedincrates/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_edgenever callscommon_init_edge. - HTML attribute warnings: fixed for every
doAttrsaction, includingIllegal value ..., thedoIntrange messages without a newline, andUnrecognized character ... in sides attribute. Only the tokens that C's on-demand lexer reads are reported. The fixed-sizecell/table size too small for contentandfixed cell/table size with unspecified width or heightwarnings are also printed. The root graph label is made first, as ingraph_init, and patchwork makes node labels inwalkTreeorder. - Unplaced edge labels: fixed for all four kinds, including the head label, using
lp->textwith escapes substituted (an HTML label without its delimiters, or<TABLE>). printpathdumps: ported; there is still no CLI reproducer.- Touching nodes: fixed for both
spline_edges_warnings, and for fdp'scompoundEdges: nodes touchwith itspack value/sep valuenote. 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 areusing box for unknown shape %s(once per name),node '%s', graph '%s' size too small for label(afixedsizenode), andbad 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 theshapefile/epsfwarnings are absent (issue #130; ignored testsissue30_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 thetests/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 -nreports labels and ports per edge first;SIDEScharacters 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.
Warning: Illegal attribute FOO in <TABLE> - ignoredin label of node aWarning: node a, port nosuch unrecognizedWarning: no position for edge with label xWarning: Illegal attribute FOO in <TABLE> - ignoredin label of node aWarning: node a, port nosuch unrecognizedWarning: no position for edge with label xReproduce
graph G { splines=none a [xlabel=q, label=<<TABLE FOO="1"><TR><TD>x</TD></TR></TABLE>>] a:nosuch -- b [label=x]}GVBINDIR=$HOME/src/gv-ref/lutplugins dot -Tsvg -o /dev/null repro.gvgraphviz-pure -Tsvg -o /dev/null repro.gv(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.