[issue34602] python3 resource.setrlimit strange behaviour under macOS

Vladimir Matveev report at bugs.python.org
Fri Sep 7 22:56:34 EDT 2018


Vladimir Matveev <desco.by at gmail.com> added the comment:

I can repro it with a given sample file 
```
vladima-mbp $ cat test.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/resource.h>

int main() {
  struct rlimit rl;
  if(getrlimit(RLIMIT_STACK, &rl) < 0) {
    perror("getrlimit");
    exit(1);
  }

  rl.rlim_cur = rl.rlim_max;
  if(setrlimit(RLIMIT_STACK, &rl) < 0) {
    perror("setrlimit");
    exit(1);
  }
  return 0;
}vladima-mbp $ gcc   -Wl,-stack_size,1000000   -o test test.c
vladima-mbp $ ./test
setrlimit: Invalid argument
```
Similar settings were added to Python in https://github.com/python/cpython/commit/335ab5b66f4

----------
nosy: +v2m

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34602>
_______________________________________


More information about the Python-bugs-list mailing list