qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] better handling of removal in IOHandlerRecord list
@ 2007-01-10 16:34 jerome Arbez-Gindre
  2007-01-11 13:56 ` jerome Arbez-Gindre
  0 siblings, 1 reply; 4+ messages in thread
From: jerome Arbez-Gindre @ 2007-01-10 16:34 UTC (permalink / raw)
  To: qemu-devel

Hi,

by a call to qemu_set_fd_handler(fd,NULL,NULL,NULL) in the fd_read
callback, I have generated a "Segmentation fault" in vl.c.

My solution is not very smart... but it is very simple.



Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.236
diff -u -r1.236 vl.c
--- vl.c	9 Jan 2007 19:44:41 -0000	1.236
+++ vl.c	10 Jan 2007 16:06:45 -0000
@@ -5926,6 +5926,11 @@
             if (FD_ISSET(ioh->fd, &rfds)) {
                 ioh->fd_read(ioh->opaque);
             }
+        }
+        /* the IOHandlerRecord could have been removed from the list
+           and freed during ioh->fd_read call */
+        for(ioh = first_io_handler; ioh != NULL; ioh = ioh_next) {
+            ioh_next = ioh->next;
             if (FD_ISSET(ioh->fd, &wfds)) {
                 ioh->fd_write(ioh->opaque);
             }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-11 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-10 16:34 [Qemu-devel] [PATCH] better handling of removal in IOHandlerRecord list jerome Arbez-Gindre
2007-01-11 13:56 ` jerome Arbez-Gindre
2007-01-11 15:00   ` jerome Arbez-Gindre
2007-01-11 19:58     ` Fabrice Bellard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).