From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 00087388982E; Mon, 7 Jun 2021 15:56:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00087388982E From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/27847] A possible divide by zero bug in amd64_has_unaligned_fields (amd64-tdep.c) Date: Mon, 07 Jun 2021 15:56:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 15:56:51 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27847 --- Comment #6 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Andrew Burgess : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da12a15e7c5ff= 9f3549dd185fa1acd5a9dddd001b commit a12a15e7c5ff9f3549dd185fa1acd5a9dddd001b Author: Andrew Burgess Date: Wed May 12 13:44:06 2021 +0100 gdb: handle case where type alignment is unknown It was spotted that if type_align returned 0 then it was possible to trigger a divide by zero exception within GDB. It turns out this will only happen in an edge case where GDB is unable to figure out the alignment of a field within a structure. The attached test generates some non-standard, probably broken, DWARF, that triggers this condition, and then fixes this issue by throwing an exception when this case occurs. gdb/ChangeLog: PR gdb/27847 * amd64-tdep.c (amd64_has_unaligned_fields): Move call to type_align, and spot case where the alignment is unknown. gdb/testsuite/ChangeLog: PR gdb/27847 * gdb.dwarf2/dw2-weird-type-len.c: New file. * gdb.dwarf2/dw2-weird-type-len.exp: New file. --=20 You are receiving this mail because: You are on the CC list for the bug.=