Re: epoll_wait returning EFAULT on Linux 3.2.78 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: epoll_wait returning EFAULT on Linux 3.2.78
Date
Msg-id 10468.1464879020@sss.pgh.pa.us
Whole thread Raw
In response to epoll_wait returning EFAULT on Linux 3.2.78  (Greg Stark <stark@mit.edu>)
Responses Re: epoll_wait returning EFAULT on Linux 3.2.78  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> What I'm seeing is that every call to epoll_wait() raises EFAULT.

The man page for epoll_wait suggests that that implies a bad pointer
value for the events array.  You're showingepoll_ret_events = 0x9c0ad4
which is not obviously bad, but it's also only 4-byte aligned.
I notice that CreateWaitEventSet() is being remarkably cavalier
about alignment requirements; maybe it ought to make some effort
to ensure that epoll_ret_events is maxaligned.  Personally I'd
make all the subsidiary arrays maxaligned, just to be sure.
The existing coding is taking it on faith that the alignment
requirements of each later component of the WaitEventSet are no
worse than those of any earlier component; which even if true today
is an assumption that will bite us on the ass someday.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: epoll_wait returning EFAULT on Linux 3.2.78
Next
From: Tom Lane
Date:
Subject: Re: Parallel pg_dump's error reporting doesn't work worth squat