macOS Sierra warning: kq_init: detected broken kqueue; not using.: Undefined error: 0 |
||||||||
Issue descriptionThere are two warnings that require further investigation, upon launching Chromium on 10.12. [0707/201006:WARNING:memory_mac.mm(531)] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650 [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
,
Jul 8 2016
I’m at home and don’t have a whole Chromium build that I can mess with, but I would have been very surprised if this old 10.4 bug that libevent was working around suddenly reappeared in 10.12. Here’s the relevant bit of libevent: https://chromium.googlesource.com/chromium/src/+/c7ebe6daa79da2e351345065020cc7f216126f15/base/third_party/libevent/kqueue.c#143 Right off the bat, line 156 looks suspect. That should test struct kevent::flags & EV_ERROR, not struct kevent::flags == EV_ERROR. I wrote a small test that followed this approach and told me what we got back from kevent. rv = 1 struct kevent::ident = -1 struct kevent::flags = 0x4001 struct kevent::data = 9 From <sys/event.h>: #define EV_ADD 0x0001 /* add event to kq (implies enable) */ #define EV_ERROR 0x4000 /* error, data contains errno */ and <sys/errno.h>: #define EBADF 9 /* Bad file descriptor */ So it looks like in 10.12, for errors, |flags| coming out of eventlist contains the original value of |flags| on the way into kevent() as passed in changelist. EV_ERROR is ORed into this value. The documentation for kevent() supports this: RETURN VALUES […] The kevent(), kevent64() and kevent_qos() system calls return the number of events placed in the eventlist, up to the value given by nevents. If an error occurs while processing an element of the changelist and there is enough room in the eventlist, then the event will be placed in the eventlist with EV_ERROR set in flags and the system error in data. […] Evidently, previous OS versions didn’t do this, they just set EV_ERROR and nothing else in the flags field. Fixing the test in libevent’s kqueue.c should reenable kqueues in libevent on 10.12. Hopefully it will also fix bug 620259 . I’ll take a look at this tomorrow when I’m in front of a Chromium build, unless someone beats me to it.
,
Jul 8 2016
mark: Making your suggested change removes the warning, and also fixes the hang on shutdown bug.
,
Jul 8 2016
https://codereview.chromium.org/2134603002/
,
Jul 8 2016
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 8 2016
,
Jul 8 2016
Reported upstream at https://github.com/libevent/libevent/issues/376.
,
Jul 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3b07cd446f6bf33618ebae11ca68273b7a0de2f8 commit 3b07cd446f6bf33618ebae11ca68273b7a0de2f8 Author: erikchen <erikchen@chromium.org> Date: Fri Jul 08 17:06:18 2016 Fix a logic bug in kqueue.c. Remove an unnecessary workaround for OS X 10.4 from kqueue.c. It was causing problems on macOS Sierra. All credit for this CL goes to mark@chromium.org. BUG= 626534 , 620259 Review-Url: https://codereview.chromium.org/2134603002 Cr-Commit-Position: refs/heads/master@{#404421} [modify] https://crrev.com/3b07cd446f6bf33618ebae11ca68273b7a0de2f8/base/third_party/libevent/README.chromium [modify] https://crrev.com/3b07cd446f6bf33618ebae11ca68273b7a0de2f8/base/third_party/libevent/kqueue.c
,
Jul 8 2016
,
Jul 8 2016
,
Jul 9 2016
Your change meets the bar and is auto-approved for M53 (branch: 2785)
,
Jul 11 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/45a5e0217612dfb48e8c3fd5dcd7e186d8288c52 commit 45a5e0217612dfb48e8c3fd5dcd7e186d8288c52 Author: erikchen <erikchen@chromium.org> Date: Mon Jul 11 17:21:58 2016 Fix a logic bug in kqueue.c. Remove an unnecessary workaround for OS X 10.4 from kqueue.c. It was causing problems on macOS Sierra. All credit for this CL goes to mark@chromium.org. BUG= 626534 , 620259 Review-Url: https://codereview.chromium.org/2134603002 Cr-Commit-Position: refs/heads/master@{#404421} (cherry picked from commit 3b07cd446f6bf33618ebae11ca68273b7a0de2f8) Review URL: https://codereview.chromium.org/2140723002 . Cr-Commit-Position: refs/branch-heads/2785@{#83} Cr-Branched-From: 68623971be0cfc492a2cb0427d7f478e7b214c24-refs/heads/master@{#403382} [modify] https://crrev.com/45a5e0217612dfb48e8c3fd5dcd7e186d8288c52/base/third_party/libevent/README.chromium [modify] https://crrev.com/45a5e0217612dfb48e8c3fd5dcd7e186d8288c52/base/third_party/libevent/kqueue.c
,
Jul 12 2016
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by mark@chromium.org
, Jul 8 2016