Hi Dave,

Thanks for your reply.

Your suspicions about Purify and/or Sun CC misbehaving seem to be true.
We have recompiled Xerces, Xalan and the SimpleTransform application
and applied Purify again. Now it reports freeing of unallocated memory
in the standard library vector class (see output below).

Oh well, too bad development tools aren't always of better quality than
our own applications ... ;-)

We'll keep an eye on it and report if we find anything else that might
be useful wrt this.

Cheers,
Tom

--------------------
Purify output:
      FUM: Freeing unallocated memory (500 times)
      This is occurring while in:
            free           [rtlib.o]
            c2k6FPv_v___1  [libCrun.so.1]
            void operator delete(void*) [rtlib.o]
            void std::allocator<unsigned
short>::deallocate(void*,unsigned) [libxalan-c1_3.so]
            void std::allocator_interface<std::allocator<unsigned
short>,unsigned short>::deallocate(unsigned short*,unsigned)
[libxalan-c1_3.so]
            std::vector<unsigned short,std::allocator<unsigned short>
>::~vector() [libxalan-c1_3.so]
      Attempting to free block at 0x141ac8 already freed.
      This block was allocated from:
            malloc         [rtlib.o]
            c2n6Fi_Pv___1  [libCrun.so.1]
            void*operator new(unsigned) [rtlib.o]
            void*std::allocator<unsigned
short>::allocate(unsigned,void*) [libxalan-c1_3.so]
            unsigned
short*std::allocator_interface<std::allocator<unsigned short>,unsigned
short>::allocate(unsigned,unsigned short*) [libxalan-c1_3.so]
            void std::vector<unsigned short,std::allocator<unsigned
short> >::reserve(unsigned) [libxalan-c1_3.so]
      There have been 1 frees since this block was freed from:
            free           [rtlib.o]
            c2k6FPv_v___1  [libCrun.so.1]
            void operator delete(void*) [rtlib.o]
            void std::allocator<unsigned
short>::deallocate(void*,unsigned) [libxalan-c1_3.so]
            void std::allocator_interface<std::allocator<unsigned
short>,unsigned short>::deallocate(unsigned short*,unsigned)
[libxalan-c1_3.so]
            std::vector<unsigned short,std::allocator<unsigned short>
>::~vector() [libxalan-c1_3.so]
---------------------------------------------------------



--- David N Bertoni/Cambridge/IBM <[EMAIL PROTECTED]> wrote:
> 
> We regularly test on Win32 with Microsoft's debug heap library, which
> is
> very good at catching objects that have been deleted twice.  I think
> either
> Purify is confused or the Sun compiler is generating some bogus code
> (I'm
> betting on the former).  Look at the call stack where the memory was
> allocated, and where it was deleted -- they're practically identical.
> Then, look at the code to see if there are any calls to delete.  I
> don't
> see one, and there shouldn't be one.  The other possibility is that
> Purify
> is missing an allocation call that re-allocated that particular
> block.
> 
> I'll do some debugging of the Win32 build to see if there are any
> calls to
> operator delete in the contructor of FormatterToXML or any of it's
> member
> objects.
> 
> This is unlikely to be related to bug 6270, which only manifested
> itself
> when appending more than once to the same string, under certain
> circumstances.  That bug never occurred in Xalan-proper, only in a
> user's
> code.
> 
> Dave
> 
> 
> 
> |---------+--------------------------->
> |         |           Thomas Munaretto|
> |         |           <[EMAIL PROTECTED]|
> |         |           o.com>          |
> |         |                           |
> |         |           03/28/2002 04:39|
> |         |           AM              |
> |         |                           |
> |---------+--------------------------->
>  
>
>---------------------------------------------------------------------------------------------------------------------------|
>   |                                                                  
>                                                         |
>   |        To:      [email protected]                     
>                                                         |
>   |        cc:      (bcc: David N Bertoni/Cambridge/IBM)             
>                                                         |
>   |        Subject: Freeing unallocated memory in
> FormatterToXML::FormatterToXML(...)                                  
>       |
>  
>
>---------------------------------------------------------------------------------------------------------------------------|
> 
> 
> 
> Hi all,
> 
> While purifying one of our apps in order to find memory management
> problems we have come across a "freeing of unallocated memory" in
> Xalan-C. We were able to consistently reproduce this with the
> "SimpleTransform" sample app from the Xalan-C distribution.
> 
> Since our application is supposed to be running uninterrupted for
> days,
> this is very likely to cause problems.
> 
> According to purify the freeing is happening in
> FormatterToXML::FormatterToXML(...), the allocation of the memory in
> XalanDOMString::append(). I was actually wondering whether this is
> related to bug http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6270
> or the fix of that bug (which we are already using).
> 
> Our environment:
> XalanC 1.3
> XercesC 1.6
> Solaris 2.6
> Sun Workshop 6.2
> Purify 5.1
> 
> Has anybody similar findings? Workarounds?
> 
> Attached a file with the purify output from running SimpleTransform.
> 
> 
> Regards,
> Tom
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards�
> http://movies.yahoo.com/       FUM: Freeing unallocated memory
>       This is occurring while in:
>             free           [rtlib.o]
>             c2k6FPv_v___1  [libCrun.so.1]
>             void operator delete(void*) [rtlib.o]
>             FormatterToXML::FormatterToXML(Writer&,const
> XalanDOMString&,bool,int,const XalanDOMString&,const
> XalanDOMString&,const
> XalanDOMString&,const XalanDOMString&,bool,const
> XalanDOMString&,FormatterListener::eFormat,bool) [libxalan-c1_3.so]
> 
>
FormatterToXML*StylesheetExecutionContextDefault::createFormatterToXML(Writer&,const
> 
> XalanDOMString&,bool,int,const XalanDOMString&,const
> XalanDOMString&,const
> XalanDOMString&,const XalanDOMString&,bool,const XalanDOMString&)
> [libxalan-c1_3.so]
> 
>
FormatterListener*StylesheetRoot::setupFormatterListener(XSLTResultTarget&,StylesheetExecutionContext&)const
> 
> [libxalan-c1_3.so]
>             void
>
StylesheetRoot::process(XalanNode*,XSLTResultTarget&,StylesheetExecutionContext&)const
> 
> [libxalan-c1_3.so]
>             void XSLTEngineImpl::process(const XSLTInputSource&,const
>
XSLTInputSource&,XSLTResultTarget&,StylesheetConstructionContext&,StylesheetExecutionContext&)
> 
> [libxalan-c1_3.so]
>             int XalanTransformer::transform(const
> XalanParsedSource&,const
> XSLTInputSource&,const XSLTResultTarget&) [libxalan-c1_3.so]
>             int XalanTransformer::transform(const
> XSLTInputSource&,const
> XSLTInputSource&,const XSLTResultTarget&) [libxalan-c1_3.so]
>             main           [SimpleTransform.cpp]
>             _start         [crt1.o]
>       Attempting to free block at 0x14de58 already freed.
>       This block was allocated from:
>             malloc         [rtlib.o]
>             c2n6Fi_Pv___1  [libCrun.so.1]
>             void*operator new(unsigned) [rtlib.o]
>             void std::vector<unsigned short,std::allocator<unsigned
> short>
> >::reserve(unsigned) [XalanDOMString.cpp]
>             XalanDOMString&XalanDOMString::append(const unsigned
> short*,unsigned) [libxalan-c1_3.so]
>             XalanDOMString::XalanDOMString(const unsigned
> short*,unsigned)
> [libxalan-c1_3.so]
>             FormatterToXML::FormatterToXML(Writer&,const
> XalanDOMString&,bool,int,const XalanDOMString&,const
> XalanDOMString&,const
> XalanDOMString&,const XalanDOMString&,bool,const
> XalanDOMString&,FormatterListener::eFormat,bool) [libxalan-c1_3.so]
> 
>
FormatterToXML*StylesheetExecutionContextDefault::createFormatterToXML(Writer&,const
> 
> XalanDOMString&,bool,int,const XalanDOMString&,const
> XalanDOMString&,const
> XalanDOMString&,const XalanDOMString&,bool,const XalanDOMString&)
> [libxalan-c1_3.so]
> 
>
FormatterListener*StylesheetRoot::setupFormatterListener(XSLTResultTarget&,StylesheetExecutionContext&)const
> 
> [libxalan-c1_3.so]
>             void
>
StylesheetRoot::process(XalanNode*,XSLTResultTarget&,StylesheetExecutionContext&)const
> 
> [libxalan-c1_3.so]
>             void XSLTEngineImpl::process(const XSLTInputSource&,const
>
XSLTInputSource&,XSLTResultTarget&,StylesheetConstructionContext&,StylesheetExecutionContext&)
> 
> [libxalan-c1_3.so]
>             int XalanTransformer::transform(const
> XalanParsedSource&,const
> XSLTInputSource&,const XSLTResultTarget&) [libxalan-c1_3.so]
>             int XalanTransformer::transform(const
> XSLTInputSource&,const
> XSLTInputSource&,const XSLTResultTarget&) [libxalan-c1_3.so]
>             main           [SimpleTransform.cpp]
>             _start         [crt1.o]
>       There have been 1 frees since this block was freed from:
>             free           [rtlib.o]
>             c2k6FPv_v___1  [libCrun.so.1]
>             void operator delete(void*) [rtlib.o]
>             FormatterToXML::FormatterToXML(Writer&,const
> XalanDOMString&,bool,int,const XalanDOMString&,const
> XalanDOMString&,const
> XalanDOMString&,const XalanDOMString&,bool,const
> XalanDOMString&,FormatterListener::eFormat,bool) [libxalan-c1_3.so]
> 
>
FormatterToXML*StylesheetExecutionContextDefault::createFormatterToXML(Writer&,const
> 
> XalanDOMString&,bool,int,const XalanDOMString&,const
> XalanDOMString&,const
> XalanDOMString&,const XalanDOMString&,bool,const XalanDOMString&)
> [libxalan-c1_3.so]
> 
>
FormatterListener*StylesheetRoot::setupFormatterListener(XSLTResultTarget&,StylesheetExecutionContext&)const
> 
> [libxalan-c1_3.so]
>             void
>
StylesheetRoot::process(XalanNode*,XSLTResultTarget&,StylesheetExecutionContext&)const
> 
> [libxalan-c1_3.so]
>             void XSLTEngineImpl::process(const XSLTInputSource&,const
>
XSLTInputSource&,XSLTResultTarget&,StylesheetConstructionContext&,StylesheetExecutionContext&)
> 
> [libxalan-c1_3.so]
>             int XalanTransformer::transform(const
> XalanParsedSource&,const
> XSLTInputSource&,const XSLTResultTarget&) [libxalan-c1_3.so]
>             int XalanTransformer::transform(const
> XSLTInputSource&,const
> XSLTInputSource&,const XSLTResultTarget&) [libxalan-c1_3.so]
>             main           [SimpleTransform.cpp]
>             _start         [crt1.o]
> 
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

Reply via email to