Bug 2526747

Summary: graphviz 'cluster' crashes: SIGSEGV on -C 0 -c 1, SIGABRT on empty graph
Product: [Fedora] Fedora Reporter: Petr Sklenar <psklenar>
Component: graphvizAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 45CC: alex, go-sig, jskarvad, r-maint-sig, spotrh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-09-25 18:46:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Sklenar 2026-09-01 12:19:35 UTC
graphviz 'cluster' crashes on Fedora 45 (graphviz-15.1.1-1.fc45).

Two reproducers, both crash 100% of the time:

1) SIGSEGV (segfault) - option combination -C 0 -c 1:
   python3 -c 'print("graph G {"); [print(f"n{i} -- n{(i+1)%20000};") for i in range(20000)]; print("}")' > /tmp/big.dot
   cluster -C 0 -c 1 /tmp/big.dot
   -> Segmentation fault in Multilevel_MQ_Clustering_establish() <- main()

2) SIGABRT - empty graph:
   echo 'graph G {}' | cluster
   -> cluster: SparseMatrix.c:427: SparseMatrix_from_coordinate_arrays_internal: Assertion `m > 0 && n > 0' failed.

Expected: clean error exit, not a crash. Core dumps available.
Also reproduces on Fedora 44 (graphviz-14.1.4-2.fc44).

Found via automated crash-testing with Claude Code

Comment 1 Petr Sklenar 2026-09-01 12:26:31 UTC
[root@vm-10-0-185-12 ~]# cluster -C
cluster.c:96: claimed unreachable code was reached
Aborted                    (core dumped) cluster -C

[root@vm-10-0-185-12 ~]# /usr/bin/edgepaint -o --lightness -s -v --share_endpoint
edgepaintmain.c:231: claimed unreachable code was reached
Aborted                    (core dumped) /usr/bin/edgepaint -o --lightness -s -v --share_endpoint

[root@vm-10-0-185-12 ~]# cluster -C 0 -c 1 /tmp/big.dot
ncluster = 20000, mq = -0.000100
maxgain=0.000025, merge 0, 1
Segmentation fault         (core dumped) cluster -C 0 -c 1 /tmp/big.dot

Comment 2 Jaroslav Škarvada 2026-09-01 13:12:10 UTC
Upstream bug: https://gitlab.com/graphviz/graphviz/-/work_items/2857

Comment 3 Tom "spot" Callaway 2026-09-25 18:46:18 UTC
Fixed in 16.1.0 (in Rawhide/F46).