Opened 8 years ago

#10660 new Bugs

svg_mapper crash

Reported by: Volker Schöch <vschoech@…> Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.56.0 Severity: Problem
Keywords: svg_mapper, integer Cc:

Description

When I slightly modify the example from the documentation, the code crashes with an obscure (for me) exception deep in the callstack.

Running this code:

std::ostringstream svg;
 
// Specify the basic type
typedef boost::geometry::model::d2::point_xy<int> point_type;
 
// Declare some geometries and set their values
point_type a;
boost::geometry::assign_values(a, -100, -100);
 
// Declare a stream and an SVG mapper
boost::geometry::svg_mapper<point_type> mapper(svg, 1000, 1000);
 
// Add geometries such that all these geometries fit on the map
mapper.add(a);
 
// Draw the geometries on the SVG map, using a specific SVG style
mapper.map(a, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:2", 5);
 
// Destructor of map will be called - adding </svg>
// Destructor of stream will be called, closing the file

... throws this exception:

Microsoft C++ exception: boost::numeric::negative_overflow at memory location 0x00000000001E9D60.

... at this call-stack:

tcaddin.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 154	C++
tcaddin.dll!boost::numeric::def_overflow_handler::operator()(boost::numeric::range_check_result r) Line 164	C++
tcaddin.dll!boost::numeric::convdetail::generic_range_checker<boost::numeric::conversion_traits<int,double>,boost::numeric::convdetail::LE_PrevLoT<boost::numeric::conversion_traits<int,double> >,boost::numeric::convdetail::GE_SuccHiT<boost::numeric::conversion_traits<int,double> >,boost::numeric::def_overflow_handler>::validate_range(double s) Line 294	C++
tcaddin.dll!boost::numeric::convdetail::rounding_converter<boost::numeric::conversion_traits<int,double>,boost::numeric::convdetail::generic_range_checker<boost::numeric::conversion_traits<int,double>,boost::numeric::convdetail::LE_PrevLoT<boost::numeric::conversion_traits<int,double> >,boost::numeric::convdetail::GE_SuccHiT<boost::numeric::conversion_traits<int,double> >,boost::numeric::def_overflow_handler>,boost::numeric::raw_converter<boost::numeric::conversion_traits<int,double> >,boost::numeric::Trunc<double> >::convert(double s) Line 494	C++
tcaddin.dll!boost::numeric_cast<int,double>(double arg) Line 54	C++
tcaddin.dll!boost::geometry::strategy::transform::ublas_transformer<double,2,2>::apply<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> >(const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & p1, boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> & p2) Line 115	C++
tcaddin.dll!boost::geometry::detail::transform::transform_point::apply<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,boost::geometry::model::point<int,2,boost::geometry::cs::cartesian>,boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> >(const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & p1, boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> & p2, const boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> & strategy) Line 58	C++
tcaddin.dll!boost::geometry::resolve_strategy::transform::apply<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,boost::geometry::model::point<int,2,boost::geometry::cs::cartesian>,boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> >(const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & geometry1, boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> & geometry2, const boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> & strategy) Line 358	C++
tcaddin.dll!boost::geometry::resolve_variant::transform<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> >::apply<boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> >(const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & geometry1, boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> & geometry2, const boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> & strategy) Line 391	C++
tcaddin.dll!boost::geometry::transform<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,boost::geometry::model::point<int,2,boost::geometry::cs::cartesian>,boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> >(const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & geometry1, boost::geometry::model::point<int,2,boost::geometry::cs::cartesian> & geometry2, const boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> & strategy) Line 454	C++
tcaddin.dll!boost::geometry::dispatch::svg_map<boost::geometry::point_tag,boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> >::apply<boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> >(std::basic_ostream<char,std::char_traits<char> > & stream, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & style, int size, const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & point, const boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> & strategy) Line 87	C++
tcaddin.dll!boost::geometry::svg_map<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> >(std::basic_ostream<char,std::char_traits<char> > & stream, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & style, int size, const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & geometry, const boost::geometry::strategy::transform::map_transformer<double,2,2,1,1> & strategy) Line 213	C++
tcaddin.dll!boost::geometry::svg_mapper<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian>,1>::map<boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> >(const boost::geometry::model::d2::point_xy<int,boost::geometry::cs::cartesian> & geometry, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & style, int size) Line 334	C++
[...]

Change History (0)

Note: See TracTickets for help on using tickets.