Setting resource.RLIMIT_STACK not working on MacOS
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 36k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
Bug report
Bug description:
Running
python3.14 -c "import resource; resource.setrlimit(resource.RLIMIT_STACK, resource.getrlimit(resource.RLIMIT_STACK))"
On MacOS 15.7.2 on my M4 Macbook produces the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
import resource; resource.setrlimit(resource.RLIMIT_STACK, resource.getrlimit(resource.RLIMIT_STACK))
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: current limit exceeds maximum limit
Given we are setting the limit to what it was previously, I would not expect this to exceed the maximum limit, because we are not actually changing any limits. The following c program works without issue
#include <stdio.h>
#include <errno.h>
#include <sys/resource.h>
int main(void)
{
struct rlimit limits = {
8372224,
60792480
};
int r = setrlimit(RLIMIT_STACK, &limits);
if (r == -1) {
perror("setrlimit");
return 1;
}
return 0;
}
(The limits I am setting there are the defaults that python reports).
This seems to be related to #78783.
CPython versions tested on:
3.14
Operating systems tested on:
macOS
Linked PRs
- gh-150170
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece com o comando Python reportado que usa resource.setrlimit e resource.getrlimit no macOS e, em seguida, revise a issue relacionada #78783 e o PR vinculado gh-150170. Está concluído quando definir RLIMIT_STACK com os valores retornados por getrlimit não gerar mais ValueError na configuração do macOS reportada.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- operating-systems
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100