|
Message-ID: <20130331213759.GJ30576@port70.net> Date: Sun, 31 Mar 2013 23:37:59 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: Re: pthread_getattr_np * Rich Felker <dalias@...ifal.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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.