[Home]

Summary:ASTERISK-07166: exiting on OS X produces poll errors
Reporter:Terry Wilson (twilson)Labels:
Date Opened:2006-06-14 10:50:11Date Closed:2006-07-03 00:15:22
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:This is such a minor annoyance that it could be probably be ignored.  Ok, with that said, doing a "stop now" (on OS X, haven't managed to duplicate it under Linux) gives me about a screen full of:

Jun 14 10:42:41 WARNING[25751]: asterisk.c:845 listener: poll returned error: Bad file descriptor

Like I said, since you are exiting anyway, this isn't a huge ordeal.  But, what the hell, the attached patch chekcs to make sure the file descriptor is there before passing it to poll.
Comments:By: Russell Bryant (russell) 2006-06-14 13:42:54

fds is an array of size one declared on the stack in that function.  How do you think that would ever be NULL?

By: Russell Bryant (russell) 2006-06-14 13:44:06

Also, if fds was NULL, then the code would cause a seg fault just above your changes.

By: Terry Wilson (twilson) 2006-06-14 14:41:38

I thought it was weird too, but it looked like it fixed the issue.  Then I looked again and realized that I got my windows mixed up and tested the non-broken Fedora installation.  Removing the patch and will actually try to fix it in a way that looks like it at least makes sense.  :-]

By: Russell Bryant (russell) 2006-06-14 14:55:45

Ok, that sounds good.

I see these same errors on my powerbook and they are kind of annoying.  I have just always tried to ignore them.  However, I suppose we should actually fix it at some point.  :)

By: Terry Wilson (twilson) 2006-06-14 18:52:35

removing the [patch] from the title since I don't have one ready yet.

By: twisted (twisted) 2006-06-20 15:14:15

Yeah, unfortunately this is because darwin decided to change the polling types several releases ago, therefore we handling polling differently under osx.  If we use the same polling, the console does not work in osx, which is far worse than bad fds on shutdown.

By: Russell Bryant (russell) 2006-07-03 00:15:21

I figured out the problem and fixed it in both the 1.2 branch and the trunk.  You should no longer see any of these warnings when stopping asterisk.  If you do, please let me know.