[libvirt] [PATCH] Fix SEGV on exit after domainEventDeregister()

Philipp Hahn hahn at univention.de
Fri Jul 23 16:54:47 UTC 2010


Ping.

Am Dienstag 13 Juli 2010 10:54:26 schrieb Philipp Hahn:
> When the last callback is removed using domainEventDeregister(), the
> events dispatcher is deregistered from the C-library, but
> domainEventsCallbacks is still an empty list.
> On shutdown __del__() deregisters the dispatacher again, which SEGVs
>
> 	# You need the event-loop implementation from the Python examples;
> 	# give the file a name which is importable by Python.
> 	ln examples/domain-events/events-python/event-test.py eloop.py
> 	python -c 'from eloop import *
> 	import sys
>
> 	def dump(*args): print " ".join(map(str, args))
>
> 	virEventLoopPureStart()
> 	c = libvirt.open("xen:///")
> 	c.domainEventRegister(dump, None)
> 	c.domainEventDeregister(dump)
> 	sys.exit(0)'
>
> domainEventDeregister() needs to delete domainEventCallbacks so subsequent
> calls to __del__() and domainEventRegister() choose the right code paths.
> Setting it to None is not enough, since calling domainEventRegiser() again
> would trigger an TypeError.
>
> Signed-off-by: Philipp Hahn <hahn at univention.de>
> ---
>  python/libvirt-override-virConnect.py |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)


-- 
Philipp Hahn           Open Source Software Engineer      hahn at univention.de   
Univention GmbH        Linux for Your Business        fon: +49 421 22 232- 0
Mary-Somerville-Str.1  28359 Bremen                   fax: +49 421 22 232-99
                                                    http://www.univention.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 55_domainEventDeregister.patch
Type: text/x-diff
Size: 2201 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100723/6c88a526/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100723/6c88a526/attachment-0001.sig>


More information about the libvir-list mailing list