gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

Increase max stack size limit?

Open thecodingwizard opened this issue 1 year ago • 2 comments
trafficstars

Description

The maximum stack size (set with ulimit -s) currently appears to be limited to 128 MB. Would maintainers be open to increasing this limit to 512 MB or 1 GB?

For context, I'm trying to run a competitive programming online judge in gVisor, which often requires running programs with a large stack size (usually 256 MB, but occasionally even more).

Thanks for considering this!

Is this feature related to a specific bug?

No

Do you have a specific solution in mind?

Yes -- increase maxStackSize to 512 MB or 1 GB.

thecodingwizard avatar Jun 06 '24 00:06 thecodingwizard

https://github.com/google/gvisor/blob/master/runsc/boot/limits.go#L127

can you change your spec to apply the rlimit you want?

milantracy avatar Jun 06 '24 21:06 milantracy

Thanks! My understanding is that this lets you set the initial stack size to something > 128 MB, but running ulimit -s within the container will reset it back to 128 MB again. Ideally the default stack size would be 8 MB, and a process within the container can run ulimit -s to increase the stack size later.

thecodingwizard avatar Jun 07 '24 01:06 thecodingwizard