473,385 Members | 1,640 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,385 software developers and data experts.

"Run-Time Check Failure #2" on Xerces & Xalan (Bug?)

Dear colleagues,

i'm getting in troubles using one XML library with Visual Studio .NET
and Xerces with Xalan.
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 ;

XalanNode * node_porqueria = 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

- Variable node_porqueria:

Address: 0x0012FD40
Size: 4

Memory dump just when it's declared:
cc cc cc cc cc cc cc cc
0x0012FD40 e0 70 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 dump after the execution:
cc cc cc cc cc cc cc cc
0x0012FD40 e0 70 3b 00 cc cc cc cc cc cc cc cc

All the size have been taken through the debuger.

Jul 22 '05 #1
1 2716
Francesc Guim Bernat <ne**@guim.net> spoke thus:
i'm getting in troubles using one XML library with Visual Studio .NET
and Xerces with Xalan.


Your post is off-topic for comp.lang.c++. Please visit

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #2

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

Similar topics

0
by: Colleyville Alan | last post by:
My app is giving me this error. Run-time error 3211: The database engine could not lock table 'Sorted_Template' because it is already in use by another person or process. When I run the app...
3
by: Stinky Pete | last post by:
I've mananged to get Access Run-time working on a Win 98 PC. I was stoked at that achievement, however I'm now stuck in that the files are opening Read only. That is, I can view all the records...
4
by: charliewest | last post by:
I need to set the selected drop down list value at run time. I am aware of the method "SelectIndex" however this works only if you know the precise location of the value within the ListItem...
1
by: Francesc Guim Bernat | last post by:
Dear colleagues, i'm getting in troubles using one XML library with Visual Studio .NET and Xerces with Xalan. When i execute the code i get the next run time error: "Run-Time Check Failure #2...
6
by: Andre Ranieri | last post by:
I'm trying to create a login page for customers to log into our corporate website, our presidents naturally wants the user and password fields to populate from a cookie so the customer doesn't have...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
4
by: PH.D.Condidater.Li.Ning | last post by:
Hi, all, I am using an uninitialised variable that generating a 'Run-Time Check Failure #3' when the debug version is running. The code is complex and changing it would be risky, so how do I...
6
by: MISASIA | last post by:
I really hope someone can help me... My office is using a Menu which running VB. There got many button in that Menu and one of the button which name as "GMR" hit error. Its prompt a message box...
5
by: stpgmn | last post by:
I'm executing the following procedure within Access mdb. The query that I'm trying to run works nolrmally when executed as Query. Do anybody has any idea of reason of the error?. Thanks a lot ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.