Skip to content

Commit

Permalink
Copy important things like brk and start_brk in fork
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Dec 5, 2018
1 parent 5e89f7f commit 3e82469
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Build 35
### Fixed
- `out of memory`/`short read` error from tar, due to fork setting brk to 0

## Build 34
### New
- Enough stubs and instructions to get numpy to import successfully.
Expand Down
3 changes: 3 additions & 0 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ static int copy_task(struct task *task, dword_t flags, addr_t stack, addr_t ptid
mem_retain(mem);
} else {
task->mem = task->cpu.mem = mem_new();
task->mem->vdso = mem->vdso;
task->mem->brk = mem->brk;
task->mem->start_brk = mem->start_brk;
write_wrlock(&mem->lock);
pt_copy_on_write(mem, 0, task->mem, 0, MEM_PAGES);
write_wrunlock(&mem->lock);
Expand Down

0 comments on commit 3e82469

Please sign in to comment.