From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <81344dc3bb1137ca2e54684d0f5d55ef@quanstro.net> From: erik quanstrom Date: Tue, 1 Sep 2009 13:47:22 -0400 To: 9fans@9fans.net In-Reply-To: <73d734eff7a63db5f42b7fe5210f93fc@quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] lowest valid stack address Topicbox-Message-UUID: 5ded6ac6-ead5-11e9-9d60-3106f5b1d025 On Tue Sep 1 12:56:41 EDT 2009, quanstro@quanstro.net wrote: > On Tue Sep 1 12:54:06 EDT 2009, cinap_lenrek@gmx.de wrote: > > > read /proc/$pid/segment > > how do i know how low the stack segment can go? i should have been more explicit. it's not that useful to know what the current stack allocation is. it's more useful to know what the lowest possible stack address could be. knowing the exact minimum address of my process doesn't tell me anything about other process' stacks with which i share memory space. the address in question might be on another proc's stack. i'm also worried that it would not be cheep enough to do a system call ~50x per mailbox message to check the sbrk or look at /proc/$pid/segment. this would mean 500000-1m extra system calls just to open a mailbox. i suppose that a function like malloctopaddr() would do that without locking returns the last sbrk. but i'd settle for the lowest stack address. - erik