NestedBlockState.mcmc_sweep can segfault if vertices are specified.
SEGFAULT may occur if vertices are specified when using the mcmc_sweep
method of a NestedBlockState. Example script is provided below, which appears to reliably reproduce the issue on two separate machines and python versions.
Environment:
- Ubuntu 20.04.4 LTS (64-bit)
- graphtool v2.45, (conda)
- python 3.8.13 and 3.10.5
Example test.py:
G = gt.Graph()
v1, v2, v3, v4 = G.add_vertex(4)
G.add_edge(v1, v2)
G.add_edge(v1, v3)
G.add_edge(v2, v3)
G.add_edge(v2, v4)
G.add_edge(v3, v4)
state = gt.minimize_nested_blockmodel_dl(G)
state.mcmc_sweep(vertices = [v2]) # SEGFAULT
# state.mcmc_sweep(vertices = [v1, v3, v4]) # Does not crash