sbrk syscall should have the same behaviour than the linux’s
NAME sbrk - change data segment size SYNOPSIS void *sbrk(ssize_t increment); DESCRIPTION sbrk() increments the program's data space by increment bytes. Calling sbrk() with an increment of 0 can be used to find the current location of the program break. RETURN VALUE sbrk() return the old break value.
- Find a convenient place to put your program break
man 2 sbrk
Possible bug causes
- The new break has been return
- The returned pointer is from a wrong address space
- The address hasn’t been correctly translated