Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase stack size on macOS as well as Linux #9860

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

9999years
Copy link
Contributor

@9999years 9999years commented Jan 26, 2024

Motivation

While preparing #9834, I've run into some stack overflow errors that aren't caught by the current recursion depth counter. This patch remedies that error (at least with Nix's current stack usage), and also increases consistency between Linux and macOS.

Context

The code works fine on macOS, but the default stack size we attempt to set is larger than what my system will allow (Nix attempts to set the stack size to 67108864, but the maximum allowed is 67092480), so I've instead used the requested stack size or the maximum allowed, whichever is smaller.

I've also added an error message if setting the stack size fails. It looks like this:

Failed to increase stack size from 8372224 to 67108864 (maximum allowed stack size: 67092480): Invalid argument

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

The code works fine on macOS, but the default stack size we attempt to
set is larger than what my system will allow (Nix attempts to set the
stack size to 67108864, but the maximum allowed is 67092480), so I've
instead used the requested stack size or the maximum allowed, whichever
is smaller.

I've also added an error message if setting the stack size fails. It
looks like this:

> Failed to increase stack size from 8372224 to 67108864 (maximum
> allowed stack size: 67092480): Invalid argument
@Ericson2314
Copy link
Member

This makes sense to me. There's only one way to learn whether this causes a problem on macOS, and that's to try it.

these two commits do not mention why Linux-only. (Checking is my Chesterton's Fence duty.)

@Ericson2314 Ericson2314 merged commit efb91d5 into NixOS:master Jan 26, 2024
10 checks passed
@9999years 9999years deleted the set-stack-darwin branch January 26, 2024 19:07
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
Increase stack size on macOS as well as Linux

(cherry picked from commit efb91d5,
4a2444b)
Change-Id: Ieb72283c61bb9e360683f531d6635697b293c313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants