Re: repeat(0)/repeat(1) and stop()/start()

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
On Thu, Feb 24, 2000 at 08:05:25AM -0500, Joshua N Pritikin wrote:
> On Thu, Feb 24, 2000 at 10:13:23AM +0100, [email protected] wrote:
> > > Maybe you can get a C-level stack trace?
> >
> > I attach the debug session log. I forced program termination by a
> > conditional dump() in a $SIG{__WARN__} hook. The calling condition was
> > "Event.pm" in the message.
> 
> I am able to reproduce the problem by using select() instead of poll().

Here's a fix:

==== //depot/D/Event/c/unix_io.c#26 - /cache/D/Event/c/unix_io.c ====
--- /tmp/tmp.15319.0	Thu Feb 24 08:44:29 2000
+++ /cache/D/Event/c/unix_io.c	Thu Feb 24 08:43:46 2000
@@ -45,8 +45,8 @@
 }
 
 /************************************************* POLL */
-#if defined(HAS_POLL) && !PE_IO_WAIT
-#define PE_IO_WAIT 1
+#if defined(HAS_POLL) && !PE_SYS_IO
+#define PE_SYS_IO 1
 
 static struct pollfd *Pollfd=0;
 static int pollMax=0;
@@ -125,9 +125,9 @@
     }
     ev = (pe_io*) IOWatch.next->self;
     while (ev) {
+	pe_io *next_ev = (pe_io*) ev->ioring.next->self;
 	STRLEN n_a;
 	int xref = ev->xref;
-	pe_io *next_ev = (pe_io*) ev->ioring.next->self;
 	if (xref >= 0) {
 	    int got = 0;
 	    int mask = Pollfd[xref].revents;
@@ -152,8 +152,8 @@
 
 
 /************************************************* SELECT */
-#if defined(HAS_SELECT) && !PE_IO_WAIT
-#define PE_IO_WAIT 1
+#if defined(HAS_SELECT) && !PE_SYS_IO
+#define PE_SYS_IO 1
 
 static int Nfds;
 static fd_set Rfds, Wfds, Efds;
@@ -246,6 +246,7 @@
     }
     ev = IOWatch.next->self;
     while (ev) {
+	pe_io *next_ev = (pe_io*) ev->ioring.next->self;
 	int fd = ev->fd;
 	if (fd >= 0) {
 	    int got = 0;
@@ -259,7 +260,7 @@
 	      if (--ret == 0) { ev=0; continue; }
 	    */
 	}
-	ev = ev->ioring.next->self;
+	ev = next_ev;
     }
 }
 #endif /*HAS_SELECT*/

-- 
"May the best description of competition prevail."
          via, but not speaking for Deutsche Bank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.