Remove assertion on brk() (#860)

Manticore assumed that new calls to brk(2) were always increasing the
size of the data segment. This is not always true, since programs may
decide to reduce it as well.

Tested with a static Linux/i386 program on macOS/amd64.

(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/mmap.c?h=v4.17-rc1#n226)
This commit is contained in:
Pierre Pronchery 2018-04-17 23:25:40 +02:00 committed by Yan Ivnitskiy
parent 2814723cc8
commit 71bf5d4f11

View File

@ -1310,7 +1310,6 @@ class Linux(Platform):
- "Error in brk!" if there is any error allocating the memory
'''
if brk != 0 and brk != self.elf_brk:
assert brk > self.elf_brk
mem = self.current.memory
size = brk - self.elf_brk
perms = mem.perms(self.elf_brk - 1)