cppfw / svgren

:camera: SVG rendering library in C++
MIT License
206 stars 41 forks source link

Crash in VS 2017 when loading SVG #65

Closed JFreyberger closed 5 years ago

JFreyberger commented 5 years ago

Hi,

I just created a minimal project in VS2017, added libsvgren via NuGet and tested your minimal example. Whenever I try to load any svg (tried various also from your examples) it crashes with access violation ("_Parent_proxy" was "0xCCCCCCCC". ) in xutility line 164:

if _ITERATOR_DEBUG_LEVEL == 2

        if (_Myproxy != _Parent_proxy)
            {   // change parentage
            _Lockit _Lock(_LOCK_DEBUG);
            _Orphan_me();

=> _Mynextiter = _Parent_proxy->_Myfirstiter; _Parent_proxy->_Myfirstiter = this; _Myproxy = _Parent_proxy; }

The call stack looks like this:

MyLittleSvgTest.exe!std::_Iterator_base12::_Adopt(const std::_Container_base12 _Parent) Zeile 164 C++ MyLittleSvgTest.exe!std::_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > >,std::_Iterator_base12>::_Tree_unchecked_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > >,std::_Iterator_base12>(std::_Tree_node<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > >,void > _Pnode, const std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > _Plist) Zeile 45 C++ MyLittleSvgTest.exe!std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > >::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > >(std::_Tree_node<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > >,void > _Pnode, const std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > _Plist) Zeile 215 C++ MyLittleSvgTest.exe!std::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > >::_Tree_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > >(std::_Tree_node<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > >,void > _Pnode, const std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > > _Plist) Zeile 328 C++ MyLittleSvgTest.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits,std::allocator >,std::vector<char,std::allocator >,std::less<std::basic_string<char,std::char_traits,std::allocator > >,std::allocator<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > >,0> >::end() Zeile 1199 C++ MyLittleSvgTest.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits,std::allocator >,std::vector<char,std::allocator >,std::less<std::basic_string<char,std::char_traits,std::allocator > >,std::allocator<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > >,0> >::_Tidy() Zeile 2113 C++ MyLittleSvgTest.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits,std::allocator >,std::vector<char,std::allocator >,std::less<std::basic_string<char,std::char_traits,std::allocator > >,std::allocator<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > >,0> >::~_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits,std::allocator >,std::vector<char,std::allocator >,std::less<std::basic_string<char,std::char_traits,std::allocator > >,std::allocator<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > >,0> >() Zeile 1169 C++ MyLittleSvgTest.exe!std::map<std::basic_string<char,std::char_traits,std::allocator >,std::vector<char,std::allocator >,std::less<std::basic_string<char,std::char_traits,std::allocator > >,std::allocator<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > >::~map<std::basic_string<char,std::char_traits,std::allocator >,std::vector<char,std::allocator >,std::less<std::basic_string<char,std::char_traits,std::allocator > >,std::allocator<std::pair<std::basic_string<char,std::char_traits,std::allocator > const ,std::vector<char,std::allocator > > > >() C++ MyLittleSvgTest.exe!mikroxml::Parser::~Parser() Zeile 146 C++ MyLittleSvgTest.exe!svgdom::Parser::~Parser() C++ MyLittleSvgTest.exe!svgdom::load(const papki::File & f) Zeile 31 C++ MyLittleSvgTest.exe!main() Zeile 12 C++

here's my packages.config:

<?xml version="1.0" encoding="utf-8"?>

Probably I'm just missing some compiler option etc. but I don't know which. Do you have any ideas?

Thanks and best regards, Johannes

JFreyberger commented 5 years ago

... sorry. I didn't update to the latest libraries. Now there's no crash anymore :-)

igagis commented 5 years ago

Great!