You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Balaji Srinivasan <ba...@cplane.com> on 2001/02/22 08:21:56 UTC

Purify and Xerces-C

Hi Everyone 
Has anyone tried using Rational's purify with Xerces-C? When i try to
purify a program that has linked with Xerces, it gives me a memory segment
error right at startup. Any ideas on how to fix this? Any help would be
appreciated.
Thanks
balaji


-- 
Balaji Srinivasan
balaji@cplane.com
Control Plane Technologies


Re: Purify and Xerces-C

Posted by Miroslaw Dobrzanski-Neumann <mn...@mosaic-ag.com>.
On Thu, Feb 22, 2001 at 03:53:30PM +0000, Gareth Reakes wrote:
> On Thu, 22 Feb 2001, Miroslaw Dobrzanski-Neumann wrote:
> 
> > On Thu, Feb 22, 2001 at 01:06:06PM +0000, Gareth Reakes wrote:
> > > Hello,
> > >    
> > >   I have been getting uninitialized memory reads in transcode. Even with a
> > > two line program. I thought it might have something to do with the
> > > mscvrt debug/nondebug issue, but I stopped xerces from using the debug
> > > and I am still getting them. I'm probably missing something here - I don't
> > > normally develop under windows. Anyone got any ideas?
> > 
> > There is a Bug in bool IconvLCPTranscoder::transcode() I have mailed some time
> > ago. If you say transcode a string into a very big buffer you will get this
> > bug. The method tryies to read sizeof(buffer) bytes from the string. If
> > lenth(string) < length(buffer) you always get this exception.
> > 
> 
> Is there any chance you could send me the fix so I can see if it is that?


This is for xerces 1.3 what I am currently using. I do not know if it is fixed
in 1.4. Anyway you can apply the (new style) diff below with patch program and
see what happens.

The bugfix would be:

Index: IconvTransService.cpp
===================================================================
RCS file: /repository/3rdparty/Xerces/src/util/Transcoders/Iconv/IconvTransService.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 IconvTransService.cpp
--- IconvTransService.cpp	2000/11/03 09:53:51	1.1.1.1
+++ IconvTransService.cpp	2001/02/23 08:14:31
@@ -337,6 +337,8 @@
     for (unsigned int i = 0; i < maxBytes; i++)
     {
         wideCharBuf[i] = toTranscode[i];
+	if (! wideCharBuf[i])
+		break;
     }
     wideCharBuf[maxBytes] = 0x00;
 
-- 
Miroslaw Dobrzanski-Neumann

MOSAIC SOFTWARE AG
Base Development and Research
Tel +49-2225-882-291
Fax +49-2225-882-201
E-mail: mne@mosaic-ag.com


Re: Purify and Xerces-C

Posted by Gareth Reakes <ga...@decisionsoft.com>.
On Thu, 22 Feb 2001, Miroslaw Dobrzanski-Neumann wrote:

> On Thu, Feb 22, 2001 at 01:06:06PM +0000, Gareth Reakes wrote:
> > Hello,
> >    
> >   I have been getting uninitialized memory reads in transcode. Even with a
> > two line program. I thought it might have something to do with the
> > mscvrt debug/nondebug issue, but I stopped xerces from using the debug
> > and I am still getting them. I'm probably missing something here - I don't
> > normally develop under windows. Anyone got any ideas?
> 
> There is a Bug in bool IconvLCPTranscoder::transcode() I have mailed some time
> ago. If you say transcode a string into a very big buffer you will get this
> bug. The method tryies to read sizeof(buffer) bytes from the string. If
> lenth(string) < length(buffer) you always get this exception.
> 

Is there any chance you could send me the fix so I can see if it is that?

cheers

Gareth


-- 
Gareth Reakes, Lead Software Engineer  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



Re: Purify and Xerces-C

Posted by Miroslaw Dobrzanski-Neumann <mn...@mosaic-ag.com>.
On Thu, Feb 22, 2001 at 01:06:06PM +0000, Gareth Reakes wrote:
> Hello,
>    
>   I have been getting uninitialized memory reads in transcode. Even with a
> two line program. I thought it might have something to do with the
> mscvrt debug/nondebug issue, but I stopped xerces from using the debug
> and I am still getting them. I'm probably missing something here - I don't
> normally develop under windows. Anyone got any ideas?

There is a Bug in bool IconvLCPTranscoder::transcode() I have mailed some time
ago. If you say transcode a string into a very big buffer you will get this
bug. The method tryies to read sizeof(buffer) bytes from the string. If
lenth(string) < length(buffer) you always get this exception.
-- 
Miroslaw Dobrzanski-Neumann

MOSAIC SOFTWARE AG
Base Development and Research
Tel +49-2225-882-291
Fax +49-2225-882-201
E-mail: mne@mosaic-ag.com


Re: Purify and Xerces-C

Posted by Juergen Hermann <jh...@web.de>.
On Wed, 21 Feb 2001 23:21:56 -0800 (PST), Balaji Srinivasan wrote:

>Has anyone tried using Rational's purify with Xerces-C? When i try to
>purify a program that has linked with Xerces, it gives me a memory segment
>error right at startup. Any ideas on how to fix this? Any help would be
>appreciated.

We had the same problem with using electric fence, but did not investigate 
further.


Ciao, Jürgen

--
Jürgen Hermann, Developer (jhe@webde-ag.de)
WEB.DE AG, http://webde-ag.de/



Re: Purify and Xerces-C

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hello,
   
  I have been getting uninitialized memory reads in transcode. Even with a
two line program. I thought it might have something to do with the
mscvrt debug/nondebug issue, but I stopped xerces from using the debug
and I am still getting them. I'm probably missing something here - I don't
normally develop under windows. Anyone got any ideas?

Gareth

On Wed, 21 Feb 2001, Balaji Srinivasan wrote:

> Hi Everyone 
> Has anyone tried using Rational's purify with Xerces-C? When i try to
> purify a program that has linked with Xerces, it gives me a memory segment
> error right at startup. Any ideas on how to fix this? Any help would be
> appreciated.
> Thanks
> balaji
> 
> 
> 

-- 
Gareth Reakes, Lead Software Engineer  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192