Project

General

Profile

Actions

Bug #8619

closed

epoll should exclude normal files/directories

Added by Alexander Pyhalov about 4 years ago. Updated about 2 months ago.

Status:
Duplicate
Priority:
Normal
Category:
kernel
Start date:
2017-09-07
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

The following program fails on linux with "epoll_ctl: Operation not permitted", but succeeds on fresh OI (illumos-gate from August 7) when /tmp/1 file exists:

#include <stdio.h>
#include <sys/types.h>
#include <sys/epoll.h>
#include <stdlib.h>
#include <fcntl.h>

int
main (int argc, char *argv[])
{
  int sfd, s;
  int efd;
  struct epoll_event event;
  struct epoll_event *events;

  sfd = open("/tmp/1",O_RDONLY);
  if (sfd == -1) {
      perror ("open");
      abort ();
  }

  efd = epoll_create1 (0);
  if (efd == -1)
    {
      perror ("epoll_create");
      abort ();
    }

  event.data.fd = sfd;
  event.events = EPOLLIN | EPOLLET;
  s = epoll_ctl (efd, EPOLL_CTL_ADD, sfd, &event);
  if (s == -1)
    {
      perror ("epoll_ctl");
      abort ();
    }
  return 0;
}

On Linux it fails with epoll_ctl: Operation not permitted.
This leads to test_selectors.py python 3.4.7 test failure.

Actions #1

Updated by Alexander Pyhalov about 4 years ago

  • Subject changed from epoll_ctl should fail on file fd to epoll_ctl EPOLL_CTL_ADD should fail on file fd
Actions #2

Updated by Patrick Mooney about 4 years ago

  • Category set to kernel
  • Assignee set to Patrick Mooney
Actions #3

Updated by Patrick Mooney about 4 years ago

  • Subject changed from epoll_ctl EPOLL_CTL_ADD should fail on file fd to epoll should exclude normal files/directories
  • Status changed from New to In Progress
Actions #4

Updated by Patrick Mooney about 4 years ago

This is replicated by the downstream bug OS-5941.

It is recommended that the fix for OS-6116 be merged simultaneously. I'll open a corresponding illumos ticket for that issue as well.

Actions #5

Updated by Patrick Mooney about 2 months ago

  • Tags deleted (needs-triage)

I believe this was upstreamed in the same wad as #12908.

Actions #6

Updated by Alexander Pyhalov about 2 months ago

I confirm that program in ticket fails with

epoll_ctl: Not owner
Abort (core dumped)

Python 3.5's test_selectors.py passes.

Actions #7

Updated by Patrick Mooney about 2 months ago

Alexander Pyhalov wrote in #note-6:

I confirm that program in ticket fails with
[...]

Python 3.5's test_selectors.py passes.

Please close it out as Complete then? I cannot for some reason.

Actions #8

Updated by Alexander Pyhalov about 2 months ago

Patrick Mooney wrote in #note-7:

Please close it out as Complete then? I cannot for some reason.

I also can't

Actions #9

Updated by Yuri Pankov about 2 months ago

  • Status changed from In Progress to Duplicate

fixed in #12908

Actions

Also available in: Atom PDF