[ 
http://issues.apache.org/jira/browse/XALANC-447?page=comments#action_57376 ]
     
Robert Schiele commented on XALANC-447:
---------------------------------------

I did some more debugging: I can't see why this should be related to 
constructor eliding.

As far as I can see, a XNodeSetNodeProxy object is created, then a XObjectPtr 
registers a reference to this object. After some time the XNodeSetNodeProxy is 
destroyed and _afterwards_ the XObjectPtr tries to unregister its reference.

Thus the error message is a bit misleading, as this is just memory access to a 
deleted object. The error message just results from the fact that during 
destruction of the class the virtual function table pointer is put down to the 
base class type.

The context of object construction:

#0  XalanReferenceCountedObject (this=0x8076d8c) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/PlatformSupport/XalanReferenceCountedObject.cpp:36
#1  0x403f70bc in XObject (this=0x8076d8c, theObjectType=eTypeNodeSet) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XObject.cpp:199
#2  0x403ef815 in XNodeSetBase (this=0x8076d8c, theManager=Internal: global 
symbol `MemoryManager' found in 
/home/robert/xalan/xml-xalan/c/src/xalanc/PlatformSupport/XalanMemoryManagement.cpp
 psymtab but not in symtab.
MemoryManager may be an inlined function, or may be a template function
(if a template, try specifying an instantiation: MemoryManager<type>).
) at /home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XNodeSetBase.cpp:53
#3  0x403f3294 in XNodeSetNodeProxy (this=0x8076d8c, [EMAIL PROTECTED], 
theNode=Internal: global symbol `XalanNode' found in 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanDOM/XalanNode.cpp psymtab but 
not in symtab.
XalanNode may be an inlined function, or may be a template function
(if a template, try specifying an instantiation: XalanNode<type>).
) at /home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XNodeSetNodeProxy.cpp:79
#4  0x403f08af in xalanc_1_9::XNodeSetNodeProxyAllocator::create 
(this=0xbfffea58, value=0x80688a0) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XNodeSetNodeProxyAllocator.cpp:46
#5  0x403fd72a in xalanc_1_9::XObjectFactoryDefault::createNodeSet 
(this=0xbfffe9c0, theValue=0x80688a0) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XObjectFactoryDefault.cpp:396
#6  0x404ceca7 in xalanc_1_9::FunctionCurrent::execute (this=0x80546b8, [EMAIL 
PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/FunctionCurrent.cpp:52
#7  0x4040be69 in xalanc_1_9::XPath::runFunction (this=0x807688c, 
context=0x80688a0, opPos=0x807a550, [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XPath.cpp:2551
#8  0x40409868 in xalanc_1_9::XPath::executeMore (this=0x807688c, 
context=0x80688a0, opPos=0x807a540, [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XPath.cpp:1332
#9  0x404b2f8e in xalanc_1_9::XPath::execute (this=0x807688c, [EMAIL 
PROTECTED], [EMAIL PROTECTED], result=Internal: global symbol 
`MutableNodeRefList' found in 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/MutableNodeRefList.cpp psymtab 
but not in symtab.
MutableNodeRefList may be an inlined function, or may be a template function
(if a template, try specifying an instantiation: MutableNodeRefList<type>).
) at XPath.hpp:791
#10 0x404b1fb7 in xalanc_1_9::ElemForEach::createSelectedAndSortedNodeList 
(this=0x8078a8c, [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemForEach.cpp:280
#11 0x404a8141 in xalanc_1_9::ElemApplyTemplates::getFirstChildElemToExecute 
(this=0x8078a8c, [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemApplyTemplates.cpp:232
#12 0x404a7ef6 in xalanc_1_9::ElemApplyTemplates::startElement (this=0x8078a8c, 
[EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemApplyTemplates.cpp:151
#13 0x404c30d9 in xalanc_1_9::ElemTemplateElement::execute (this=0x8076060, 
[EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemTemplateElement.cpp:250
#14 0x4054be82 in xalanc_1_9::StylesheetRoot::process (this=0x806bac0, 
sourceTree=0x8059e70, [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.cpp:263
#15 0x40578442 in xalanc_1_9::XSLTEngineImpl::process (this=0xbfffe770, [EMAIL 
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
    [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp:350
#16 0x40593be3 in xalanc_1_9::XalanTransformer::doTransform (this=0xbfffeea0, 
[EMAIL PROTECTED], theCompiledStylesheet=0x0, theStylesheetSource=Internal: 
global symbol `XSLTInputSource' found in 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/XSLTInputSource.cpp psymtab but 
not in symtab.
XSLTInputSource may be an inlined function, or may be a template function
(if a template, try specifying an instantiation: XSLTInputSource<type>).
)
    at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:1300
#17 0x0804dceb in xalanc_1_9::XalanTransformer::transform (this=0xbfffeea0, 
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at 
XalanTransformer.hpp:167
#18 0x405915be in xalanc_1_9::XalanTransformer::transform (this=0xbfffeea0, 
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED])
    at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:338
#19 0x0804d5ce in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:631
#20 0x0804d3b4 in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:735
#21 0x0804d249 in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:761
#22 0x0804ce2d in transform ([EMAIL PROTECTED], [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:785
#23 0x0804c6be in xsltMain (argc=3, argv=0xbffff064) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:829
#24 0x0804c7cd in main (argc=3, argv=0xbffff064) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:869

The context of reference registration:

#0  0x403b9b8c in xalanc_1_9::XalanReferenceCountedObject::addReference 
(theInstance=0x8076d8c) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/PlatformSupport/XalanReferenceCountedObject.cpp:57
#1  0x403decf0 in XObjectPtr (this=0xbfffdf50, theXObject=0x8076d8c) at 
XObject.hpp:598
#2  0x403fd750 in xalanc_1_9::XObjectFactoryDefault::createNodeSet 
(this=0xbfffe9c0, theValue=0x80688a0) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XObjectFactoryDefault.cpp:401
#3  0x404ceca7 in xalanc_1_9::FunctionCurrent::execute (this=0x80546b8, [EMAIL 
PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/FunctionCurrent.cpp:52
#4  0x4040be69 in xalanc_1_9::XPath::runFunction (this=0x807688c, 
context=0x80688a0, opPos=0x807a550, [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XPath.cpp:2551
#5  0x40409868 in xalanc_1_9::XPath::executeMore (this=0x807688c, 
context=0x80688a0, opPos=0x807a540, [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XPath.cpp:1332
#6  0x404b2f8e in xalanc_1_9::XPath::execute (this=0x807688c, [EMAIL 
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at XPath.hpp:791
#7  0x404b1fb7 in xalanc_1_9::ElemForEach::createSelectedAndSortedNodeList 
(this=0x8078a8c, [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemForEach.cpp:280
#8  0x404a8141 in xalanc_1_9::ElemApplyTemplates::getFirstChildElemToExecute 
(this=0x8078a8c, [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemApplyTemplates.cpp:232
#9  0x404a7ef6 in xalanc_1_9::ElemApplyTemplates::startElement (this=0x8078a8c, 
[EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemApplyTemplates.cpp:151
#10 0x404c30d9 in xalanc_1_9::ElemTemplateElement::execute (this=0x8076060, 
[EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/ElemTemplateElement.cpp:250
#11 0x4054be82 in xalanc_1_9::StylesheetRoot::process (this=0x806bac0, 
sourceTree=0x8059e70, [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/StylesheetRoot.cpp:263
#12 0x40578442 in xalanc_1_9::XSLTEngineImpl::process (this=0xbfffe770, [EMAIL 
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
    [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp:350
#13 0x40593be3 in xalanc_1_9::XalanTransformer::doTransform (this=0xbfffeea0, 
[EMAIL PROTECTED], theCompiledStylesheet=0x0, theStylesheetSource=0xbfffee00, 
[EMAIL PROTECTED])
    at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:1300
#14 0x0804dceb in xalanc_1_9::XalanTransformer::transform (this=0xbfffeea0, 
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at 
XalanTransformer.hpp:167
#15 0x405915be in xalanc_1_9::XalanTransformer::transform (this=0xbfffeea0, 
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED])
    at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:338
#16 0x0804d5ce in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:631
#17 0x0804d3b4 in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:735
#18 0x0804d249 in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:761
#19 0x0804ce2d in transform ([EMAIL PROTECTED], [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:785
#20 0x0804c6be in xsltMain (argc=3, argv=0xbffff064) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:829
#21 0x0804c7cd in main (argc=3, argv=0xbffff064) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:869

The context of destruction:

#0  ~XalanReferenceCountedObject (this=0x8076d8c) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/PlatformSupport/XalanReferenceCountedObject.cpp:44
#1  0x403f71ee in ~XObject (this=0x8076d8c) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XObject.cpp:213
#2  0x403efb7c in ~XNodeSetBase (this=0x8076d8c) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XNodeSetBase.cpp:69
#3  0x403f34c5 in ~XNodeSetNodeProxy (this=0x8076d8c) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XNodeSetNodeProxy.cpp:93
#4  0x403f2a3f in ~ReusableArenaBlock (this=0x8074fc8) at 
ReusableArenaBlock.hpp:125
#5  0x403f2962 in 
xalanc_1_9::XalanDestroyFunctor<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short> >::operator() (this=0xbfffe2d3, [EMAIL PROTECTED])
    at STLHelper.hpp:46
#6  0x403f2923 in 
xalanc_1_9::XalanDestroyFunctor<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short> >::operator() (this=0xbfffe2d3, theArg=0x8074fc8,
    [EMAIL PROTECTED]) at STLHelper.hpp:68
#7  0x403f28f4 in 
xalanc_1_9::XalanDestroyFunctor<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short> >::operator() (this=0xbfffe2d3, theArg=0x8074fc8,
    [EMAIL PROTECTED]) at STLHelper.hpp:79
#8  0x403f2895 in 
xalanc_1_9::DeleteFunctor<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short> >::operator() (this=0xbfffe31c, thePointer=0x8074fc8)
    at STLHelper.hpp:126
#9  0x403f1da0 in 
std::for_each<xalanc_1_9::XalanListIteratorBase<xalanc_1_9::XalanListIteratorTraits<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short>*>, 
xalanc_1_9::XalanList<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short>*>::Node>, 
xalanc_1_9::DeleteFunctor<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short> > > (__first={currentNode = 0x8076e80}, __last={currentNode = 
0x80548b8}, __f=
      
{<std::unary_function<xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy,
 unsigned short> const*, void>> = {<No data fields>}, m_memoryManager = 
@0x8052088}) at stl_algo.h:157
#10 0x403f0d65 in xalanc_1_9::ArenaAllocator<xalanc_1_9::XNodeSetNodeProxy, 
xalanc_1_9::ReusableArenaBlock<xalanc_1_9::XNodeSetNodeProxy, unsigned short> 
>::reset (this=0xbfffea58)
    at ArenaAllocator.hpp:200
#11 0x403f095c in xalanc_1_9::XNodeSetNodeProxyAllocator::reset 
(this=0xbfffea58) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XNodeSetNodeProxyAllocator.cpp:67
#12 0x403fdd53 in xalanc_1_9::XObjectFactoryDefault::reset (this=0xbfffe9c0) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XPath/XObjectFactoryDefault.cpp:522
#13 0x405771a9 in xalanc_1_9::XSLTEngineImpl::reset (this=0xbfffe770) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/XSLTEngineImpl.cpp:183
#14 0x405222b7 in xalanc_1_9::StylesheetExecutionContextDefault::reset 
(this=0x8056958) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp:1917
#15 0x405935c9 in ~EnsureReset (this=0xbfffe760) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:1138
#16 0x40593d8b in xalanc_1_9::XalanTransformer::doTransform (this=0xbfffeea0, 
[EMAIL PROTECTED], theCompiledStylesheet=0x0, theStylesheetSource=0xbfffee00, 
[EMAIL PROTECTED])
    at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:1300
#17 0x0804dceb in xalanc_1_9::XalanTransformer::transform (this=0xbfffeea0, 
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]) at 
XalanTransformer.hpp:167
#18 0x405915be in xalanc_1_9::XalanTransformer::transform (this=0xbfffeea0, 
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED])
    at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanTransformer/XalanTransformer.cpp:338
#19 0x0804d5ce in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:631
#20 0x0804d3b4 in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED], [EMAIL PROTECTED])
    at /home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:735
#21 0x0804d249 in transform ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL 
PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:761
#22 0x0804ce2d in transform ([EMAIL PROTECTED], [EMAIL PROTECTED]) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:785
#23 0x0804c6be in xsltMain (argc=3, argv=0xbffff064) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:829
#24 0x0804c7cd in main (argc=3, argv=0xbffff064) at 
/home/robert/xalan/xml-xalan/c/src/xalanc/XalanExe/XalanExe.cpp:869

The context of unregistration of the reference was already posted in an earlier 
comment.

> Xalan crashes with "pure virtual method called"
> -----------------------------------------------
>
>          Key: XALANC-447
>          URL: http://issues.apache.org/jira/browse/XALANC-447
>      Project: XalanC
>         Type: Bug
>   Components: XalanC
>     Versions: 1.9
>  Environment: Linux/x86
>     Reporter: Robert Schiele
>      Fix For: CurrentCVS

>
> When you run the stylesheet
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>   <xsl:template match="*">
>     <xsl:apply-templates select="current()" mode="a"/>
>   </xsl:template>
>   <xsl:template match="*" mode="a">
>     <xsl:apply-templates select="current()" mode="b"/>
>   </xsl:template>
>   <xsl:template match="*" mode="b">
>     <xsl:call-template name="a">
>       <xsl:with-param name="a">
>         <xsl:for-each select="*">
>           <xsl:variable name="a"/>
>         </xsl:for-each>
>       </xsl:with-param>
>     </xsl:call-template>
>   </xsl:template>
>   <xsl:template name="a"/>
> </xsl:stylesheet>
> on any XML file with "Xalan file.xml file.xsl" Xalan crashes with
> pure virtual method called
> Aborted
> This happens with self built Xalan and with the provided binaries for RedHat 
> 8.0.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to