Skip to content

nixos/nginx: don't disable IPC - #360008

Merged
fpletz merged 1 commit into
NixOS:masterfrom
SuperSandro2000:nginx-pcre-syscall
Dec 9, 2024
Merged

fpletz merged 1 commit into
NixOS:masterfrom
SuperSandro2000:nginx-pcre-syscall

Conversation

@SuperSandro2000

@SuperSandro2000 SuperSandro2000 commented Nov 28, 2024 •

Copy link
Copy Markdown
Member

This also disables the memfd_create syscall which is required for certain regex's when using pcre2.

see #355989 (comment)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This also disables the memfd_create syscall which is required for
certain regex's when using pcre2.

see NixOS#355989 (comment)
@github-actions github-actions Bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 28, 2024
@SuperSandro2000 SuperSandro2000 mentioned this pull request Nov 28, 2024
1 of 13 tasks
@nix-owners
nix-owners Bot requested a review from RaitoBezarius November 28, 2024 23:43

@RossComputerGuy RossComputerGuy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this an option rather than the built in behavior?

@Izorkin

Izorkin commented Nov 29, 2024

Copy link
Copy Markdown
Contributor

I can't reproduce this error?

@SuperSandro2000

Copy link
Copy Markdown
Member Author

Why not make this an option rather than the built in behavior?

Because the debugging experience is very poor and without the prior knowledge of debugging a similar issue 2 years ago in gitea where pcre2 was used in git grep I wouldn't have known what to do and just reverted the pcre change.

So technically any module using nginx can trigger this and then nginx will just crash repeatably on start up. We could write an option which states: if nginx is crashing with this dmesg line and this syscall number you need to flip this but that would be user experience from hell. Also any future change in nginx regex handling or in pcre2 can make this required. I think the jit function is causing this and whenever it is triggered, things will just crash.

I can't reproduce this error?

You need to have a location which presumably uses complex regexs.

@Izorkin

Izorkin commented Nov 29, 2024

Copy link
Copy Markdown
Contributor

You need to have a location which presumably uses complex regexs.

Didn't find a suitable variant.

@ofborg ofborg Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 29, 2024
fpletz added a commit to fpletz/nixpkgs that referenced this pull request Nov 29, 2024
This reverts commit 861b05c.

See NixOS#355989 & NixOS#360008. This needs more testing and polish.
@SuperSandro2000

Copy link
Copy Markdown
Member Author

You need to have a location which presumably uses complex regexs.

Didn't find a suitable variant.

I currently lack the time to further A/B test this against all my services to nail it down to a specific regex.

@SuperSandro2000

Copy link
Copy Markdown
Member Author

Bump

fyi @emilazy

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 1, 2024
@D4ndellion

D4ndellion commented Dec 8, 2024 •

Copy link
Copy Markdown
Member

We also had this issue on one of our webservers when upgrading to 24.11. This is a hard to debug breakage, so we should merge and backport this ASAP.

@fpletz
fpletz merged commit b356faf into NixOS:master Dec 9, 2024
@nixpkgs-ci

nixpkgs-ci Bot commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-24.11:

@SuperSandro2000
SuperSandro2000 deleted the nginx-pcre-syscall branch December 9, 2024 11:12
@de11n

de11n commented Dec 12, 2024

Copy link
Copy Markdown

Do we have a test that will catch this in the future?

@SuperSandro2000

Copy link
Copy Markdown
Member Author

No, because isolating which exact regex out of my config caused the issue was out of my available time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants