Daniel P. Berrange wrote: > On Sat, Feb 24, 2007 at 11:54:17AM -0600, Anthony Liguori wrote: > >> I was getting random SEGVs when disconnecting from the VNC server. I >> tracked it down to the fact that if you remove a IOHandler from another >> IOHandler, all sorts of badness may result as you're removing entries >> from a linked list while transversing it. >> >> My solution is to simply add a deleted flag to each entry and walk the >> list a second time. During the second transversal, we'll remove nodes >> that need removing. >> >> Haven't seen the SEGV since I started using this patch. >> > > That's pretty much identical solution to the one I just posted along with > the patches for VNC TLS support, so I can also confirm this approach works > & solves the SEGV issue. > Except I was missing one thing that you're patch had. I didn't reset deleted when a new handler was deleted and added again from the same callback. Attached patch addresses that. Regards, Anthony Liguori > Regards, > Dan. >