Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
mesa
mesa
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,379
    • Issues 2,379
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 663
    • Merge Requests 663
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mesa
  • mesamesa
  • Merge Requests
  • !5332

Closed
Opened Jun 04, 2020 by WGH@WGH
  • Report abuse
Report abuse

i965: Replace dup with fcntl(..., F_DUPFD_CLOEXEC, 3)

  • Overview 8
  • Commits 1
  • Pipelines 2
  • Changes 2

This fixes Mesa leaking open file descriptors to child processes. This is not a theoretical problem, as a terminal emulator I use actually leaks them. Here I launched it several times:

$ ls -l /proc/self/fd
total 0
lrwx------ 1 wgh wgh 64 Jun  4 16:06 0 -> /dev/pts/10
lrwx------ 1 wgh wgh 64 Jun  4 16:06 1 -> /dev/pts/10
lrwx------ 1 wgh wgh 64 Jun  4 16:06 10 -> /dev/dri/card0
lrwx------ 1 wgh wgh 64 Jun  4 16:06 2 -> /dev/pts/10
lr-x------ 1 wgh wgh 64 Jun  4 16:06 3 -> /proc/1129780/fd
lrwx------ 1 wgh wgh 64 Jun  4 16:06 8 -> /dev/dri/card0
lrwx------ 1 wgh wgh 64 Jun  4 16:06 9 -> /dev/dri/card0

This commit fixes it for me.

Mesa code has quite a few dup() calls in other places, but I decided to refrain from modifying code that I can't test, especially given that some of the code appears to have Windows support.

This has been fixed before in other places, see commits 42ed8a6c, ac6064f9, aaac913e.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: mesa/mesa!5332
Source branch: fix-i965-dup