All, I've been doing some testing of the virConnectRef() function, and as far as I can tell, it's busted. Here's the simple example program I'm using: #include <stdio.h> #include <stdlib.h> #include <libvirt/libvirt.h> #include <unistd.h> int main(int argc, char *argv[]) { virConnectPtr conn; conn = virConnectOpen(NULL); printf("type is %s\n",virConnectGetType(conn)); virConnectRef(conn); virConnectClose(conn); virConnectClose(conn); return 0; } When compiling and running this program, I get a segfault during the *second* virConnectClose(). The crash comes in the remote_internal driver, because the first virConnectClose() actually freed up the remote_internal private memory, and now the second one comes along and accesses a NULL pointer. I think this actually points to a bug in virConnectClose(); we shouldn't be running the ->close() callbacks on the drivers until we are going to be really closing up the driver, i.e. we should move all of the ->close() callbacks into virUnrefConnect(). Is that the right way to fix this? -- Chris Lalancette -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list