[Expat-discuss] problems with dtddestroy()

Gary Stephenson garys@ihug.com.au
Fri, 10 Aug 2001 16:33:50 +1000


Hi all ( "Expatriates",  ?).

I am trying to get Expat to parse the OASIS conformance test Suite
document(s). It barfs with a debug assertion failure (dbghead.c : line 1017):

_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

on either of the following lines from the dtddestroy() function:

  if (p->scaffIndex)
    FREE(p->scaffIndex);

  if (p->scaffold)
    FREE(p->scaffold);
  traceLog( "dtd 2" ) ;

Note that the failure only occurs after successfully destroying the DTD itself
(testcases.dtd), and also successfully destroying the first external entity
("xmltest\xmltest.xml").  Only then does it fail when trying to destroy the
second external entity ("japanese\japanese.xml").

I assume the error is that the "scaffold"ing has already been free()'ed, and I
notice in the dtdCopy function the following lines appear:

  /* Don't want deep copying for scaffolding */
    ...
    newDtd->scaffLevel = oldDtd->scaffLevel;
    newDtd->scaffIndex = oldDtd->scaffIndex;

which may or may not be significant.

Anybody else experienced similar problems?  Can anybody tell me the right way
to fix it?

All processed files are in UTF-8 encoding. Using 1.95.2 on Win2K (SP2).

many tias,

gary