Deutsch   English   Français   Italiano  
<b5002f983fc0ac6c112dca814b5e1cff@www.novabbs.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: mitchalsup@aol.com (MitchAlsup1)
Newsgroups: comp.arch
Subject: Re: Segments
Date: Wed, 22 Jan 2025 22:25:33 +0000
Organization: Rocksolid Light
Message-ID: <b5002f983fc0ac6c112dca814b5e1cff@www.novabbs.org>
References: <bdZeP.23664$Hfb1.16566@fx46.iad> <20250115222824.000034d6@yahoo.com> <vm97j3$342b3$1@dont-email.me> <vmar0d$3g078$1@dont-email.me> <20250116143532.00002117@yahoo.com> <vmavsb$3gpni$1@dont-email.me> <vmbd4n$3v6su$3@paganini.bofh.team> <vmbsvr$3lpar$1@dont-email.me> <vme199$4g29$1@dont-email.me> <b3h0pjhe3gpa84hev3ffbsmq9d3fmcfs49@4ax.com> <0a716d8979e4f539138c8068da250b3f@www.novabbs.org> <0I7kP.72725$oCrf.34275@fx33.iad> <7b08b7086bd94775b9d88b844763f122@www.novabbs.org> <y7ckP.76377$ZEZf.61315@fx40.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
	logging-data="669474"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="o5SwNDfMfYu6Mv4wwLiW6e/jbA93UAdzFodw5PEa6eU";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: cb29269328a20fe5719ed6a1c397e21f651bda71
X-Rslight-Site: $2y$10$.wjlS/fhluoly1ruFHkP8usATckQrHHwJ16QM7EcfuQP76/kijAOS
X-Spam-Checker-Version: SpamAssassin 4.0.0
Bytes: 2530
Lines: 29

On Wed, 22 Jan 2025 20:00:30 +0000, Scott Lurndal wrote:

> mitchalsup@aol.com (MitchAlsup1) writes:
>>On Wed, 22 Jan 2025 14:58:04 +0000, Scott Lurndal wrote:
>>>(MitchAlsup1)
>
>>>>On a Linux machine, you can find the last envp[*] entry and subtract
>>>>SP from it.
>>>
>>> I would discourage programmers from relying on that for any reason
>>> whatsoever.   The aux vectors are pushed before the envp entries.
>>
>>This brings into question what is "on" the stack ?? to be included
>>in the measurement of stack size.
>>
>>Only user data ??
>>Data that is present when control arrives ??
>>Could <equivalent> CRT0 store SP at arrival ??
>>
>>I think we have an illdefined measurement !!
>
> Everything between the base address of the stack
> and the limit address of the stack.  The kernel exec(2)
> family system calls will allocate the initial
> stack region (with guard pages to handle extension)
> and populate it with the AUX, ENVP and ARG vectors
> before invoking the CRT in usermode.

So, how does one find the base (highest address on the stack) ??
in a way that works on every system capable of running C-code ??