From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 266BE386486B; Wed, 6 Jan 2021 12:22:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 266BE386486B From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/27151] Step will skip subsequent statements for malloc functions Date: Wed, 06 Jan 2021 12:22:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints 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: cf_reconfirmed_on bug_status everconfirmed 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: Wed, 06 Jan 2021 12:22:03 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27151 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-01-06 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Tom de Vries --- I managed to reproduce this on ubuntu 20. Configurations: - gcc-10, system gdb, - gcc-10, gdb build from current trunk. The problem goes away when small.c is build with fcf-protection=3Dnone. I tried to reproduce this on my usual setup, openSUSE Leap 15.2, by forcing fcf-protection=3Dfull. Didn't reproduce. Copied Leap executable to ubuntu, and tried using gdb there. Didn't reprod= uce. Then copied ubuntu executable to Leap. Reproduced. So, sofar this seems specific to the ubuntu executable. The two executables have similar line info and insns for main. There is a difference in the plt. For leap, we have: ... 00000000000005f0 : 5f0: ff 25 32 0a 20 00 jmpq *0x200a32(%rip) \ # 201028 5f6: 68 02 00 00 00 pushq $0x2 5fb: e9 c0 ff ff ff jmpq 5c0 <.plt> ... For ubuntu, we have: ... 0000000000001090 : 1090: f3 0f 1e fa endbr64 1094: f2 ff 25 35 2f 00 00 bnd jmpq *0x2f35(%rip) \ # 3fd0 109b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) ... Using "set debug infrun 1", with leap we have: ... [infrun] handle_signal_stop: stop_pc=3D0x5555555545f0 [infrun] process_event_stop_test: stepped into dynsym resolve code ... where: ... (gdb) info sym 0x5555555545f0=20=20=20=20=20=20=20=20 malloc@plt in section .plt of /home/vries/gdb_versions/devel/a.leap.out ... But with ubuntu we have: ... [infrun] handle_signal_stop: stop_pc=3D0x555555555090 [infrun] process_event_stop_test: stepped into subroutine [infrun] insert_step_resume_breakpoint_at_sal_1: inserting step-resume breakpoint at 0x7ffff7df0710 ... where: ... (gdb) info sym 0x555555555090 malloc@plt in section .plt.sec of /home/vries/gdb_versions/devel/a.out ... and: ... (gdb) info sym 0x7ffff7df0710 malloc in section .text of /lib64/ld-linux-x86-64.so.2 ... Looking for the "stepped into dynsym resolve code" in the gdb sources, we f= ind in_solib_dynsym_resolve_code, which returns false with the ubuntu exec, and true with the leap exec. --=20 You are receiving this mail because: You are on the CC list for the bug.=