vendredi 27 avril 2018

LEDA: Segfault on initialization of node_array

I am running into a segmentation fault whenever I initialize a leda::node_array. It even appears with the node_array example from here:

http://www.algorithmic-solutions.info/leda_guide/graphs/node_array_example.html

I tried different ways of compilation, but for a quick reproduction try:

g++ -I/path/to/LEDA/incl -l/path/to/LEDA/libleda.so -lX11 -lm main.cpp

I tried

  • with and without the std=c++11 flag
  • using a cmake file
  • compilation and linking in separate steps
  • leaving out the -lm and -lX11 libraries (the latter one throws an error)

Here is a smaller example that reproduces the error for me:

#include <LEDA/graph/graph.h>
#include <LEDA/graph/node_array.h>

int main()
{
  leda::graph G;
  G.new_node();
  leda::node_array<int> array_local(G);

  return 0;
}

I use LEDA version 6.5 installed to /opt/LEDA and g++ version 5.4.1 on Ubuntu 16.04. The error is caused by LEDA's memory allocator LEDA_MEMORY().

What might cause this behavior?

Aucun commentaire:

Enregistrer un commentaire