From nobody Tue Nov 2 19:48:56 2021 X-Original-To: gecko@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C6CD4182FF11 for ; Tue, 2 Nov 2021 19:48:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HkL7X6W6cz4h82 for ; Tue, 2 Nov 2021 19:48:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6427303F for ; Tue, 2 Nov 2021 19:48:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 1A2JmuBu041189 for ; Tue, 2 Nov 2021 19:48:56 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1A2Jmu33041188 for gecko@FreeBSD.org; Tue, 2 Nov 2021 19:48:56 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: gecko@FreeBSD.org Subject: [Bug 216143] lang/rust, devel/cargo: generate bootstraps for Tier2 architectures via cross-compilation Date: Tue, 02 Nov 2021 19:48:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: dogfood, needs-patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: ahmedsayeed1982@yahoo.com X-Bugzilla-Status: Closed X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: dumbbell@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback+ 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: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Gecko Rendering Engine issues List-Archive: https://lists.freebsd.org/archives/freebsd-gecko List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-gecko@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D216143 Ahmed changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ahmedsayeed1982@yahoo.com --- Comment #41 from Ahmed --- This patch fixes a segfault seen when attaching to a process on Solaris. The steps leading to the segfault are: http://www.compilatori.com/tech/xiaomi/ - procfs_target::attach calls do_attach, at this point the inferior's process slot in the target stack is empty.=20 - do_attach adds a thread with `add http://www.acpirateradio.co.uk/tech/forest-fires/ _thread (&the_procfs_targ= et, ptid)` - in add_thread_silent, the passed target (&the_procfs_target) is passed to find_inferior_ptid http://www.logoarts.co.uk/tech/drone-cameras/ - find_inferior_ptid returns nullptr, as there is no inferior with this ptid that has &the_procfs_target as its process target http://www.slipstone.co.uk/tech/express-van/ - the nullptr `inf` is passed to find_thread_ptid, which dereferences it, causing a segfault - back in procfs_target::attach, after do_attach, we push the http://embermanchester.uk/technology/telegram/=20 the_procfs_target on the inferior's target stack, although we never reach this because the segfault happens before. http://connstr.net/tech/mars-surface/ To fix this, I think we need to do the same as is done in=20 inf_ptrace_target::attach: push the target early and unpush it in case the attach fails (and keep it if the attach succeeds). http://joerg.li/tech/cars-comparison/ 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 is mentioned http://www.jopspeech.com/tech/xiaomi-headset/ 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.wearelondonmade.com/tech/driving-assistant/ Tested by trying to attach on a process on gcc211 on the gcc compile farm. https://waytowhatsnext.com/health/vaccination-rates/ gdb/ChangeLog: This patch fixes a segfault seen when attaching to a process on Solaris. The steps leading to the segfault are: http://www.iu-bloomington.com/health/amoled-display/ - procfs_target::attach calls do_attach, at this point the inferior's process slot in the target stack is empty. https://komiya-dental.com/health/telegram-account/ - 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-look-4.com/services/usb-type= -a/ - find_inferior_ptid returns nullptr, as there is no inferior with this ptid that has &the_procfs_target as its process target - the nullptr `inf` is passed to find_thread_ptid, which dereferences it, causing a segfault https://www.webb-dev.co.uk/property/house-sales-in-2020/ - back in procfs_target::attach, after do_attach, we push the the_procfs_target on the inferior's target stack, although we never reach this because the segfault happens before. 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). --=20 You are receiving this mail because: You are on the CC list for the bug.=