Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Mar 2020 10:54:28 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Paul Floyd <pjfloyd@wanadoo.fr>
Cc:        "toolchain@freebsd.org" <toolchain@freebsd.org>
Subject:   Re: x86 process memory map
Message-ID:  <20200330075428.GG1992@kib.kiev.ua>
In-Reply-To: <E933CC5C-756E-4C0B-96FE-EA1A70CC3139@wanadoo.fr>
References:  <E933CC5C-756E-4C0B-96FE-EA1A70CC3139@wanadoo.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 30, 2020 at 08:18:08AM +0200, Paul Floyd wrote:
> When I run procstat on a small 32bit app that just calls sleep (on FreeBSD 12.1 amd64) then I see at the end of the map
> 
> 22353         0xfbffe000         0xfffde000 ---    0    0   0   0 ----- -- 
> 22353         0xfffde000         0xffffe000 rw-    3    3   1   0 ---D- df 
> 22353         0xffffe000         0xfffff000 r-x    1    1  94   0 ----- ph
> 
> I think the last block is for signal handlers and the last but one block is the user stack.
> But what is between 0xfbffe000 and 0xfffde000? It's a bit less than 64Mbytes. This has no protection flags, no resident pages or references and no type. My guess is that this is some sort of guard page for the user stack.
> 
It is the stack grow area and the guard, combined.  Read the mmap(2), in
particular explanation of MAP_STACK and MAP_GUARD.

> Can anyone confirm this? Also, does anyone know if this has been present in FreeBSD for a long time? My copy of “The Design and Implementation of FreeBSD" 2e doesn't show anything between stack and shared libraries.
> 
> A+
> Paul
> 
> 
> _______________________________________________
> freebsd-toolchain@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
> To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200330075428.GG1992>