[xml] Re: Bug or User Error



Ron Ohmer wrote:
Does anyone have a suggestion as to why I am getting an unhandled exception on a doc=xmlParseFile(filename).

Which exception? Which platform? Which libxml version?

It is around the 6th time it runs in a program (Same every time), so I suspect it is running out of stack space.. After every run thru the parser I am sure to run:

xmlFreeDoc(doc);

xmlCleanupParser();

So, I am confused as to how I am leaving open memory out there. My stack is: Program
xmlSAXParseFile
xmlInitParser
xmlNewCharEncodingHandler
xmlStrndup
malloc
The malloc is the offending problem..

malloc offends you? I'm sorry. Unfortunately there exists no other portable way to allocate memory in C.

Any suggestions?

Well, I can run "xmllint --repeat somefile.xml" and see it reparsing the document 100 times. No exceptions. Wow, the library indeed works and it doesn't leak memory.

What have you done wrong? No idea, can only tell after having debugged your code and that action I won't take.

It seems you'll have to recompile libxml with memory debugging enabled and show your debugger that you remember it still.

Ciao,
Igor



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