From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EA7073858C35; Sun, 3 Dec 2023 16:28:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA7073858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701620921; bh=fJzMMhVV1b+AzZ4qieo7xd4jBTQxY4FnoOc3J4Ifctk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WNiE08sDaTiKysOtRA82Pu8hhT7Y5SkpFy9/mZmW1ETZDyi/y8JXsEpa7F0I5siSp Bdh+Q/o3deBWW8abSLOVRN3OcRQ9DYskSUjCZZLvUzr+NSgvRaggX04xY6VKiIZo32 DxJlafXUXKHW6fMS0atSrafn4m1ION9QI4E/KTJ8= From: "townsend at astro dot wisc.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/112828] Abort with malloc(): corrupted top size Date: Sun, 03 Dec 2023 16:28:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: townsend at astro dot wisc.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D112828 --- Comment #3 from Rich Townsend --- I can get the MWE to barf on MacOS/Arm (Sonoma 14.1.1), gfortran 13.1.0, by changing the length of the character vars in the main program from 64 to 16. The error is now: In file 'test.f90', around line 49: Error allocating 211106259502048 bytes: Cannot allocate memory Error termination. Backtrace: #0 0x102d77617 #1 0x102d781b7 #2 0x102d78457 #3 0x10275f5bb #4 0x10275fc37 #5 0x10275f84f #6 0x10275fc87 Once again, commenting out the allocate w/ STAT line makes the problem go a= way. It seems as though having two allocate invocations (one with stat, one with= out) is causing some kind of memory corruption.=