You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Michael Kupchuk (JIRA)" <xa...@xml.apache.org> on 2011/09/23 10:24:26 UTC

[jira] [Created] (XALANC-715) NULL pointer access => crash

NULL pointer access => crash
----------------------------

                 Key: XALANC-715
                 URL: https://issues.apache.org/jira/browse/XALANC-715
             Project: XalanC
          Issue Type: Bug
          Components: XalanC
    Affects Versions: CurrentCVS
         Environment: Any
            Reporter: Michael Kupchuk
             Fix For: CurrentCVS
         Attachments: crash.xsl, test.xml

Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.

Here is an example xslt to reproduce crash:
<?xml version='1.0' encoding='windows-1251'?>
<xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" encoding='windows-1251'/>
<xsl:strip-space elements="*"/>

  <xsl:template name="head-with-info">
    <xsl:param name="head"/>
    <xsl:param name="info"/>
    <xsl:if test="xalan:nodeset($head)/node()">
      <div class="heading"><xsl:copy-of select="$head"/></div>
    </xsl:if>
    <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
      <div class="group-info"><xsl:copy-of select="$info"/></div>
    </xsl:if>
  </xsl:template>
<xsl:template match="*" name="test">
    <xsl:value-of select="test_node/inner_test"/>
    <xsl:call-template name="head-with-info">
      <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
      <xsl:with-param name="info"><span>test info</span></xsl:with-param>
    </xsl:call-template>
</xsl:template>

</xsl:stylesheet>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Commented] (XALANC-715) NULL pointer access => crash

Posted by "Steven J. Hathaway (Commented) (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139833#comment-13139833 ] 

Steven J. Hathaway commented on XALANC-715:
-------------------------------------------

I have not yet been able to recreate the NULL pointer access issue.
                
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Resolved] (XALANC-715) NULL pointer access => crash

Posted by "Steven J. Hathaway (Resolved) (JIRA)" <xa...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven J. Hathaway resolved XALANC-715.
---------------------------------------

    Resolution: Fixed
    
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>            Assignee: Steven J. Hathaway
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, empty-nodeset-patch.diff-rev1, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Assigned] (XALANC-715) NULL pointer access => crash

Posted by "Steven J. Hathaway (Assigned) (JIRA)" <xa...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven J. Hathaway reassigned XALANC-715:
-----------------------------------------

    Assignee: Steven J. Hathaway
    
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>            Assignee: Steven J. Hathaway
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Commented] (XALANC-715) NULL pointer access => crash

Posted by "Steven J. Hathaway (Commented) (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13140934#comment-13140934 ] 

Steven J. Hathaway commented on XALANC-715:
-------------------------------------------

Patches are committed to the SVN repository to fix: empty strings, empty nodesets,  constructed nodesets, whitespace stripping (null pointer ref) when using constructed nodesets.
                
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>            Assignee: Steven J. Hathaway
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, empty-nodeset-patch.diff-rev1, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Closed] (XALANC-715) NULL pointer access => crash

Posted by "Michael Kupchuk (Closed) (JIRA)" <xa...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Kupchuk closed XALANC-715.
----------------------------------


Crash fixed.
                
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>            Assignee: Steven J. Hathaway
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, empty-nodeset-patch.diff-rev1, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Commented] (XALANC-715) NULL pointer access => crash

Posted by "Steven J. Hathaway (Commented) (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13139399#comment-13139399 ] 

Steven J. Hathaway commented on XALANC-715:
-------------------------------------------

Using the CurrentCVS for XalanC and standard XSLT operations,
I do not have problems with NULL pointers when it comes to
processing standard empty nodesets. The reported problem
appears to be localized to the xalan:nodeset() extension function.

Here is my standard validation test using standard XSLT notation.

-------------------------

Standard XSLT without using XPath function "xalan:nodeset(...)" seems to work OK.

The XML File: foo.xml

<foo/>

The XSL File: foo.xsl

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name='EmptyTest'>
 <xsl:param name='empty'/>
 <xsl:param name='bar'/>
 <parm-string parm='empty'><xsl:value-of select='$empty'/></parm-string>
 <parm-nodes  parm='empty'><xsl:copy-of select='$empty'/></parm-nodes>
 <parm-string parm='bar'><xsl:value-of select='$bar'/></parm-string>
 <parm-nodes  parm='bar'><xsl:copy-of select='$bar'/></parm-nodes>
</xsl:template>
<xsl:template match="/">
 <out>
  <xsl:call-template name='EmptyTest'>
   <xsl:with-param name='bar'><abc>my test line</abc></xsl:with-param>
  </xsl:call-template>
 </out>
</xsl:template>
</xsl:stylesheet>

The Output File: out.xml -- newlines added for readability

<?xml version="1.0" encoding="UTF-8"?>
<out>
<parm-string parm="empty"/>
<parm-nodes parm="empty"/>
<parm-string parm="bar">my test line</parm-string>
<parm-nodes parm="bar"><abc>my test line</abc></parm-nodes>
</out>

--------------------

                
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Commented] (XALANC-715) NULL pointer access => crash

Posted by "Michael Kupchuk (Commented) (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236405#comment-13236405 ] 

Michael Kupchuk commented on XALANC-715:
----------------------------------------

Sorry for so long delay with patch approval. Seems like everything is fine now. Thanx for the patch!
                
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>            Assignee: Steven J. Hathaway
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, empty-nodeset-patch.diff-rev1, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] [Commented] (XALANC-715) NULL pointer access => crash

Posted by "Michael Kupchuk (Commented) (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANC-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13140164#comment-13140164 ] 

Michael Kupchuk commented on XALANC-715:
----------------------------------------

It seems like the main issue is in the "<xsl:if test="xalan:nodeset($head)/node()">" line. I can't see anything like this in your test.
Have you tried my example transformation?
The proposed patch removes asserts which will cause the same error deeper by stack.
                
> NULL pointer access => crash
> ----------------------------
>
>                 Key: XALANC-715
>                 URL: https://issues.apache.org/jira/browse/XALANC-715
>             Project: XalanC
>          Issue Type: Bug
>          Components: XalanC
>    Affects Versions: CurrentCVS
>         Environment: Any
>            Reporter: Michael Kupchuk
>            Assignee: Steven J. Hathaway
>              Labels: crash
>             Fix For: CurrentCVS
>
>         Attachments: crash.xsl, empty-nodeset-patch.diff, test.xml
>
>
> Using a xalan:nodeset with an empty parameter causes it to return nodeset with no data, no parents, completly empty, which in further operations causes a NULL pointer access in release or debug assertion in debug.
> Maybe it's not a "very proper" use of xalan:nodeset, but IMHO crash/assertion is not the correct behaviour at all.
> Here is an example xslt to reproduce crash:
> <?xml version='1.0' encoding='windows-1251'?>
> <xsl:stylesheet exclude-result-prefixes="xalan" xmlns:xalan = "http://xml.apache.org/xalan" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
> <xsl:output method="html" indent="yes" encoding='windows-1251'/>
> <xsl:strip-space elements="*"/>
>   <xsl:template name="head-with-info">
>     <xsl:param name="head"/>
>     <xsl:param name="info"/>
>     <xsl:if test="xalan:nodeset($head)/node()">
>       <div class="heading"><xsl:copy-of select="$head"/></div>
>     </xsl:if>
>     <xsl:if test="string-length($info)>0 and xalan:nodeset($info)/node()">
>       <div class="group-info"><xsl:copy-of select="$info"/></div>
>     </xsl:if>
>   </xsl:template>
> <xsl:template match="*" name="test">
>     <xsl:value-of select="test_node/inner_test"/>
>     <xsl:call-template name="head-with-info">
>       <!-- <xsl:with-param name="head"><span>test head</span></xsl:with-param> -->
>       <xsl:with-param name="info"><span>test info</span></xsl:with-param>
>     </xsl:call-template>
> </xsl:template>
> </xsl:stylesheet>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org