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]





Reply via email to