Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.6.0
-
None
-
None
-
Solaris
Description
GrammarResolver.cpp allocates XMLSchemaDescription out of wrong pool
This causes a memory leak and thread safety issues when sharing
an unsynchronized grammar pool across multiple threads. I included diffs
that affect my application. It would be good if somebody could check all uses of
fGrammarPoolMemoryManager to verify the immutability of cached grammars
and thread safety for the GrammarPool. When not parsing grammars, the
pool should not change. I think fGrammarPool->createSchemaDescription may
be generally dangerous.
< XMLSchemaDescription* gramDesc = new (fMemoryManager) XMLSchemaDescriptionImpl(namespaceKey, fMemoryManager);
—
> XMLSchemaDescription* gramDesc = fGrammarPool->createSchemaDescription(namespaceKey);