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
moment.

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
program?

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

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/866932

Title:
  "X strings remain in the string pool" failing tests

Status in Zorba - The XQuery Processor:
  New

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

  test/unit/debugger/test_debugger_serialization
  test/unit/external_function
  test/unit/no_folding
  test/unit/plan_serializer

  Zorba Internal Fatal Error in C:\Program 
Files\ICW\home\zorbatst\tester\nightlies\debug\src\store\naive\string_pool.cpp:41
  X strings remain in the string pool

  More details on:
  http://zorbatest.lambda.nu:8080/cdash/viewTest.php?onlyfailed&buildid=18225

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/866932/+subscriptions

-- 
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