From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 377DE3858C50; Sat, 14 Jan 2023 10:12:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 377DE3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673691139; bh=j1Srz5YeWKSb1iOGsarqkPWtvqRoEZiXsxe9tlKPE8s=; h=From:To:Subject:Date:From; b=wHTuKm13YuBJERhWU7VMcJUaknlLyj93IcP4mAu1+nY0e3E0GPphbe3IxW0Ggh4/V 4bWbTP0XRPuhYFfaIIIeUOo8PKKh0dlwEp/pxkjcmA62YuVHyRNN8F6xCeqTTsEzys LbZEAu6HTLURnz3huaYpLg2MQfbp20IVE9Egv8BY= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/108405] New: modula-2: Testsuite fails: concurrentstore.mod, contimer.mod, tinytimer.mod on Darwin (and likely elsewhere) Date: Sat, 14 Jan 2023 10:12:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108405 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 som= e) Linux systems. The problem is in PROCEDURE initPreemptive (seconds, microsecs: CARDINAL) ; which tries to call=20 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 va= lue (patch to be posted). However: 1. We should have detected the bad user value earlier and thrown an excepti= on? 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?=