[OSM-dev] libxml2 segfault parsing OSM data with C++, but not C
jburgess777 at googlemail.com
Thu Feb 14 22:32:44 GMT 2008
On Thu, 2008-02-14 at 21:40 +0000, Nick Whitelegg wrote:
> Hello everyone,
> Have written a test program to attempt to parse OSM data with libxml2 using
> its SAX parser, as an initial step in bringing direct OSM support to Mapnik.
> For some reason, it runs successfully if it's a C program (saved as .c and
> compiled with gcc) but segfaults if C++ (saved as .cpp, compiled with g++)
> The crash occurs in xmlSAXUserParseFile though can't get any more specific
> information than that.
> Anyone who has used libxml got any idea on this one?
> My test program is at
> with the test OSM file at
You need to zero the my_handler structure before you use it
> dev mailing list
> dev at openstreetmap.org
More information about the dev