[Xotcl] Serializer "bug"

MichaelL at frogware.com MichaelL at frogware.com
Tue Sep 16 22:34:54 CEST 2003


Since you're getting 1.1 ready...

I ran across a very, very subtle bug. I was using the serializer to 
serialize an obj tree. The topological sorting wasn't quite working for 
one case. In the end, I tracked it down to the fact that I was passing in 
an unqualified name. The sorting routine was in turn using fully qualified 
references as it tried to build the correct ordering, and the mismatch 
meant that it got some orderings for the root object slightly wrong. 
(Basically a few objects were being created before their containers; their 
containers were objects aggregated by the root object.)

In effect, I was using this:

        Serializer deepSerialize obj

when I should have been using this:

        Serializer deepSerialize ::obj

I don't think you'd be able to reproduce this easily, because it turned 
out to relate to a specific set of objects and relationships. It turns out 
that for other reasons, even when you make this "mistake" the algorithm 
nearly works.

To make this work you'd either have to a) require fully qualified names or 
b) turn a name into a fully qualified name. I don't know enough about Tcl 
internals to say that (b) is a realistic option--but on the face of it it 
doesn't seem like it would be.

Don't know if this helps much. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://alice.wu-wien.ac.at/pipermail/xotcl/attachments/20030916/1aff6b63/attachment.html


More information about the Xotcl mailing list