9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] lowest valid stack address
Date: Tue,  1 Sep 2009 13:47:22 -0400	[thread overview]
Message-ID: <81344dc3bb1137ca2e54684d0f5d55ef@quanstro.net> (raw)
In-Reply-To: <73d734eff7a63db5f42b7fe5210f93fc@quanstro.net>

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



  reply	other threads:[~2009-09-01 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 15:08 erik quanstrom
2009-09-01 16:52 ` cinap_lenrek
2009-09-01 16:55   ` erik quanstrom
2009-09-01 17:47     ` erik quanstrom [this message]
2009-09-01 23:22       ` Russ Cox
2009-09-01 23:49         ` erik quanstrom
2009-09-01 23:59           ` Russ Cox
2009-09-02  0:18             ` Devon H. O'Dell
2009-09-02  8:01           ` Andrés Domínguez
2009-09-02  8:58             ` Gorka Guardiola
2009-09-02 13:32               ` erik quanstrom
2009-09-02 13:28             ` Devon H. O'Dell
2009-09-02 13:35               ` erik quanstrom
2009-09-02 14:17                 ` Devon H. O'Dell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81344dc3bb1137ca2e54684d0f5d55ef@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).