Summary: | poll() causes long pauses on OSX | ||
---|---|---|---|
Product: | dbus | Reporter: | Benjamin Reed <ranger> |
Component: | core | Assignee: | Havoc Pennington <hp> |
Status: | RESOLVED FIXED | QA Contact: | John (J5) Palmieri <johnp> |
Severity: | trivial | ||
Priority: | medium | CC: | adam, lovelace, walters |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Mac OS X (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
don't test for poll on platforms on which it is broken
update to do a real poll test don't use poll on Mac OS X, it can't be used with devices, only files |
Description
Benjamin Reed
2008-02-12 13:09:59 UTC
Do you have any references for this? Not that I don't believe it, but it would be useful to at least include a link to some background information in the patch. I'll ask till if he has any debugger output. I was experiencing occasional busy spinning of the dbus-daemon on OSX Leopard (but this has also been reported by others on Tiger) and tracked it down to the use of poll() in the main loop. Since poll() is known (well, public consensus outside of Apple claims it) to have quirky, bordering on broken semantics, I tried un-defining HAVE_POLL, to make it fall back to select, which is what many other projects do on OSX as well. This includes many things in Fink/Darwinports (http://www.finkproject.org/doc/porting/porting.en.html, section 6.3). Examples I can easily find with google are curl (http://curl.haxx.se/mail/lib-2007-02/0098.html), lighthttpd, lftp (http://www.nabble.com/Re:--13259:-lftp-crashes-on-Mac-OS-X-10.5-Leopard:-99--CPU-usage-due-to-bad-poll()-td15309938.html) but there are many more. I did not bother to track down the particular failure details, as "oh, it uses poll()" was enough of an indication that that would be the problem. I've been running with HAVE_POLL undefined for a couple of days now, no more CPU hogging loops. Created attachment 14416 [details] [review] update to do a real poll test Mac OS X's poll does not let you poll devices, only "regular" filehandles; this test is merged from Glib's test for a broken poll. I'll have to test to make sure it doesn't deselect poll on other platforms first but looks good for inclusion in the point release next week. Is there any way you can resubmit the patch against master so I don't have to apply them both? Created attachment 14653 [details] [review] don't use poll on Mac OS X, it can't be used with devices, only files Got to learn about squash and git rebase -i ;) I'm a git n00b, so if this doesn't work, please let me know. Anyways, here's the rebased patch all-in-one for merging against master. pushed to git Next time you submit can you add a ChangeLog entry. Both the git commit message and ChangeLog should be the same with minor formatting changes. Look at ChangeLog and git log to see examples of the format. Thanks. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.