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

ulimit and stack size #633

Closed
askhamwhat opened this issue Jul 6, 2016 · 10 comments
Closed

ulimit and stack size #633

askhamwhat opened this issue Jul 6, 2016 · 10 comments

Comments

@askhamwhat
Copy link

When I initiate a bash session, the output of

ulimit -s

is 8192 (which is in kb). This limit cannot be increased (Ideally I'd like to be able to set it as unlimited). Any suggestions?

@sunilmut
Copy link
Member

sunilmut commented Jul 8, 2016

@askhamwhat - The stack limit on WSL is currently static. Please provide this feedback on our user voice page as well to help us prioritize this going forward.

@AndreiLux
Copy link

I'm currently this limitation in a hard way - there seems to be no way to run WRF on WSL with the stack limit currently set this small. I'm setting the stack to higher values at compile time but obviously it affect the behaviour of the program, still segfaulting seconds into a run.

@eszwabow
Copy link

eszwabow commented May 1, 2019

I found a workaround to this but it requires access to root. If you can login as root (su -) then u can add yourself to the sudo group if not able to yet (usermod -aG sudo $USER_NAME) then update the stack limit as root (ulimit -s unlimited) and login back into your user (su - $USER_NAME) then you can set the stack limit with: ulimit -s unlimited.

Verify it works with ulimit -a.

I've been using this so that I can run parallel CFD simulations locally on my machine. Good luck!

@Trass3r
Copy link

Trass3r commented May 31, 2019

sudo bash is an easier way to run the ulimit command. ulimit -a does show the correct value just set.
But the test program still crashes with stack overflow.

@Trass3r
Copy link

Trass3r commented Jun 1, 2019

@askhamwhat - The stack limit on WSL is currently static. Please provide this feedback on our user voice page as well to help us prioritize this going forward.

For the record: https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/15125013-allow-changes-to-stack-size-via-the-ulimit-command

@cdzhan
Copy link

cdzhan commented Oct 3, 2019

@askhamwhat - The stack limit on WSL is currently static. Please provide this feedback on our user voice page as well to help us prioritize this going forward.

For the record: https://wpdev.uservoice.com/forums/266908-command-prompt-console-windows-subsystem-for-l/suggestions/15125013-allow-changes-to-stack-size-via-the-ulimit-command

@sunilmut @benhillis is the stack limit on WSL still static?Can I set ulimit by adding myself to the sudo group?

@p-maybank
Copy link

@benhillis - I would like to be able to change the stack size, similarly to what other WSL users have requested on this thread. I get the following error message,

$ ulimit -s 10000
-bash: ulimit: stack size: cannot modify limit: Invalid argument

Do you have any suggestions?

@therealkenc
Copy link
Collaborator

image

And yes, the second call will fail if you try to grow a hard limit after you shrink it. That is the purpose of ulimit.

@sblisesivdin
Copy link

This problem still exists and can be solved (at least for Ubuntu 20.04) for WSL2 with:

sudo prlimit --stack=unlimited --pid $$; ulimit -s unlimited

You need to run this for every session.

@Lollith
Copy link

Lollith commented Nov 24, 2022

This problem still exists and can be solved (at least for Ubuntu 20.04) for WSL2 with:

sudo prlimit --stack=unlimited --pid $$; ulimit -s unlimited

You need to run this for every session.

WSL1 : OK too

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

No branches or pull requests