On a first shell I run the command tail with no argument.

On a second shell I kill the first tail using strace to monitor the system calls.

qdii@nomada ~ $ strace kill 1713
execve("/bin/kill", ["kill", "1713"], [/* 82 vars */]) = 0
brk(0)                                  = 0x2533000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dacfe8000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3

I didn’t know the brk command so I looked it up and found that it changes the end of the data segment of the process. Why would kill do that? especially setting the data segment to 0 seems to make little sense.

1 Answer 1


The run-time library calls sbrk to read the current end of the data segment. sbrk is implemented on top of the brk syscall; as you can see, calling brk with an invalid address just returns the current value.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .