public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108405] New: modula-2: Testsuite fails: concurrentstore.mod, contimer.mod, tinytimer.mod on Darwin (and likely elsewhere)
@ 2023-01-14 10:12 iains at gcc dot gnu.org
  2023-01-14 10:14 ` [Bug modula2/108405] " iains at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2023-01-14 10:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108405

            Bug ID: 108405
           Summary: modula-2: Testsuite fails: concurrentstore.mod,
                    contimer.mod, tinytimer.mod on Darwin (and likely
                    elsewhere)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

The test cases in the subject all fail on Darwin for the same reason, there is
an attempt to set a stack size that violates the constraints of
pthread_attr_setstacksize.

On Darwin;
     pthread_attr_setstacksize() will fail if:
     [EINVAL]           stacksize is less than PTHREAD_STACK_MIN
     [EINVAL]           stacksize is not a multiple of the system page size.

On Linux:
       pthread_attr_setstacksize() can fail with the following error:

       EINVAL The stack size is less than PTHREAD_STACK_MIN (16384) bytes.
       On some systems, pthread_attr_setstacksize() can fail with the error
EINVAL if stacksize is not a multiple of the system page size.

--- So the report reported on Darwin might well occur also on (at least some)
Linux systems.

The problem is in
 PROCEDURE initPreemptive (seconds, microsecs: CARDINAL) ;
which tries to call 
 Create (timer, 10000000, MAX (Urgency), NIL, timerId) ;

Where 10000000 violates the constraints on stack size (definitely on Darwin,
maybe on some Linux).

So .. the short-term solution is to fix initPreemptive to use a suitable value
(patch to be posted).

However:

1. We should have detected the bad user value earlier and thrown an exception?
2. It is not clear to me how these magic numbers (embedded in the library) have
been chosen (there is 8Mb as defaultSize and then here we add 10Mb)  perhaps
this is something that should be configured or at least set according to a
target query?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-23 17:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-14 10:12 [Bug modula2/108405] New: modula-2: Testsuite fails: concurrentstore.mod, contimer.mod, tinytimer.mod on Darwin (and likely elsewhere) iains at gcc dot gnu.org
2023-01-14 10:14 ` [Bug modula2/108405] " iains at gcc dot gnu.org
2023-01-14 10:24 ` iains at gcc dot gnu.org
2023-01-14 10:31 ` schwab@linux-m68k.org
2023-01-23 17:26 ` cvs-commit at gcc dot gnu.org
2023-01-23 17:31 ` iains at gcc dot gnu.org

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).