Monthly Archives: September 2014

procfs environ explained in-depth (3)

(Continue from last post…) Now we see how env_start and env_end get successfully initialized to the user address of the block of memory in user stack. There is one question left to be answered, i.e. how is the “extern char … Continue reading

Leave a comment

procfs environ explained in-depth (2)

(Continue from last post…) So now the question becomes where we get the env_start and env_end set? Obviously from the bit of kernel code, the two addresses are both simply user space address and all the code does is nothing … Continue reading

Leave a comment

procfs environ explained in-depth (1)

I started to wonder how procfs environ , i.e. /proc/<pid>/environ, works because the other day someone asked me why his procfs environ does not get updated when he has called setenv in his code to change a certain environment variable. It’s … Continue reading

Leave a comment

Why is my GDB “step” command behavior changed?

Recently ran into a funny issue where one friend complained his GDB “step” command behavior is changed mysteriously and the only thing he remembered is he did apt-get a few things. His sample program is like below: It used to … Continue reading

Posted in Linux | 1 Comment