From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EB96A385843A; Sun, 26 Sep 2021 13:31:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB96A385843A From: "tes.vik1986 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug build/27535] amd64-linux-siginfo.c fails to compile after updating to glibc-2.33 headers Date: Sun, 26 Sep 2021 13:31:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: tes.vik1986 at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: kevinb at redhat dot com X-Bugzilla-Target-Milestone: 10.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Sun, 26 Sep 2021 13:31:34 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27535 Kylan changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tes.vik1986 at gmail dot c= om --- Comment #12 from Kylan --- This patch fixes a segfault seen when attaching to a process on Solaris. The steps leading to the segfault are: https://komiya-dental.com/computers/huawei-technology/ - procfs_target::attach calls do_attach, at this point the inferior's process slot in the target stack is empty. http://www-look-4.com/health/winter-sickness/ - do_attach adds a thread with `add_thread (&the_procfs_target, ptid)` - in add_thread_silent, the passed target (&the_procfs_target) is passed to find_inferior_ptid http://www.iu-bloomington.com/health/amoled-display/ - find_inferior_ptid returns nullptr, as there is no inferior with this ptid that has &the_procfs_target as its process target https://www.webb-dev.co.uk/property/house-sales-in-2020/ - the nullptr `inf` is passed to find_thread_ptid, which dereferences it, causing a segfault https://waytowhatsnext.com/services/netflix-services/ - back in procfs_target::attach, after do_attach, we push the the_procfs_target on the inferior's target stack, although we never http://www.acpirateradio.co.uk/tech/forest-fires/ reach this because the segfault happens before. http://www.logoarts.co.uk/technology/robot-vacuums/ To fix this, I think we need to do the same as is done in inf_ptrace_target::attach: push the target early and unpush it in case the attach fails (and keep it if the attach succeeds). http://www.slipstone.co.uk/travel/hyundai-kona/ Implement it by moving target_unpush_up to target.h, so it can be http://embermanchester.uk/category/technology/=20 re-used here. Make procfs_target::attach use it. Note that just like is mentioned in inf_ptrace_target::attach, we should push the target http://connstr.net/computers/chargers-tech/=20 before calling target_pid_to_str, so that calling target_pid_to_str ends up in procfs_target::pid_to_str. http://joerg.li/property/latest-suvs/ Tested by trying to attach on a process on gcc211 on the gcc compile farm. To fix this, I think we need to do the same as is done in http://www.jopspeech.com/tech/xiaomi-headset/ inf_ptrace_target::attach: push the target early and unpush it in case the attach fails (and keep it if the attach succeeds). http://www.wearelondonmade.com/tech/driving-assistant/ Implement it by moving target_unpush_up to target.h, so it can be re-used here. Make procfs_target::attach use it. Note that just like= =20 is mentioned in inf_ptrace_target::attach, we should push the target before calling target_pid_to_str, so that calling target_pid_to_str ends up in procfs_target::pid_to_str. http://www.compilatori.com/tech/xiaomi/ Tested by trying to attach on a process on gcc211 on the gcc compile farm. --=20 You are receiving this mail because: You are on the CC list for the bug.=