View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] Serializer "bug"

From: <MichaelL_at_frogware.com>
Date: Tue, 16 Sep 2003 16:34:54 -0400

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. :-)