Page 1 of 1

process memory

Posted: Sat Dec 01, 2007 10:38 pm
by schannah
It would be helpful if I could get information on the following

Why does the stack bounds change for a process every time it is restarted on Linux ? Why does it change ?

If I want to capture the heap area of a process through another process which also runs in user level, what would be the best method to do it?

Similarly, if I want to find a process's pending signals through another process, how could I do it.

It would be of great help if I could get help for these

Thanks & Regards
schannah

Posted: Sat Dec 01, 2007 10:47 pm
by Brynet-Inc
Why I understand how that may be frustrating... I must inform you.

This forum is for people developing "Hobby Operating Systems", Not Linux software.

You might want to try the "General Programming" section instead, or you can try finding the appropriate Linux kernel mailing lists.

Re: process memory

Posted: Sun Dec 02, 2007 12:06 pm
by blound
schannah wrote:Why does the stack bounds change for a process every time it is restarted on Linux ? Why does it change?
does bounds mean address? if so its changing every time because of ASLR

This can be turned off by
echo 0 > /proc/sys/kernel/randomize_va_space
The easiest way to get the addresses of another processes heap would be to parse the /proc/<pid>/maps file of the process you want. From there you can use ptrace to read the memory out of the other process into yours.

Posted: Sun Dec 02, 2007 3:35 pm
by schannah
Thanks blound ...
The solution looks to be perfect.

Sorry for posting in the wrong forum.

Thanks
schannah