lsb

sizeof(struct epoll_event) wrong on amd64

Bug #1327369 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lsb
Fix Committed
Medium
Unassigned
Mandriva
Fix Released
High

Bug Description

The size of 'struct epoll_event' is wrong on AMD64 (16 bytes vs 12 bytes),
which causes some programs to crash (for example nginx).

The definition of 'struct epoll_event' in the spec (and in the actual LSB
headers) is missing a packed attribute:
http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-AMD64/LSB-Core-AMD64/libc-ddefs.html
http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/libc-ddefs.html

In the kernel 'struct epoll_event' is expected to be packed on AMD64:
http://lxr.linux.no/#linux+v3.11/include/uapi/linux/eventpoll.h

[ I filed the bug against Core-Arch, but maybe its easier to just fix this in
the generic header with an ifdef like in the kernel header ]

I've checked the latest headers according to instructions from another
bugreport, and the bug is still there:
bzr branch http://bzr.linuxfoundation.org/lsb/devel/build_env/

$ cat >epolltest.c <<EOF
#include <sys/epoll.h>
#include <stdio.h>
int main()
{
    printf("sizeof(struct epoll_event)=%d\n", sizeof(struct epoll_event));
    return 0;
}
EOF

$ /opt/lsb/bin/lsbcc epolltest.c && ./a.out
sizeof(struct epoll_event)=16

$ gcc epolltest.c && ./a.out
sizeof(struct epoll_event)=12
[reply] [-] Comment 1

Tags: sdk uplift
Changed in mandriva:
importance: Unknown → High
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.