On Mon, Mar 31, 2008 at 11:00:56AM +0100, Richard W.M. Jones wrote: > What problem are you trying to solve? AFAICT, the problem is that the Domain/Network objects are being free'd before the remote daemon has a chance to serialze the Error object into XDR format. So it is accessing free'd memory when serializing the dom/net field in the Error object & geting back garbage. > The 'conn', 'dom' and 'net' fields in a virterror can't be accessed > safely, particularly from a garbage-collected language. The only safe > thing one could do with them is a physical equality test on the > pointer against an existing conn/dom/net pointer. > > But the solution isn't to copy the dom object, since in a GC-d > language someone could grab a handle to the copied dom which would > have a different lifetime from the error object. If anything the > solution would be to remove those fields from the error object since > they are highly unlikely to be useful in any real world application. > We can't do this because of backwards compatibility promises but we > should instead deprecate them. We should at the very least NULL-ify the dom/net fields in the Error object associated with the Connection when we free the Domain/Network object. We also probably need to re-arrange the remote daemon code a little so that it serializes to XDR format before the Domain/Network object are free'd. I agree that deep copying isn't the answer here & messes up the reference counting and will cause potential memory leaks. Dan. -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list