You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Rupesh kumar <ru...@geometricsoftware.com> on 2000/01/26 15:40:37 UTC

bug??

Version number : 1.0.1

Platform: NT4 + SP4

Compiler: MSVC6

Sample file: Attached---Its basically a cut paste of DOMPrint sample

Problem: In function   ostream& operator<<(ostream& target, const DOMString& s)

When delete is called on p it results in a Debug Assertion.

In dbgheap.c and while evaluating the expression _CrtlsValidHeapPointer(pUserData)


Regards

Rupesh.

-------------May the "source" be with you----------------

Re: bug??

Posted by Joe Gregorio <jo...@mts.com>.
A way to see which DLLs are being used
is to use DEPENDS.EXE which comes with VC6. It will
tell you which 'should' be loaded if the exe was
run.

Another way is to use pview.exe which is also
a part of VC6 and will tell you
which DLL is 'really' loaded. You may find that another
application running has a local MSVCRT.DLL that 
is older than the one in the \winnt\system directory.
NT will only load one copy of a DLL with the same name
and if another application is running and has an older
copy of the MSVCRT.DLL then that is the one you will get.

	-joe

Rahul Jain wrote:
> 
> >
> >
> > Version number : 1.0.1
> > Platform: NT4 + SP4
> > Compiler: MSVC6
> >
> > Sample file: Attached---Its basically a cut paste of DOMPrint sample
> >
> > Problem: In function   ostream& operator<<(ostream& target, const DOMString& s)
> >
> > When delete is called on p it results in a Debug Assertion.
> > In dbgheap.c and while evaluating the expression _CrtlsValidHeapPointer(pUserData)
> >
> 
> >  if ((strcmp(nodeName.transcode(),"Hole") == 0) ||
> >   (strcmp(toWrite.getParentNode().getNodeName().transcode(),"Hole") == 0) ||
> >   (strcmp(nodeName.transcode(),"Assembly") == 0) ||
> >   (strcmp(nodeName.transcode(),"Part") == 0)) {
> 
> In the file that you sent with the mail, I see definite memory leaks.
> However, I do not see any other problems. As Mike mentioned make sure
> you are using the 'correct' runtime dll.
> 
> One way to ensure that everything matches up would be to download
> the source archive and recompile the Xerces-C library on your machine.
> That way the library and your application will use the same DLL's.
> 
> When you call 'transcode()', it allocates memory to store the trancoded
> string and it is the callers responsibility to delete it. The code
> in operator<< in DOMPrint and your sample is doing the right thing.
> 
> rahul

-------------------------------------
Joe Gregorio            MTS System Corp
Program Manager         www.mts.com

Re: bug??

Posted by Rahul Jain <ra...@apache.org>.
> 
> 
> Version number : 1.0.1
> Platform: NT4 + SP4
> Compiler: MSVC6
> 
> Sample file: Attached---Its basically a cut paste of DOMPrint sample
> 
> Problem: In function   ostream& operator<<(ostream& target, const DOMString& s)
> 
> When delete is called on p it results in a Debug Assertion.
> In dbgheap.c and while evaluating the expression _CrtlsValidHeapPointer(pUserData)
> 

>  if ((strcmp(nodeName.transcode(),"Hole") == 0) ||
>   (strcmp(toWrite.getParentNode().getNodeName().transcode(),"Hole") == 0) ||
>   (strcmp(nodeName.transcode(),"Assembly") == 0) ||
>   (strcmp(nodeName.transcode(),"Part") == 0)) {

In the file that you sent with the mail, I see definite memory leaks. 
However, I do not see any other problems. As Mike mentioned make sure
you are using the 'correct' runtime dll.

One way to ensure that everything matches up would be to download
the source archive and recompile the Xerces-C library on your machine.
That way the library and your application will use the same DLL's.

When you call 'transcode()', it allocates memory to store the trancoded
string and it is the callers responsibility to delete it. The code
in operator<< in DOMPrint and your sample is doing the right thing.

rahul