Exception in parse_file under Windows



Hi Everyone,

Relatively new to libxml++ so please be nice J

 

I’m porting a Linux application of ours to Windows (VS2013) as a x86 app (OS is x64). At the moment I’ve got it compiling but crashing whenever we go to load a local XML file at start up:

 

First-chance exception at 0x014A8D17 (libxml2-2.dll) in WCLDriver.exe: 0xC0000005: Access violation reading location 0x2E747865.

 

Main() code:

                Glib::ustring testFile = "E:/text.xml";

                xmlpp::DomParser xmlParser;

                cout << "Created parser" << endl;

                xmlParser.parse_file(testFile);                                                  << call that crashes

                cout << "Parsed string OK" << endl;

 

Call stack:

>             libxml2-2.dll!xmlStrncasecmp(const unsigned char * str1, const unsigned char * str2, int len) Line 304                C

               libxml2-2.dll!xmlNoNetExists(const char * URL) Line 3939             C

               libxml2-2.dll!xmlLoadExternalEntity(const char * URL, const char * ID, _xmlParserCtxt * ctxt) Line 4123       C

               libxml2-2.dll!xmlCreateURLParserCtxt(const char * filename, int options) Line 14197       C

               libxml2-2.dll!xmlCreateFileParserCtxt(const char * filename) Line 14227                C

               xml++-vc100-d-2_6.dll!xmlpp::DomParser::parse_file(const Glib::ustring & filename) Line 48      C++

               WCLDriver.exe!main(int argc, char * * argv) Line 84         C++

 

I’m compiling libxml2 and iconv from source at the moment and I’m currently using a precompiled version of libxml++-2.6-2.

 

Since I can compile libxml2, I’ve noticed that even by the first libxml call xmlCreateFileParserCtxt from libxml++, the const char * being passed is already corrupted and cannot be read. I can’t even print out the parameter in xmlCreateFileParserCtxt as it’s already unreadable by that point. I’ve tried multiple different versions of the file path with no success (double backslash, relative path, etc.) – even though this clearly shouldn’t have any effect on the exception.

 

I have 2 questions:

 

1.       I don’t understand why it’s crashing since this is boilerplate code that should just work, and does work on our existing Linux builds. There is no threading, only test the code above. Any suggestions?

 

2.       My next step is trying to do some debugging in libxml++ parse_file (since by the time the call to libxml is made the string can’t be read) but I can’t get it to compile from source as it’s saying my glibmm (from gtkmm) is missing threads.h (which it is). Glibmm builds OK though, it’s just missing threads.h for some reason. Can anyone advise why every build of glibmm I’m download seems to be missing threads.h?

 

Both libxml and libxml++ are current stable builds from the git repos.

 

Many thanks in advance.

Thanks,

James

 

Regards,

Dr. James Walsh

------------------------------------------------------

Research Fellow                      

Wearable Computer Lab         

University of South Australia   

 



DISCLAIMER: This email and any attachments are confidential. They may contain privileged information or copyright material. You must not read, copy, use or disclose them without authorisation. If you are not an intended recipient, please contact us at once by return email and then delete both messages and all attachments.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]