From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B598D3858D39; Sat, 14 Jan 2023 09:57:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B598D3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673690229; bh=xaTiH1uLjE6xHno+SwAWy14n9OAwo9QfJ1WutMNAYfM=; h=From:To:Subject:Date:From; b=BFU/wAM9OLN1tHcSOS/twWExJtGwnRkHVPBhfWnnBiAH/0WQlCeI1rgKTY4QKEHDq Qo7SM/WA/FTpq6kkNZz2rMl3Lewdv5d7zMlMW5bBn9uLRmdgyAlRNs4eAp6Vet/o6C 6R1LZEnqgUHi+smPgmlbBFM4v/e44vxXtCqJadmw= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/108404] New: M2RTS_Halt fails with a segv (it should emit a diagnostic and exit). Date: Sat, 14 Jan 2023 09:57:08 +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=3D108404 Bug ID: 108404 Summary: M2RTS_Halt fails with a segv (it should emit a diagnostic and exit). 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: --- On Darwin several tests fail because there is an invalid stack size set (th= at is a separate bug). The fault should have been reported by M2RTS_Halt (it is detected correctly= in Rico.cc). Setting a break point on the entry to M2RTS_Halt : * thread #1, queue =3D 'com.apple.main-thread', stop reason =3D breakpoint = 1.1 frame #0: 0x00000001000054f0 concurrentstore.x0`M2RTS_Halt at M2RTS.mod:296:1 293=20=20 294 PROCEDURE Halt (file: ARRAY OF CHAR; line: CARDINAL; 295 function: ARRAY OF CHAR; description: ARRAY OF CHAR= ) ; -> 296 BEGIN 297 ErrorMessage (description, file, line, function) ; 298 HALT 299 END Halt ; examining the registers: (lldb) reg read General Purpose Registers: rax =3D 0x0000000000000016 rbx =3D 0x0000600002c08118 rcx =3D 0x0000000100014c00 "failed to set stack size attribute" rdx =3D 0x0000000100014bf2 "initThread" rdi =3D 0x0000000100014b00=20 "/src-local/gcc-master/libgm2/libm2iso/RTco.cc" rsi =3D 0x0000000000000172 this is correct ABI - RDI - file, RSI =3D line number, RDX =3D function, RC= X =3D message. (four integer/pointer arguments). ---- however if we continue from this point ... * thread #1, queue =3D 'com.apple.main-thread', stop reason =3D EXC_BAD_ACC= ESS (code=3D2, address=3D0x3014e7178) frame #0: 0x000000010000554f concurrentstore.x0`M2RTS_Halt at M2RTS.mod:296:1 293=20=20 294 PROCEDURE Halt (file: ARRAY OF CHAR; line: CARDINAL; 295 function: ARRAY OF CHAR; description: ARRAY OF CHAR= ) ; -> 296 BEGIN 297 ErrorMessage (description, file, line, function) ; I cannot (at present) debug this further since I do not have an installed debugger that supports Module-2 (but it might well repeat on Linux - the A= BI is basically the same). In any case, it seems likely that the problem is in the prologue or very early in the function since the break line is on BEGIN= in both cases.=