I have finally come up with a test case that reliably reproduces this
problem. It occurs when you create a QNameItem using ItemFactory and
pass a global zstring constant as the namespace URI. From stepping
through with the debugger, it seems QNamePool puts the namespace URI
zstrings into a StringPool, and ~StringPool doesn't like finding a
zstring in there who is still marked as "shared" (which I think actually
means "still has outstanding references"). Since the zstring is a
global, it still has a reference outstanding at the time the store is
shut down and ~StringPool is called.

I have added a unit test case which demonstrates this scenario, along
with a slight variant that does not trigger the problem (if you create a
new zstring wrapped around GLOBAL_ZSTRING.c_str(), it works fine). This
is checked in on the branch lp:~zorba-coders/zorba/strings-in-pool. On
this branch, test/libunit/qname_pool_global fails with this error, but
test/libunit/qname_pool_local passes. (I have marked qname_pool_global
as EXPECTED_FAILURE(), but since the test actually dies with an ABORT
signal due to the assert, it still fails locally. It will pass on the
validation queue, which does some post-processing for such cases.)

I can't swear this is the *only* cause of this problem, of course, but
it is at least one, and one that specifically is biting me at the

Given that this error is only occurring when the store is shutting down
(and hence presumably the process is about to end anyway), perhaps a
quick and dirty solution would be to simply eliminate the assert()? Is
this really catching any errors that are serious enough to abort the

** Changed in: zorba
     Assignee: Matthias Brantner (matthias-brantner) => Markos Zaharioudakis 

You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.

  "X strings remain in the string pool" failing tests

Status in Zorba - The XQuery Processor:

Bug description:
  The following test have started to fail because of the famous string


  Zorba Internal Fatal Error in C:\Program 
  X strings remain in the string pool

  More details on:

To manage notifications about this bug go to:

Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to