Hi all,

I have been testing my libev application under RHEL5 instead of MacOSX, and I have discovered an infinite loop that develops within libev that causes the app to hang (and spin).

During the spin, the program flow looks like below.

The spin is happening because w_, w and w_->next all have the same value:

(gdb) print w_
$1 = (WL) 0x1f12d710
(gdb) print w
$2 = (ev_stat *) 0x1f12d710
(gdb) print w_->next
$3 = (struct ev_watcher_list *) 0x1f12d710

Does anyone have any ideas on how this might have happened? I am using libev v3.49, and the Linux kernel version is kernel-2.6.18-53.1.13.el5.

2514          for (w_ = fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head; w_; )
(gdb)
2516              ev_stat *w = (ev_stat *)w_;
(gdb)
2517 w_ = w_->next; /* lets us remove this watcher and all before it */
(gdb)
2519              if (w->wd == wd || wd == -1)
(gdb)
2514          for (w_ = fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head; w_; )
(gdb)
2516              ev_stat *w = (ev_stat *)w_;
(gdb)
2517 w_ = w_->next; /* lets us remove this watcher and all before it */
(gdb)
2519              if (w->wd == wd || wd == -1)
(gdb)
2514          for (w_ = fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head; w_; )
(gdb)
2516              ev_stat *w = (ev_stat *)w_;
(gdb)
2517 w_ = w_->next; /* lets us remove this watcher and all before it */
(gdb)
2519              if (w->wd == wd || wd == -1)
(gdb)
2514          for (w_ = fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head; w_; )
(gdb)
2516              ev_stat *w = (ev_stat *)w_;
(gdb)
2517 w_ = w_->next; /* lets us remove this watcher and all before it */
(gdb)
2519              if (w->wd == wd || wd == -1)
(gdb)

Regards,
Graham
--

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to