From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5A16C3857C7B; Fri, 1 Oct 2021 09:25:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A16C3857C7B From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/28404] New: Verify bsearch precondition in find_pc_section Date: Fri, 01 Oct 2021 09:25:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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://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: Fri, 01 Oct 2021 09:25:13 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28404 Bug ID: 28404 Summary: Verify bsearch precondition in find_pc_section Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- While debugging some problem I came across a bsearch in find_pc_section, wh= ich relies on the sections array being in ascending sorted order. Visual inspection revealed that the precondition was not met. It would probably be good to write an assert checking the precondition, and= use it to see if indeed it triggers. Perhaps even add a verify_bsearch to gdbsupport that can be dropped in plac= e to check the precondition. --=20 You are receiving this mail because: You are on the CC list for the bug.=