mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: pthread_getattr_np
Date: Sun, 31 Mar 2013 23:37:59 +0200	[thread overview]
Message-ID: <20130331213759.GJ30576@port70.net> (raw)
In-Reply-To: <20130331210005.GJ20323@brightrain.aerifal.cx>

* Rich Felker <dalias@aerifal.cx> [2013-03-31 17:00:05 -0400]:
> > to get a 'precize' lowend one can:
> > 1) parse /proc/self/maps which gives the current [low,high] mapping
> > and 'prev' the high end of the last mapping below the stack
> > 2) if we are the main thread check if low <= sp <= high
> > 3) check rlimit
> 
> Parsing /proc/self/maps is utterly useless for non-main-thread. Unless
> the thread has a guard page, its stack mapping can be adjacent to
> another thread's stack mapping, and thus they can get merged into a
> single mapping.

i was only talking about the main thread case,
because you said the other case is simple

what i meant in 2) is if another thread tries
to query the stack of the main thread

the /proc/self/maps works for that too, but
then you cannot check if sp is really in the
given intervall



  reply	other threads:[~2013-03-31 21:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-31 17:35 pthread_getattr_np Szabolcs Nagy
2013-03-31 18:07 ` pthread_getattr_np Rich Felker
2013-03-31 20:51   ` pthread_getattr_np Szabolcs Nagy
2013-03-31 21:00     ` pthread_getattr_np Rich Felker
2013-03-31 21:37       ` Szabolcs Nagy [this message]
2013-03-31 23:31     ` pthread_getattr_np Szabolcs Nagy

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=20130331213759.GJ30576@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).