View Issue Details

IDProjectCategoryView StatusLast Update
0036895FPCRTLpublic2020-05-01 17:35
ReporterBi0T1N Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0036895: epoll_wait call is wrong if generic_linux_syscalls is defined
DescriptionJust noticed that the call for epoll_wait which uses epoll_pwait is wrong:
  epoll_wait := do_syscall(syscall_nr_epoll_pwait, tsysparam(epfd),
    tsysparam(events), tsysparam(maxevents), tsysparam(timeout),0,sizeof(TSigSet));


The definition is
int epoll_pwait(int epfd, struct epoll_event *events,
               int maxevents, int timeout,
               const sigset_t *sigmask);

https://linux.die.net/man/2/epoll_pwait

so it should be changed to
  epoll_wait := do_syscall(syscall_nr_epoll_pwait, tsysparam(epfd),
    tsysparam(events), tsysparam(maxevents), tsysparam(timeout), 0);
TagsNo tags attached.
Fixed in Revision45208
FPCOldBugId
FPCTarget-
Attached Files

Relationships

related to 0035914 resolvedMichael Van Canneyt Add support to epoll_create1() and epoll_pwait() 

Activities

Sven Barth

2020-04-10 10:58

manager   ~0122057

No, the *syscall* does have a further parameter which can also be seen in the implementation of epoll_pwait in the C library: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/epoll_pwait.c;h=66f04482c76ee90394ed3de36a327109a8dfcd48;hb=HEAD

In fact it's the newly added syscall variant of epoll_pwait which has a bug, because it does not pass that size parameter.

Bi0T1N

2020-04-10 12:24

reporter   ~0122060

Last edited: 2020-04-10 12:33

View 2 revisions

Okay then the syscall from https://bugs.freepascal.org/view.php?id=35914 should be changed to the one with the extra parameter instead of doing the changes above.

Sven Barth

2020-05-01 15:13

manager   ~0122580

I've now fixed the newly added epoll_pwait() call.

Please test and close if okay.

Issue History

Date Modified Username Field Change
2020-04-10 00:41 Bi0T1N New Issue
2020-04-10 10:58 Sven Barth Note Added: 0122057
2020-04-10 12:24 Bi0T1N Note Added: 0122060
2020-04-10 12:33 Bi0T1N Note Edited: 0122060 View Revisions
2020-05-01 14:57 Sven Barth Relationship added related to 0035914
2020-05-01 14:57 Sven Barth Assigned To => Sven Barth
2020-05-01 14:57 Sven Barth Status new => assigned
2020-05-01 15:13 Sven Barth Status assigned => resolved
2020-05-01 15:13 Sven Barth Resolution open => fixed
2020-05-01 15:13 Sven Barth Fixed in Version => 3.3.1
2020-05-01 15:13 Sven Barth Fixed in Revision => 45208
2020-05-01 15:13 Sven Barth FPCTarget => -
2020-05-01 15:13 Sven Barth Note Added: 0122580
2020-05-01 17:35 Bi0T1N Status resolved => closed