473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Run-Time Check Failure #2 using XPath with Xalan and Xerces

Dear colleagues,

i'm getting in troubles using one XML library with Visual Studio .NET
and Xerces with Xalan. (Xercer 2.4 and Xalan 1.7)
When i execute the code i get the next run time error:

"Run-Time Check Failure #2 - Stack around the variable 'resolver' was
corrupted."

Looking on internet i've seen that the compiler, if you're running your
code in debug mode and you have activated the compile option /CRTs, adds
the hexadecimal sequence "cc cc cc cc cc cc cc cc" in memory just before
and after each variable in order to check if one of these bytes have
been modified after the excution.
If i not wrong, i understood that the error that i've showed is
triggered if the VC see that one of these "cc*" sequence have been
modified, coz it would mean that some part of the code has modified this
address, which would be a wrong behaivour.
Looking on the hexadecimal memory values of each variable, i've seen
that the sequences of "cc*" are modified for the variable "theEvaluator"
at the end the execution (this inspection has been done carefully of all
values that are near to the variable "resolve").
This change is done when the declaration of "XPathEvaluator
theEvaluator;" is executed.

The next lines are the important part code that generates the error:

LISTMSG XMLeanDBStatisticMsg::selectMsgs(char* selector)
{

LISTMSG llista;

XPathEvaluator::initialize();

XalanSourceTreeDOMSupport theDOMSupport;
this->document->normalize();

XercesParserLiaison * Liasion = new XercesParserLiaison();

XalanDocument* proxyDocument;
XalanNode* xalContextNode ;
try
{
proxyDocument = Liasion->createDocument(this->document);
xalContextNode = proxyDocument->getDocumentElement();
}
catch(XalanDOMException& error)
{
return llista;
}

XPathEvaluator theEvaluator;
XalanDocumentPrefixResolver resolver(proxyDocument); /* <----- the
variable that triggers the run-time error */
try
{
XalanDOMString f = xalContextNode->getNodeName();
....
...

At the end of the email i show the hexadecimal values of the variables
taken after and before the "resolve" variable in the memory, before and
after the execution, and some detailed explanations.
If i compile the code without the /CRTs flag a error is also get.

If anyone can orient me on how can i solve the problem i would be soo
thankul. What i'm doing wrong ? it would be a bug of the libraries ? or
may be i'm looking something in a wrong way ?

cheers !

Francesc Guim Bernat
************************************************** EXTRA INFORMATION ***

- Variable theEvalutaor:

Address: 0x0012FD78
size : 16

Memory dump just when it's declared:
cc cc cc cc cc cc cc cc
0x0012FD78 38 6d 3b 00 30 7b 3b 00 00 6f 3b 00 78 6f 3b 00 cc cc cc cc
cc cc cc cc cc cc cc
(the two sequences of cc cc cc cc cc cc cc cc are present)

Memory dump after the execution:
00 00 00 00 00 00 00 00
0x0012FD78 38 6d 3b 00 30 7b 3b 00 00 6f 3b 00 78 6f 3b 00 cc cc cc cc
cc cc cc cc cc cc cc

as can be seen now the "cc cc cc cc cc cc cc cc" has been changed for
"00 00 00 00 00 00 00 00", this value is changed when the line :
"XalanDocumentPrefixResolver resolver(proxyDocument)" is executed, it
seems like if the declaration would be overlapping the previous
declaration, because if you add 36 at the address of resolver the
computed address is 0x0012FD82 that and is overlaping the variable
theEvaluator !

- Variable resolver:

Address: 0x0012FD4C
size: 36

Memory dump just when it's declared:
cc cc cc cc cc cc cc cc
0x0012FD4C fc 17 11 10 70 70 cc cc 10 aa 3b 00 d0 a9 3b 00 00 cc cc cc
02 00 00 00 70 cc cc
0x0012FD67 cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 6d
3b 00 30 7b 3b 00 00 6f
0x0012FD82 3b 00 78 6f 3b 00 cc cc cc cc cc cc cc cc

(the two sequences of cc cc cc cc cc cc cc cc are present)

Memory dumo after the execution:
cc cc cc cc cc cc cc cc
0x0012FD4C 28 13 10 10 70 70 cc cc 00 00 00 00 00 00 00 00 00 cc cc cc
00 00 00 00 70 cc cc
0x0012FD67 cc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 6d 3b
00 30 7b 3b 00 00 6f
0x0012FD82 3b 00 78 6f 3b 00 cc cc cc cc cc cc cc cc cc cc

All the size have been taken through the debuger.

Jul 20 '05 #1
0 1793

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: leroybt.rm | last post by:
Can someone tell me how to run a script from a interactive shell I type the following: >>>python filename >>>python filename.py >>>run filename >>>run filename.py >>>/run filename >>>/run...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
2
by: Jenna Olson | last post by:
Hi all- I've never seen this particular issue addressed, but was wondering if there's anything to support one way or another. Say I have a class: class ManipulateData { public:...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
19
by: Bryan | last post by:
How can i run a bit of code straight from the IDE? Right now i make a temporary button and put the code behind that, then i run debug mode and click on the button. Is there a way to highlight...
6
by: Joel | last post by:
2 Questions: (1) The documentation says application.run() creates a standard message loop on the current thread and "optionally" shows a form. This is really confusing because I was of the...
7
by: Lee Crabtree | last post by:
I remember when I was first getting into .NET Forms programming that there was a rather emphatic rule about not constructing a form before calling Application.Run with it. So this: ...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
7
by: mxdevit | last post by:
Task: run application from ASP.NET for example, you have a button on ASP.NET page, when press this button - one application is invoked. the code to run application (for example, notepad) is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.