[BGL][variant] variant as internal edge property - nastiness w/MS7.1 + 1.31.0

This isn't a question but rather a quick report for my future reference - I need to circle back and try to characterize this problem more fully when I'm not on deadline and can run some additional tests with Boost 1.32.0. Environment: - MS 7.1 compiler w/their STL distribution - Boost 1.31.0 (my client doesn't want to update to 1.32.0 until after this release) Summary: boost::variant registered as an internal edge property map member on a BGL graph causes the resultant graph to be inaccessible due to what appears to be incorrect initialization of both the internal vertex and edge property maps. I SUSPECT THAT THE ROOT CAUSE OF THIS CAN BE TRACKED BACK TO A MS 7.1 COMPILER BUG due to the fact that attempts to compile my test code results in either of (a) an C1001 Internal Compiler Error (b) a error-free compile and a completely screwed runtime. Details: The boost::variant in question is bounded by several unique specializations of a fully-specialized class. As follows: // pseudocode class A; class B; class C; template <typename tail_T, typename head_T> class edge_exeuctor {}; template <> class edge_executor<A, B>; template <> class edge_exeuctor<A,C>; tempalte <> class edge_exeuctor<B,C>; template <> class edge_executor<B,A>; tempalte <> class edge_executor<C,A>; template <> class edge_executor<C,B>; typedef boost::variant< edge_executor<A,B>, edge_executor<A,C>, edge_executor<B,C>, edge_executor<B,A>, edge_executor<C,A>, edge_executor<C,B> > variant_edge_t; The graph in question is declared as: enum vertex_foo_property_t { vertex_foo_property = 801 }; enum edge_foo_property_t {edge_foo_property = 802 }; BOOST_INSTALL_PROPERTY(vertex, foo_property); BOOST_INSTALL_PROPERTY(edge, foo_property); typedef property<vertex_foo_property, int, boost::property<vertex_color_t, default_color_type> > vertex_properties_t; typedef property<edge_foo_property, variant_edge_t> edge_properties_t; typedef adjacency_list<listS, listS, bidirectionalS, vertex_properties_t, edge_properties_t> graph_t; typedef graph_traits<graph_t>::edges_size_type edges_size_t; Failure: // THE TEST CODE WILL NOT ALWAYS COMPILE W/MS 7.1 // HALF THE TIME IT BOMBS W/C1001 INTERNAL COMPILER ERROR // when it does compile, no errors are reported by the following runtime behavior is observed graph_t g; edges_size_t edge_count = num_edges(g); // <- protection fault // stepping into num_edges in a debug build reveals that both vertex and edge property maps point to uninitialized memory (0xcdcdcdcd) // removing variant_edge_t from edge_properties_t and replacing with an int works as expected... ---- - Chris

On Dec 10, 2004, at 9:38 AM, Christopher D. Russell wrote:
This isn't a question but rather a quick report for my future reference - I need to circle back and try to characterize this problem more fully when I'm not on deadline and can run some additional tests with Boost 1.32.0.
Environment:
- MS 7.1 compiler w/their STL distribution - Boost 1.31.0 (my client doesn't want to update to 1.32.0 until after this release)
Summary:
boost::variant registered as an internal edge property map member on a BGL graph causes the resultant graph to be inaccessible due to what appears to be incorrect initialization of both the internal vertex and edge property maps. I SUSPECT THAT THE ROOT CAUSE OF THIS CAN BE TRACKED BACK TO A MS 7.1 COMPILER BUG due to the fact that attempts to compile my test code results in either of (a) an C1001 Internal Compiler Error (b) a error-free compile and a completely screwed runtime.
That's really strange... we've never come across any initialization problems (on any platform) with these, especially because the internal properties are just stored in lists or vectors most of the time... nothing fancy going on there. I would appreciate if you could check with 1.32.0 and if you're still running into the problem we'll see if we can duplicate it and come up with a workaround. Doug

Yea - this one really caught me by surprise as well. I'm expecting to complete this 1.31.0-based work within the next few days and plan to grab 1.32.0 release and have another go at it. I'll write it up my results and post some sample code. - Regards Chris "Doug Gregor" <dgregor@cs.indiana.edu> wrote in message news:EDDF7620-4ED8-11D9-A4F6-000A95B0EC64@cs.indiana.edu...
On Dec 10, 2004, at 9:38 AM, Christopher D. Russell wrote:
This isn't a question but rather a quick report for my future reference - I need to circle back and try to characterize this problem more fully when I'm not on deadline and can run some additional tests with Boost 1.32.0.
Environment:
- MS 7.1 compiler w/their STL distribution - Boost 1.31.0 (my client doesn't want to update to 1.32.0 until after this release)
Summary:
boost::variant registered as an internal edge property map member on a BGL graph causes the resultant graph to be inaccessible due to what appears to be incorrect initialization of both the internal vertex and edge property maps. I SUSPECT THAT THE ROOT CAUSE OF THIS CAN BE TRACKED BACK TO A MS 7.1 COMPILER BUG due to the fact that attempts to compile my test code results in either of (a) an C1001 Internal Compiler Error (b) a error-free compile and a completely screwed runtime.
That's really strange... we've never come across any initialization problems (on any platform) with these, especially because the internal properties are just stored in lists or vectors most of the time... nothing fancy going on there.
I would appreciate if you could check with 1.32.0 and if you're still running into the problem we'll see if we can duplicate it and come up with a workaround.
Doug
participants (2)
-
Christopher D. Russell
-
Doug Gregor