You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though we can use other methods to solve it, like using setrlimit system call on Linux to acquire a bigger stack mannually, I think it will be better if cpeditor can support configuable stack size.
Describe the feature you'd like
Support configurable stack size.
Describe alternatives you've considered
No response
Are you willing to contribute to this?
I'm ready to contribute to this (and will open a PR soon)
I'd like to have a try (with the help of the maintainers)
No, thanks
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Generally stack size is configurable at time of compilation so can you not change the compile command to suit your need? It should work for MinGW in Windows.
You can add Add ulimit -s unlimited to .bashrc for linux? I don't think there is a way to specifically increase limit for one program except using setrlimit syscall.
@StupidQu correct, we spawn your code as child process with QProcess.
There are two ways to increase stack size for your program:
We set the cpeditor stack size to unlimited using setrlimit and if limits are inherited by child processes, your code will run with unlimited stack size. No doubt this is bad.
In your code you can programatically set the unlimited stack size limit. This limit change can be controlled with conditional compilation so that it doesn't run on judge.
#include<iostream>
#include<sys/resource.h>intmain() {
structrlimit rl;
rl.rlim_cur = RLIM_INFINITY; // Set soft limit to unlimited
rl.rlim_max = RLIM_INFINITY; // Set hard limit to unlimitedif (setrlimit(RLIMIT_STACK, &rl) != 0) {
perror("setrlimit");
return1;
}
// Your program logic herereturn0;
}
Is there an existing issue for this?
Is this feature provided in the master branch?
The problem you are facing
The code below will receive RE locally due to stack size limit.
Though we can use other methods to solve it, like using
setrlimit
system call on Linux to acquire a bigger stack mannually, I think it will be better if cpeditor can support configuable stack size.Describe the feature you'd like
Support configurable stack size.
Describe alternatives you've considered
No response
Are you willing to contribute to this?
Anything else?
No response
The text was updated successfully, but these errors were encountered: