Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 853
    • Issues 853
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2988

Backport !2947 “gspawn: avoid race due to retry with EINTR on close()” to glib-2-74

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Philip Withnall requested to merge pwithnall/glib:backport-2947-gspawn-eintr-glib-2-74 into glib-2-74 Oct 20, 2022
  • Overview 2
  • Commits 3
  • Pipelines 2
  • Changes 2

Retry on EINTR is wrong on many OS, including Linux. See the comment in g_close() why that is.

As we cannot use g_close() after fork, we had safe_close(). This had the wrong retry loop on EINTR. Drop that.

This was especially problematic since commit 6f462942 ('gspawn: Don’t use g_close() in async-signal-safe context'). Before, safe_close() was only called after fork, where there is only one thread and there is no concern about a race.

This patch only exists for easier backporting of the bugfix. The code will be reworked further next.

Fixes: 6f462942 ('gspawn: Don’t use g_close() in async-signal-safe context')


Backport of !2947 (merged) to glib-2-74. I’ve modified the commit which changes g_close() to drop the documentation changes, since we don’t want to add additional API guarantees in a stable release series. The behaviour changes to make it async-signal-safe have been preserved, but the changes to add the g_critical() warnings have been dropped, as they could end up being disruptive to clients in a stable release cycle.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: backport-2947-gspawn-eintr-glib-2-74