Boost logo

Boost Users :

Subject: [Boost-users] Graph lib: read_dimacs_max_flow segment fault
From: Xian Chen (hoganxian_at_[hidden])
Date: 2009-02-18 17:14:02


Hi All,

I compile read_dimacs_max_flow example (
http://www.boost.org/doc/libs/1_38_0/libs/graph/example/read_write_dimacs-eg.cpp)
with these warnnings.

g++ -I/home/xianchen/opt/include/boost-1_38 -Wno-deprecated -c read.cpp -o
objects/simu.o
/home/xianchen/opt/include/boost-1_38/boost/graph/read_dimacs.hpp: In
function 'int boost::read_dimacs_max_flow(Graph&, CapacityMap,
ReverseEdgeMap, typename boost::graph_traits<G>::vertex_descriptor&,
typename boost::graph_traits<G>::vertex_descriptor&, std::istream&) [with
Graph = main()::Graph, CapacityMap =
boost::adj_list_edge_property_map<boost::directed_tag, long int, long int&,
unsigned int, boost::property<boost::edge_capacity_t, long int,
boost::property<boost::edge_reverse_t,
boost::detail::edge_desc_impl<boost::directed_tag, unsigned int>,
boost::no_property> >, boost::edge_capacity_t>, ReverseEdgeMap =
boost::adj_list_edge_property_map<boost::directed_tag,
boost::detail::edge_desc_impl<boost::directed_tag, unsigned int>,
boost::detail::edge_desc_impl<boost::directed_tag, unsigned int>&, unsigned
int, boost::property<boost::edge_capacity_t, long int,
boost::property<boost::edge_reverse_t,
boost::detail::edge_desc_impl<boost::directed_tag, unsigned int>,
boost::no_property> >, boost::edge_reverse_t>]':
read.cpp:86: instantiated from here
/home/xianchen/opt/include/boost-1_38/boost/graph/read_dimacs.hpp:108:
warning: deprecated conversion from string constant to 'char*'
/home/xianchen/opt/include/boost-1_38/boost/graph/read_dimacs.hpp:108:
warning: deprecated conversion from string constant to 'char*'
......

My GCC is:

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2.4/configure --prefix=/home/xianchen/opt
--enable-shared --enable-threads=posix --enable-languages=c,c++
--enable-checking=release --enable-mpfr=/home/xianchen/opt/
--with-system-zlib
Thread model: posix
gcc version 4.2.4

I run this program using data "boost/libs/graph/example/max_flow.dat"

But get segment fault:

*** glibc detected *** free(): invalid pointer: 0x08053ff4 ***
Aborted

Can any one tell me the why this happen? The program aborts under GCC.4.3.3
either.

Which version of GCC is the most boost friendly?

Thanks in advance,
Xian



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net