Charge [stack] at its grown extent, as Linux does

Aberta
#492 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
28/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
c, linux

Direção de pesquisa

Start by reading the stack mapping and RLIMIT accounting paths, especially the code behind #485, and compare how elfuse reports [stack] in /proc/self/maps and VmSize with the Linux behavior described here. The issue requires stack growth on faults with RLIMIT_STACK and RLIMIT_AS checks; it is done when a Linux-sized ulimit -v behaves consistently and the mapping reflects the grown extent.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement

elfuse maps [stack] at its full fixed extent up front, and #485 counts it that way toward RLIMIT_AS. Linux counts the stack VMA only as far as it has grown.

Measured with one static probe that prints the [stack] line of /proc/self/maps and VmSize from /proc/self/status, right after exec:

[stack] in maps VmSize
elfuse 8188 KiB 8880 kB
Linux 6.18.60 132 KiB 840 kB

So a guest whose ulimit -v was sized from a Linux run gets about 8 MiB less address space under elfuse. test-rlimit-mem cannot see the gap, because it takes its base from elfuse's own VmSize.

To match Linux, [stack] would be charged (and shown in maps) at the extent the stack has grown to, and grown on a fault below it the way Linux expands the stack VMA, with RLIMIT_STACK and RLIMIT_AS checked at that point as acct_stack_growth does.

Refs #485

Linguagem predominante
C
Estrelas
287
Forks
33
Merge médio
2d 17h
PRs com merge (30d)
18

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de sysprog21/elfuse

Todas as issues de sysprog21/elfuse

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.