You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by David Hubbard <DH...@opentext.com> on 2008/02/28 16:35:10 UTC

assert in debug build on vs 2005

Hi Everyone,

 

Does anyone know if defining the symbol NDEBUG turns off asserts in the
debug build for xalan.

 

Thanks for your help.


Re: assert in debug build on vs 2005

Posted by David Bertoni <db...@apache.org>.
David Hubbard wrote:
> Hi Dave,
> 
> I run an xslt that uses the document function. When it runs the
> following assert gets hit in 
> Xalanvector.hpp:
> 
>     invariants() const
>     {
>>>>>    assert(m_allocation >= m_size);     <<<<<<<<
>         assert(
>             m_data == 0 && m_allocation == 0 ||
>             m_data != 0 && m_allocation != 0);
>     }
> 
> 
I'm going to try to reproduce this.  In the meantime, can you run in the 
debugger and post the entire stack frame?

Thanks!

Dave

RE: assert in debug build on vs 2005

Posted by David Hubbard <DH...@opentext.com>.
Hi Dave,

I run an xslt that uses the document function. When it runs the
following assert gets hit in 
Xalanvector.hpp:

    invariants() const
    {
>>>>    assert(m_allocation >= m_size);     <<<<<<<<
        assert(
            m_data == 0 && m_allocation == 0 ||
            m_data != 0 && m_allocation != 0);
    }


This is the stylesheet and below is the xml data file. The stylesheet
pulls a small xml file off a server
using the document function:

StyleSheet:

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
	
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>



	<xsl:template match="livelink">
		<html>
		<head>
			<title>
				XSL Server-side Transformation of XML
Export
			</title>
		</head>
		
		<body>
			<ul>
				<xsl:apply-templates/>
			</ul>		
		</body>

		</html>
	</xsl:template>

	<xsl:template match="llnode">
		<li><b><xsl:value-of select="@name"/></b></li>
		<ul>
			<li>Created by <i><xsl:value-of
select="@createdbyname"/></i></li>
			<li>Created on <i><xsl:value-of
select="@created"/></i></li>
			<li>Mimetype <i><xsl:value-of
select="@mimetype"/></i></li>
			<li>Nodetype <i><xsl:value-of
select="@objname"/></i></li>
			<li>Size <i><xsl:value-of
select="@size"/></i></li>
		</ul>
		<b>GET GROUPREF</b><br />
		<xsl:apply-templates select="groupref" />
	</xsl:template>


	<xsl:template match="groupref">
		<b>GROUPREF MADE IT</b>
		<br />
		<b><xsl:value-of select="@href"/></b>
		<br />
		<xsl:apply-templates select="document(@href)//group"/>
	</xsl:template>


	<xsl:template match="group">
		<b>GROUP MADE IT</b>
		<br />
		<li><b><xsl:value-of select="@name"/></b></li>
	</xsl:template>


</xsl:stylesheet>

Xml Datafile:

<?xml version="1.0" encoding="ISO-8859-1"?>
<livelink appversion='9.7.1' src='XmlExport'>
  <llvolume created='2008-02-26T09:49:32' createdby='1000'
createdbyname='Admin' description='' id='2000'
modified='2008-02-26T09:54:01' name='Enterprise' objname='Enterprise
Workspace' objtype='141' ownedby='1000' ownedbyname='Admin'
parentid='-1' size='1'>
    <Nickname domain=''></Nickname>
    <groupref href='http://localhost/Groups/hrgroup.xml'>
    </groupref>
    <llnode created='2008-02-26T09:54:01' createdby='1000'
createdbyname='Admin' description='' id='2222'
modified='2008-02-26T09:54:01' name='My Folder' objname='Folder'
objtype='0' ownedby='1000' ownedbyname='Admin' parentid='2000' size='0'>
      <Nickname domain=''></Nickname>
      <MajorMinorContainer>false</MajorMinorContainer>
      <groupref href='http://localhost/Groups/hrgroup.xml'>
      </groupref>
    </llnode>
  </llvolume>
</livelink>

Xml file pulled using document function:


<?xml version='1.0'?>
<group name="hr">
  <leader>mo</leader>
  <member>bo</member>
  <member>ko</member>
  <member>lo</member>
</group>





<?xml version="1.0" encoding="ISO-8859-1"?>
<livelink appversion='9.7.1' src='XmlExport'>
  <llvolume created='2008-02-26T09:49:32' createdby='1000'
createdbyname='Admin' description='' id='2000'
modified='2008-02-26T09:54:01' name='Enterprise' objname='Enterprise
Workspace' objtype='141' ownedby='1000' ownedbyname='Admin'
parentid='-1' size='1'>
    <Nickname domain=''></Nickname>
    <groupref href='http://localhost/Groups/hrgroup.xml'>
    </groupref>
    <llnode created='2008-02-26T09:54:01' createdby='1000'
createdbyname='Admin' description='' id='2222'
modified='2008-02-26T09:54:01' name='My Folder' objname='Folder'
objtype='0' ownedby='1000' ownedbyname='Admin' parentid='2000' size='0'>
      <Nickname domain=''></Nickname>
      <MajorMinorContainer>false</MajorMinorContainer>
      <groupref href='http://localhost/Groups/hrgroup.xml'>
      </groupref>
    </llnode>
  </llvolume>
</livelink>


-----Original Message-----
From: David Bertoni [mailto:dbertoni@apache.org] 
Sent: Thursday, February 28, 2008 9:51 AM
To: xalan-c-users@xml.apache.org
Subject: Re: assert in debug build on vs 2005

David Hubbard wrote:
> Hi Everyone,
> 
> Does anyone know if defining the symbol NDEBUG turns off asserts in
the 
> debug build for xalan.
Yes, but why would you want to do that?  The asserts indicate real 
problems, not something you should ignore.

If you're getting an assert, please provide the details, because it
could 
be a bug.

Dave

Re: assert in debug build on vs 2005

Posted by David Bertoni <db...@apache.org>.
David Hubbard wrote:
> Hi Everyone,
> 
> Does anyone know if defining the symbol NDEBUG turns off asserts in the 
> debug build for xalan.
Yes, but why would you want to do that?  The asserts indicate real 
problems, not something you should ignore.

If you're getting an assert, please provide the details, because it could 
be a bug.

Dave