﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	revision
369	graphCopy crash	Ben Strasser	Peter Kovacs	"The following code crashes:

{{{
#include <lemon/list_graph.h>
#include <lemon/core.h>
#include <lemon/lgf_reader.h>

typedef lemon::ListGraph Graph;
using lemon::INVALID;
	
int main(int argc, char*argv[]){
	Graph g;

	lemon::GraphReader<Graph>(g, ""bug"")
		.run();

	bool a = true;
	for(Graph::EdgeIt i(g); i!=INVALID;){
		Graph::Edge e = i;
		++i;
		if(a)
			g.erase(e);
		a = !a;
	}

	Graph g2;
	Graph::EdgeMap<Graph::Edge>edge_map(g2);

	lemon::graphCopy(g, g2)
		.edgeRef(edge_map)
		.run();
}
}}}

I have attached the graph in the bug file. The problem is in graphCopy because the following code works

{{{
#include <lemon/list_graph.h>
#include <lemon/core.h>
#include <lemon/lgf_reader.h>

typedef lemon::ListGraph Graph;
using lemon::INVALID;
	
int main(int argc, char*argv[]){
	Graph g;

	lemon::GraphReader<Graph>(g, ""bug"")
		.run();

	bool a = true;
	for(Graph::EdgeIt i(g); i!=INVALID;){
		Graph::Edge e = i;
		++i;
		if(a)
			g.erase(e);
		a = !a;
	}

	Graph g2;
	Graph::EdgeMap<Graph::Edge>edge_map(g2);

	Graph::NodeMap<Graph::Node>node_map(g);
	for(Graph::NodeIt i(g); i!=INVALID; ++i){
		Graph::Node u = g2.addNode();
		node_map[i] = u;
	}
		
	for(Graph::EdgeIt i(g); i!=INVALID; ++i){
		edge_map[
			g2.addEdge(
				node_map[g.u(i)],
				node_map[g.v(i)]
			)
		] = i;
	}

	/*lemon::graphCopy(g, g2)
		.edgeRef(edge_map)
		.run();*/
}
}}}

My version is according to lemon/config.h

{{{
#define LEMON_VERSION 1.1.1
}}}

It's one of the stable releases. It's not an svn version.

Thanks for looking into this."	defect	closed	critical	LEMON 1.3 release	core	release branch 1.1	invalid	crash graphCopy		
