Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"What man has done, man can aspire to do." -- Jerry Pournelle, about space flight


devel / comp.os.os2.programmer.misc / Re: stack overflow

SubjectAuthor
* stack overflowPaul Edwards
`- Re: stack overflowMarcel Mueller

1
stack overflow

<uub2pt$1is2u$1@dont-email.me>

  copy mid

http://novabbs.i2p/devel/article-flat.php?id=159&group=comp.os.os2.programmer.misc#159

  copy link   Newsgroups: comp.os.os2.programmer.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mutazilah@gmail.com (Paul Edwards)
Newsgroups: comp.os.os2.programmer.misc
Subject: stack overflow
Date: Sun, 31 Mar 2024 15:19:19 +0800
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <uub2pt$1is2u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 31 Mar 2024 07:19:25 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7592d97f0c9bb38d69cb44458fbce964";
logging-data="1667166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18P5tQChlAWkquqd29jbTfUe66RjbRi2t8="
User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:/Jb1xJZf2hout2ckhG+nQy9BoW8=
X-Mozilla-News-Host: news://news.eternal-september.org:119
 by: Paul Edwards - Sun, 31 Mar 2024 07:19 UTC

From memory, when I ran a program on OS/2, the
stack was put into a different segment, which
presumably had a specific length.

Does that meant that OS/2 programs crash on
stack overflow instead of trashing random
things like happens on other environments?

Thanks. Paul.

Re: stack overflow

<uuc1eo$3udig$1@gwaiyur.mb-net.net>

  copy mid

http://novabbs.i2p/devel/article-flat.php?id=160&group=comp.os.os2.programmer.misc#160

  copy link   Newsgroups: comp.os.os2.programmer.misc
Path: i2pn2.org!i2pn.org!news.swapon.de!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail
From: news.5.maazl@spamgourmet.org (Marcel Mueller)
Newsgroups: comp.os.os2.programmer.misc
Subject: Re: stack overflow
Date: Sun, 31 Mar 2024 18:02:32 +0200
Organization: MB-NET.NET for Open-News-Network e.V.
Message-ID: <uuc1eo$3udig$1@gwaiyur.mb-net.net>
References: <uub2pt$1is2u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 31 Mar 2024 16:02:32 -0000 (UTC)
Injection-Info: gwaiyur.mb-net.net;
logging-data="4142672"; mail-complaints-to="abuse@open-news-network.org"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:YTK2ZL7IkhsXte4PuJ9Sqe1Sf7I= sha256:KjjmPptXP+kgr57/OmAzALxtkJgM6msU7TLWJndwIDs=
sha1:Kn+XXnFbH7CoYKq95XZMpv0g92M= sha256:6OiDSGHOLi5pkAnsT2n8xIVIeX8c2Q4wOM86iK95/84=
Content-Language: de-DE, en-US
In-Reply-To: <uub2pt$1is2u$1@dont-email.me>
 by: Marcel Mueller - Sun, 31 Mar 2024 16:02 UTC

Am 31.03.24 um 09:19 schrieb Paul Edwards:
> From memory, when I ran a program on OS/2, the
> stack was put into a different segment, which
> presumably had a specific length.

No in the 32 bit flat memory model the stack segment refers to the same
virtual address space than any other segment register. Otherwise 32 bit
pointers would not work.

> Does that meant that OS/2 programs crash on
> stack overflow instead of trashing random
> things like happens on other environments?

*All* programs on any OS crash on stack overflow.

This is not simply an out of memory condition because the stack segment
must be continuous in virtual address space. When a thread starts it get
a restricted amount of virtual address space. The stack can grow up to
this limit, but beyond the limit other allocations may exist. On OS/2
stack space is typically in between 64kB and 1MB. The latter is
recommended for MMOS2 applications.

Additionally the stack is protected by a guard page. Only if the guard
page is touched the stack grows by 4kB and the guard page is moved one
page lower. Accessing reserved stack space below the current guard page
is considered an invalid memory access and the program terminates. For
this reason an application must call a specific API function to move the
guard page explicitly if a stack frame of a function uses more than 4kB
stack space at once. Some compilers forget to do so causing the
application to crash.

Marcel


devel / comp.os.os2.programmer.misc / Re: stack overflow

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor