Skip to content

Segfault writing empty graph in NetworkitBinary format #909

@opatut

Description

@opatut

Writing an empty graph to file with writeGraph causes a segmentation fault.

Here's a minimal example for this bug:

>>> import networkit
>>> g = networkit.graph.Graph()
>>> networkit.graphio.writeGraph(g, 'x', networkit.Format.NetworkitBinary)
[1]    4538 segmentation fault (core dumped)  python

My machine:

Linux garlic 5.16.15-arch1-1 #1 SMP PREEMPT Thu, 17 Mar 2022 00:30:09 +0000 x86_64 GNU/Linux
Python 3.9.7
Networkit 9.1.1 from pypi

The segfault does not occur if you add a g.addNode() before writing the graph.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions