[Home]

Summary:ASTERISK-04029: [patch] pbx_wilcalu unhandled condition on poll()
Reporter:Luigi Rizzo (rizzo)Labels:
Date Opened:2005-05-02 06:17:55Date Closed:2008-01-15 15:33:21.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 4127.patch.txt
Description:pbx_wilcalu on FreeBSD at least (but reading the poll(2) manpage the bug should exist in linux as well) sometimes has the tendency to consume 100% CPU because of unhandled conditions on return from the poll() system call. In fact, poll() will return on some error conditions even if not present in the events mask, and the code in wilcalu.c does not handle these events causing a busy loop around the poll(). The patch below is just a hack but at least it puts the module to sleep for a while around these errors.

****** ADDITIONAL INFORMATION ******

--- pbx/pbx_wilcalu.c.orig      Tue Apr 26 10:00:28 2005
+++ pbx/pbx_wilcalu.c   Tue Apr 26 10:03:42 2005
@@ -82,6 +82,11 @@
               fds[0].events = POLLIN;
               poll(fds, 1, -1);
               bytes=read(fd,buf,256);
+               if (bytes <= 0) {
+                       /* XXX error on device, sleep a bit before retrying */
+                       sleep(1);
+                       continue;
+               }
               buf[(int)bytes]=0;

               if(bytes>0){
Comments:By: Clod Patry (junky) 2005-05-02 06:27:53

Please attach patch (as a .txt) and do that each time you want to submit a patch.

Thanks.

By: Brian West (bkw918) 2005-05-04 17:14:07

pbx_willcalu.c is not used anymore.  I guess its time to remove it from the tree now?

/b

By: Kevin P. Fleming (kpfleming) 2005-05-04 20:56:54

Yes, that is correct, it's time for it to go. I've removed it from CVS HEAD, along with the bits from the Makefile related to it. Nice catch :-)

By: Digium Subversion (svnbot) 2008-01-15 15:33:21.000-0600

Repository: asterisk
Revision: 5581

U   trunk/pbx/Makefile
D   trunk/pbx/pbx_wilcalu.c

------------------------------------------------------------------------
r5581 | kpfleming | 2008-01-15 15:33:21 -0600 (Tue, 15 Jan 2008) | 2 lines

remove obsolete module (still available in CVS history if needed) (inspired by bug ASTERISK-4029)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5581