Segmentation fault when using weights in community.minimize_blockmodel_dl

Hi,

I was trying to make some experiments with community detection. I'm creating a small graph, adding labels and weights as vertex and edge properties. After that I pass this graph and weights into minimize_blockmodel_dl. It sometimes work, but sometimes it returns a Segmentation Fault and stops. I've provided a minimal code to reproduce this behaviour. I also noticed that I only encounter this bug when I use "eweight" parameter.

graph_tool version = 2.2.42-1 python version = 2.7.6

minimal_error_code.py

from graph_tool.all import *

g = Graph(directed=False)

vprop = g.new_vertex_property("string") 
 
eprop = g.new_edge_property("int")

v1 = g.add_vertex()

vprop[v1] = "v1"

v2 = g.add_vertex()

vprop[v2] = "v2"

v3 = g.add_vertex()

vprop[v3] = "v3"

v4 = g.add_vertex()

vprop[v4] = "v4"

v5 = g.add_vertex()

vprop[v5] = "v5"

v6 = g.add_vertex()

vprop[v6] = "v6"

v7 = g.add_vertex()

vprop[v7] = "v7"

v8 = g.add_vertex()

vprop[v8] = "v8"

v9 = g.add_vertex()

vprop[v9] = "v9"

e1 = g.add_edge(v1,v2)

eprop[e1] = 5

e2 = g.add_edge(v1,v3)

eprop[e2] = 2

e3 = g.add_edge(v1,v4)

eprop[e3] = 1

e4 = g.add_edge(v2,v4)

eprop[e4] = 4

e5 = g.add_edge(v6,v7)

eprop[e5] = 400

e6 = g.add_edge(v1,v9)

eprop[e6] = 440

e7 = g.add_edge(v8,v5)

eprop[e7] = 480

e8 = g.add_edge(v7,v4)

eprop[e8] = 480

e9 = g.add_edge(v8,v9)

eprop[e9] = 320

e10 = g.add_edge(v2,v9)

eprop[e10] = 3

state = minimize_blockmodel_dl(g, eweight=eprop)

b = state.b

graph_draw(g, vertex_fill_color=b, vertex_shape=b, vertex_text=vprop, edge_text=eprop, output="polbooks_blocks_mdl.pdf")

This is the picture generated when it works. graph