[redland-dev] librdf_free_list assertion failure

Norman Gray Norman at astro.gla.ac.uk
Mon Mar 8 23:13:53 CET 2010


Greetings.

I've been developing against the librdf library (redland 1.0.10 on OS X 10.6), and have just started to get messages about an assertion error:

rdf_list.c:110: (librdf_free_list) assertion failed: Iterators were active on freeing list

(this doesn't cause a crash or anything, but the library is clearly unhappy about things)

It's not completely clear from the message what this is trying to tell me, but a little burrowing with the debugger tells me it's happening within librdf_storage_close:

#0  0x0141482f in librdf_free_list ()
#1  0x01423354 in librdf_storage_list_close ()
#2  0x01415c07 in librdf_storage_close ()
#3  0x014115d6 in librdf_model_storage_destroy ()
#4  0x0140e92f in librdf_free_model ()
[...]

Looking at the corresponding source, it appears to be associated with my freeing a storage object before I've freed an iterator over the storage object.

I can see that this might plausibly be regarded as a programming error on my part, but in this case it's happening within the exit handler of a garbage-collected system (in a binding to mzscheme, in fact), so that (a) I genuinely do want everything to be shut down neatly, now, no questions asked, and (b) it rapidly gets messy trying to enforce an order on librdf_free_* calls at this stage.

So, my questions: 

  * Is this analysis correct?
  * Is there anything I can do about it at present? (short of embarking on a potentially errorprone fandango over objects to impose a shutdown order in the exit handler)
  * If not, does this sound like a plausible enhancement request?  It would suit _me_ very well if closing the storage object simply blew away the un-emptied iterator objects, rather than objecting to them.  Also, the storage object isn't documented as holding on to the iterator objects that are related to it, so I wouldn't have been able to know to avoid this from the API docs.

Thanks for any advice.

Best wishes,

Norman


-- 
Norman Gray  :  http://nxg.me.uk





More information about the redland-dev mailing list