Re: epoll_wait returning EFAULT on Linux 3.2.78

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: epoll_wait returning EFAULT on Linux 3.2.78
Дата
Msg-id CAM-w4HPzKDTCCbCe5ufO4AkSwqO5JWmL52KdMCKG3dzT73U_4A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: epoll_wait returning EFAULT on Linux 3.2.78  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: epoll_wait returning EFAULT on Linux 3.2.78  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: epoll_wait returning EFAULT on Linux 3.2.78  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
So FYI, it does look like Postgres built in 32-bit mode, at least
pointers are 32 bits. But I think maxalign might still be enough due
to doubles being 64 bits.

checking whether long int is 64 bits... no
checking whether long long int is 64 bits... yes
checking snprintf length modifier for long long int... ll
checking whether snprintf supports the %z modifier... yes
checking size of void *... 4
checking size of size_t... 4
checking size of long... 4
checking whether to build with float4 passed by value... yes
checking whether to build with float8 passed by value... no
checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 4
checking alignment of long long int... 8
checking alignment of double... 8
checking for int8... no
checking for uint8... no
checking for int64... no
checking for uint64... no
checking for __int128... no

I wrote a test program based on latch.c and tested various alignments.
It does indeed get EFAULT for anything other than 8-byte alignment
(the second argument is the number of bytes to offset the events
structure):

$ echo | ./a.out 1 0
epoll_wait(epfd=5, events=0x22018, maxevents=1, timeout=-1)
success
$ echo | ./a.out 1 1
epoll_wait(epfd=5, events=0x22019, maxevents=1, timeout=-1)
epoll_wait: Bad address
$ echo | ./a.out 1 2
epoll_wait(epfd=5, events=0x2201a, maxevents=1, timeout=-1)
epoll_wait: Bad address
$ echo | ./a.out 1 4
epoll_wait(epfd=5, events=0x2201c, maxevents=1, timeout=-1)
epoll_wait: Bad address

The same program gets success for any all offsets on x86.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andreas 'ads' Scherbaum
Дата:
Сообщение: TESTING in src/bin/pg_upgrade has incorrect documentation
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: pg9.6 segfault using simple query (related to use fk for join estimates)