epoll_wait returning EFAULT on Linux 3.2.78

From: Greg Stark <stark(at)mit(dot)edu>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: epoll_wait returning EFAULT on Linux 3.2.78
Date: 2016-06-02 14:31:15
Message-ID: CAM-w4HM9RvUnue5GvmmUHJbfZ-EHbJNSAiacinAkOqEaY2VrFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I was just trying out a new (well, new to me...) machine here. It
happens that the version of Linux installed is 3.2.78. Apparently the
current version on this branch is 3.2.80 released a couple months ago
and I don't see any relevant changes in .79 or .80 so I think this is
actually likely to be the behaviour in a "supported" version of Linux.

What I'm seeing is that every call to epoll_wait() raises EFAULT. I
don't see anything wrong with the arguments to epoll_wait so unless
there was some earlier bogus argument to epoll_ctl or something this
looks like some kind of kernel or glibc problem and it looks like
we'll to check for EFAULT and fall back to poll (a configure test
wouldn't help since this is run-time behaviour).

Breakpoint 1, WaitEventSetWaitBlock (set=0x9c0a88, cur_timeout=-1,
occurred_events=0xff88f4f8, nevents=1) at latch.c:975
975 int returned_events = 0;

(gdb) n
981 rc = epoll_wait(set->epoll_fd, set->epoll_ret_events,

(gdb) p *set
$9 = {nevents = 3, nevents_space = 3, events = 0x9c0aa4, latch = 0xf75a9808,
latch_pos = 1, epoll_fd = 3, epoll_ret_events = 0x9c0ad4}

(gdb) p *set->epoll_ret_events
$10 = {events = 0, data = {ptr = 0x0, fd = 0, u32 = 0, u64 = 0}}

(gdb) p nevents
$11 = 1

(gdb) p cur_timeout
$12 = -1

(gdb) n
Breakpoint 3, WaitEventSetWaitBlock (set=0x9c0a88, cur_timeout=-1,
occurred_events=0xff88f4f8, nevents=1) at latch.c:985
985 if (rc < 0)

(gdb) p rc
$13 = -1

(gdb) p errno
$14 = 14

--
greg

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2016-06-02 14:42:28 Re: array of domain types
Previous Message Tom Lane 2016-06-02 14:22:14 Re: array of domain types