Summary:ASTERISK-12583: [patch] Asterisk 1.4 (all versions) does not work on Mac OS X -- poll.c
Reporter:John Covert (jcovert)Labels:
Date Opened:2008-08-15 01:53:35Date Closed:2008-09-03 08:34:56
Versions:Frequency of
Environment:Attachments:( 0) bt.txt
( 1) patch.tmp
Description:This is a continuation of bug 10342.

poll.c:283: failed assertion `pArray != (struct pollfd *) NULL'

Possible fix provided below. --removed


Changed the assertion in poll.c to a SIGQUIT in order to get a core dump:
if (pArray == (struct pollfd *) NULL) kill(getpid(),SIGQUIT);

ulimit -c unlimited

Dump showed that it was called from

#2  0x0003e268 in ast_waitfor_nandfds (c=0xf04fdec8, n=0, fds=0x0, nfds=0, exception=0x0, outfd=0x0, ms=0xf04fde84) at channel.c:1713

So I did the following to both calls to poll in channel.c:


And we're running.  For now.


Comments:By: snuffy (snuffy) 2008-08-15 02:18:20

Please submit any code changes via the upload tool.
We need have your disclaimer on file to see/accept your possible fix

By: John Covert (jcovert) 2008-08-15 02:28:10

Sorry.  It was a two line fix.  Disclaimer has now been signed.  You, of course, had no way of knowing that I'm under a contract with Digium, and since I'm teaching the Bootcamp this week, anything I do this week belongs to Digium anyway.

By: John Covert (jcovert) 2008-08-15 02:34:43

Also, I'm not sure that what I did is really a permanent fix, but it has kept Asterisk 1.4 up and running longer than I've ever had it up before.

However, I note that sometimes the CLI prompt does not display after verbose output has appeared.  Sometimes, not always.  That may be a side effect of the way I made sure we didn't hit the assertion check.

By: John Covert (jcovert) 2008-09-02 23:17:17

Should this really be changed from major to minor severity?

This bug completely prevents Asterisk from working on Mac OS X.  I teach the Digium bootcamp, in which we claim that Asterisk works on Mac OS X.  If that's decommitted, Jared and I should remove the slides from the class material.

Also, the fact that the call to poll is made with a zero is a sign of something else "not good" happening as well.  It may not blow up on Linux, but the zero call to poll shouldn't be happening.

By: Russell Bryant (russell) 2008-09-03 08:19:43

Should be fixed in revs ...

1.4 - 140816
trunk - 140817
1.6.0 - 140818
1.6.1 - 140819

By: Digium Subversion (svnbot) 2008-09-03 08:34:55

Repository: asterisk
Revision: 140816

U   branches/1.4/main/poll.c

r140816 | russell | 2008-09-03 08:34:53 -0500 (Wed, 03 Sep 2008) | 4 lines

Don't freak out if the poll emulation receives NULL for the pollfds array
(closes issue ASTERISK-12583)
Reported by: jcovert