Re: [xml] Attempted to read or write protected memory

siddharth sehgal wrote:

I am facing this problem in Visual Studio 2005 using VB-2005 and native unmanaged c++ dll which in turn uses libxml2.
"Attempted to read or write protected memory. This is often an indication that other memory has been corrupted. "*

I will try to explain the problem in a simplistic approach as its difficult to paste the coding bits because its a bit elaborative out there.

xmlNodePtr gramCur;
extern xmlNodePtr gramCur;
extern set<long> currentGrammarModels;

My other global variables like vectors, sets, integers etc seem to work fine but for the above libxml related variable (gramCur) I am getting the above error.

I think you skipped the interesting part, namely:
1) What does the code look like that initializes gramCur;
2) What does the code look like that uses gramCur
3) What is done btw. the init and usage of gramCur
4) At which point (inside libxml2 or which libxml2 interface function) does the "crash" occur. You can easily check this with your debugger. It will show you the call stack where the error occured.


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