You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "David Bertoni (JIRA)" <xe...@xml.apache.org> on 2005/04/29 22:25:20 UTC
[jira] Resolved: (XERCESC-1407) GrammarResolver has a bug with cached Grammar instances
[ http://issues.apache.org/jira/browse/XERCESC-1407?page=all ]
David Bertoni resolved XERCESC-1407:
------------------------------------
Resolution: Fixed
Fix Version: Nightly build (please specify the date)
> GrammarResolver has a bug with cached Grammar instances
> -------------------------------------------------------
>
> Key: XERCESC-1407
> URL: http://issues.apache.org/jira/browse/XERCESC-1407
> Project: Xerces-C++
> Type: Bug
> Components: Validating Parser (Schema) (Xerces 1.5 or up only)
> Versions: 2.6.0
> Reporter: David Bertoni
> Assignee: David Bertoni
> Priority: Critical
> Fix For: Nightly build (please specify the date)
> Attachments: patch.txt
>
> GrammarResolver will fail to orphan a Grammar instance if the XMLGrammarPool instance it is using refused to cache the grammar when it was first added. This can be seen by the the following code in GrammarResolver::putGrammar():
> /***
> * the grammar will be either in the grammarpool, or in the grammarbucket
> */
> if (!fCacheGrammar || !fGrammarPool->cacheGrammar(grammarToAdopt))
> {
> // either we aren't caching or the grammar pool doesn't want it
> // so we need to look after it
> fGrammarBucket->put( (void*) grammarToAdopt->getGrammarDescription()->getGrammarKey(), grammarToAdopt );
> If the second branch of the if fails, the GrammarResolver will put the Grammar instance in fGrammarBucket. However, in orphanGrammar(), it fails to check to see if the instance was put there. This can lead to a situation where the Grammar instance is in fGrammarBucket twice, which will result in an attempt to delete twice, as it will be in fGrammarBucket with two different keys.
> I am attaching a patch. Could other committers please review? Thanks!
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org