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 Jasmine_Shaikh <ja...@infosys.com> on 2010/09/03 10:19:46 UTC

assert in Invariants fails for aix

The second assert in invariant fails intermittently and that too only on the
aix machine. The issue is not reproducible and I am not able to conclude
anything from the core file that we got from client side.

I am using 1.2 version of Xalan. Then newer versions of Xalan implements
invariant differently.
1.2 version of invariants:
void invariants() const
{
#if !defined(NDEBUG)
		assert((m_data.size() == 0 && m_size == 0) || m_size == m_data.size() -
1);
		assert(m_data.size() == 0 || m_data.back() == 0);
#endif
}
1.10 version of invariants:
void invariants() const
{
#if !defined(NDEBUG)
		assert((m_data.empty() == true && m_size == 0) || m_size == m_data.size()
- 1);
		assert(m_data.empty() == true || m_data.back() == 0);
#endif
}

Does the new implementation fix anything?

Any help is greatly appreciated.

Regards,
Jasmine Shaikh

-- 
View this message in context: http://old.nabble.com/assert-in-Invariants-fails-for-aix-tp29612132p29612132.html
Sent from the Xalan - C - Users mailing list archive at Nabble.com.


Re: assert in Invariants fails for aix

Posted by David Bertoni <db...@apache.org>.
On 9/3/2010 1:19 AM, Jasmine_Shaikh wrote:
>
> The second assert in invariant fails intermittently and that too only on the
> aix machine. The issue is not reproducible and I am not able to conclude
> anything from the core file that we got from client side.
>
> I am using 1.2 version of Xalan. Then newer versions of Xalan implements
> invariant differently.
> 1.2 version of invariants:
> void invariants() const
> {
> #if !defined(NDEBUG)
> 		assert((m_data.size() == 0&&  m_size == 0) || m_size == m_data.size() -
> 1);
> 		assert(m_data.size() == 0 || m_data.back() == 0);
> #endif
> }
> 1.10 version of invariants:
> void invariants() const
> {
> #if !defined(NDEBUG)
> 		assert((m_data.empty() == true&&  m_size == 0) || m_size == m_data.size()
> - 1);
> 		assert(m_data.empty() == true || m_data.back() == 0);
> #endif
> }
>
> Does the new implementation fix anything?
No. It was changed because XalanDOMStringbused to be implemented using 
std::vector<XalanDOMChar> and std::string::empty() performs better than 
std::string::size() == 0 on some platforms.

You might want to build a debug version of the processor to see if you 
can get a usable core file when the assert is triggered. Also, please 
post the backtrace from the core file.

Otherwise, it will be extremely difficult to fix this, as version 1.2 is 
almost 10 years old.

Dave