public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-5307] modula-2: Fix stack size request in initPreemptive [PR108405]
Date: Mon, 23 Jan 2023 17:26:35 +0000 (GMT)	[thread overview]
Message-ID: <20230123172635.C854D3858D32@sourceware.org> (raw)

https://gcc.gnu.org/g:bcc023e2b4dd0dc1fd1fca3ea12664d5bdade4dc

commit r13-5307-gbcc023e2b4dd0dc1fd1fca3ea12664d5bdade4dc
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sat Jan 14 10:20:47 2023 +0000

    modula-2: Fix stack size request in initPreemptive [PR108405]
    
    As noted in the PR, the problem is that we make a request for additional
    stack that violates the constraints on some systems.
    
    This patch chooses a value that is divisible by common OS page sizes.
    
    TODO: the user value should be checked and then an exception thrown if it
    is not suitable.
    
    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
    
            PR modula2/108405
    
    gcc/m2/ChangeLog:
    
            * gm2-libs-iso/Preemptive.mod (initPreemptive): Use a value for
            extra space that is divisible by common OS pagesizes.

Diff:
---
 gcc/m2/gm2-libs-iso/Preemptive.mod | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/m2/gm2-libs-iso/Preemptive.mod b/gcc/m2/gm2-libs-iso/Preemptive.mod
index 53952e1c1cb..44aa62ba48a 100644
--- a/gcc/m2/gm2-libs-iso/Preemptive.mod
+++ b/gcc/m2/gm2-libs-iso/Preemptive.mod
@@ -33,6 +33,9 @@ FROM libc IMPORT printf ;
 
 CONST
    debugging = FALSE ;
+   (* The space we request becomes part of a stack request, which generally
+      has constraints on size and alignment.  *)
+   extraWorkSpace = 10 * 1024 * 1024 ;
 
 (*
    timer - the timer process which runs at maximum scheduling priority with
@@ -107,7 +110,7 @@ BEGIN
    IF NOT init
    THEN
       init := TRUE ;
-      Create (timer, 10000000, MAX (Urgency), NIL, timerId) ;
+      Create (timer, extraWorkSpace, MAX (Urgency), NIL, timerId) ;
       Activate (timerId)
    END
 END initPreemptive ;

                 reply	other threads:[~2023-01-23 17:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230123172635.C854D3858D32@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).