clabels cause segmentation fault

Bug reports:

Please follow the general troubleshooting steps first:

  • Are you running the latest graph-tool version?

Running mcmc algorithms with clabels causes a segmentation fault (core dump).

Do not forget to supply the following information:

OS:

  • Ubuntu 5.4.0-89-generic
  • macOS Catalina 10.15

Python: 3.9 3.10

Here's a minimal working example

g = gt.collection.data["lesmis"]

clabel = g.vp["clabel"] = g.new_vp("int")

for v in g.vertices():
    clabel[v]=np.random.randint(3)
    
state = gt.NestedBlockState(g, state_args={'clabel':clabel,'pclabel':clabel})

for i in range(100):
    state.multiflip_mcmc_sweep(niter=10)