I have a very simple program: xmlDocPtr doc = xmlParseFile("small.xml"); xmlDocDump(stdout, doc);The xmlDocDump crashes on windows, not on linux. At first I thought it might be the precompiled win32 binaries, so I downloaded the libxml source (libxml2-2.6.2), compiled it myself, but get the same error.
This shouldn't crash, should it? It does when I'm setting code genreation to be anything but the "Multithreaded DLL" (so not non-DLL, and especially not Debug). xmlDocDump is the first function that's shown that behaviour.
Here's the stack, in case that helps anyone: ntdll.dll!77f69ecd() msvcr71.dll!free(void * pBlock=0x004750e6) Line 103 + 0x5 C> libxml2.dll!xmlBufferAdd(_xmlBuffer * buf=0x00000000, const unsigned char * str=0x00000002, int len=1244532) Line 6746 + 0x1a C
0012fedc() ntdll.dll!77f5b2e6() msvcr71.dll!_lock_file(void * pf=0x004493d0) Line 236 Cmsvcr71.dll!fwrite(const void * buffer=0x004760c0, unsigned int size=64, unsigned int count=1, _iobuf * stream=0x004493d0) Line 72 + 0x8 C libxml2.dll!xmlFileWrite(void * context=0x004493d0, const char * buffer=0x004760c0, int len=64) Line 765 + 0x14 C libxml2.dll!xmlOutputBufferFlush(_xmlOutputBuffer * out=0x00475008) Line 2887 + 0x1f C libxml2.dll!xmlOutputBufferClose(_xmlOutputBuffer * out=0x00475008) Line 2075 + 0x9 C libxml2.dll!xmlDocFormatDump(_iobuf * f=0x004493d0, _xmlDoc * cur=0x00478660, int format=0) Line 8429 + 0x9 C libxml2.dll!xmlDocDump(_iobuf * f=0x004493d0, _xmlDoc * cur=0x00478660) Line 8444 + 0xf C
xml-schemas.exe!main(int argc=1, char * * argv=0x004814c0) Line 38 + 0xe C++ xml-schemas.exe!mainCRTStartup() Line 259 + 0x19 C kernel32.dll!77e814c7() The xml file is dead simple, too: <?xml version="1.0" encoding="utf-8"?> <small> <test/> </small> Enno. -- The difference between a Miracle and a Fact is exactly the difference between a mermaid and a seal. -- Mark Twain
Attachment:
pgp2F6ijZcxVc.pgp
Description: PGP signature