What happens, and what did you expect instead?
Calling max_cliques() on a directed graph crashes R with Error: segfault from C stack overflow — but only if any_multiple() has been called on the graph beforehand. Either call alone is fine.
Additional observations:
max_cliques(g) alone works (returns 12 cliques, with the expected "Edge directions are ignored" warning). any_multiple(g) alone works.
- Wrapping the call in
suppressWarnings() does not prevent the crash.
- The crash is specific to
any_multiple() as the priming call: which_multiple(g), any_loop(g), or is_connected(g) before max_cliques(g) do not crash.
- Undirected graphs are unaffected:
max_cliques(as_undirected(g, mode = "collapse")) after any_multiple() is fine, suggesting the trigger is the directed-graph warning path in max_cliques().
- In a sequence that doesn't crash, the "Edge directions are ignored for maximal clique calculations" warning is mis-attributed to
has_multiple_impl (In has_multiple_impl(graph = graph) : Edge directions are ignored..., source cliques/maximal_cliques_template.h:221), which may point to stale condition-handler state left by any_multiple().
Found while testing the manynet package, but reproduces with igraph alone in a fresh session.
To reproduce
library(igraph) # 2.3.3
set.seed(1)
m <- matrix(rbinom(64, 1, .5), 8, 8); diag(m) <- 0
g <- graph_from_adjacency_matrix(m) # directed
invisible(any_multiple(g))
max_cliques(g)
#> Error: segfault from C stack overflow
System information
No response
What happens, and what did you expect instead?
Calling
max_cliques()on a directed graph crashes R withError: segfault from C stack overflow— but only ifany_multiple()has been called on the graph beforehand. Either call alone is fine.Additional observations:
max_cliques(g)alone works (returns 12 cliques, with the expected "Edge directions are ignored" warning).any_multiple(g)alone works.suppressWarnings()does not prevent the crash.any_multiple()as the priming call:which_multiple(g),any_loop(g), oris_connected(g)beforemax_cliques(g)do not crash.max_cliques(as_undirected(g, mode = "collapse"))afterany_multiple()is fine, suggesting the trigger is the directed-graph warning path inmax_cliques().has_multiple_impl (In has_multiple_impl(graph = graph) : Edge directions are ignored..., source cliques/maximal_cliques_template.h:221), which may point to stale condition-handler state left byany_multiple().Found while testing the manynet package, but reproduces with igraph alone in a fresh session.
To reproduce
library(igraph) # 2.3.3
set.seed(1)
m <- matrix(rbinom(64, 1, .5), 8, 8); diag(m) <- 0
g <- graph_from_adjacency_matrix(m) # directed
invisible(any_multiple(g))
max_cliques(g)
#> Error: segfault from C stack overflow
System information
No response