From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 40AE71F4B4 for ; Wed, 16 Sep 2020 16:18:59 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B9D03857819; Wed, 16 Sep 2020 16:18:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B9D03857819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1600273137; bh=/R/4XIw5lfmvOQ3o5nmrAepIzfIDGhsrXRpU3RI6qnY=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=E864jDrF3N071/7e2tr35aQOZcnbO99dl3eT1E9vOtGFqi/+ousW1Rwn6LWhpkgIN GecKgnpk31xJIF/1/PRdR6nUCdmLHXKIGw9BbEGRX9EdyfGoKZsPDA82nWgW+QL5By P7n72e9cI+heBsmNtqHhpvm37f7W5BR+mrS82Ifg= Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) by sourceware.org (Postfix) with ESMTPS id 8F3D23857C74 for ; Wed, 16 Sep 2020 16:18:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F3D23857C74 IronPort-PHdr: =?us-ascii?q?9a23=3Ah5M/uhfulMOA+Vik85rloxpVlGMj4e+mNxMJ6p?= =?us-ascii?q?chl7NFe7ii+JKnJkHE+PFxlwaQA9fB5v5EgvaQuKflCiQM4peE5XYFdpEEFx?= =?us-ascii?q?oIkt4fkAFoBsmZQVb6I/jnY21ffoxCWVZp8mv9PR1TH8DzNEffrn278XgZHR?= =?us-ascii?q?CsfQZwL/7+T4jVicn/3uuu+prVNgNPgjf1Yb57IBis6wvLscxDiop5IaF3wR?= =?us-ascii?q?zM8XY=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BLAADrOWJf/4QNJK1fHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQFAgTsHAQELAYFRUQeBSS8sCod1A4RZiRePWhaJA4EuFIERA1U?= =?us-ascii?q?LAQEBDQEBLQIEAQGESwKCIgIkNAkOAgMBAQsBAQUBAQECAQYEbYVcDIVyAQE?= =?us-ascii?q?BAQIBEigGAQE3AQQLAgEIGB4QFB4nBA4ZDoVQAw4gAapDAoE5iGF0gTSDAQE?= =?us-ascii?q?BBYUTGIIQCRSBJAGCcIo7G4FBP4NsNT6EAD2Fd5JupDAKgmWaNTAPgnqJeJN?= =?us-ascii?q?4smACBAIEBQIOAQEFgVQ6gVdwFTuCaVAXAg2OH4NxilZ0NwIGCgEBAwl8jFI?= =?us-ascii?q?BgRABAQ?= X-IronPort-AV: E=Sophos;i="5.76,433,1592870400"; d="scan'208";a="816464833" Received: from alln-core-10.cisco.com ([173.36.13.132]) by rcdn-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 16 Sep 2020 16:18:50 +0000 Received: from XCH-RCD-005.cisco.com (xch-rcd-005.cisco.com [173.37.102.15]) by alln-core-10.cisco.com (8.15.2/8.15.2) with ESMTPS id 08GGIXrL007133 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 16 Sep 2020 16:18:50 GMT Received: from xhs-rcd-003.cisco.com (173.37.227.248) by XCH-RCD-005.cisco.com (173.37.102.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Sep 2020 11:18:40 -0500 Received: from xhs-rcd-002.cisco.com (173.37.227.247) by xhs-rcd-003.cisco.com (173.37.227.248) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Sep 2020 11:18:39 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (72.163.14.9) by xhs-rcd-002.cisco.com (173.37.227.247) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 16 Sep 2020 11:18:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dz3FqXfn8D0Yp6Y/EHKPmniicT0rp9i2YYZF5w36tQGCxOef6Vq9/mkteY/qXXZ6DajjMF+4QH6UawGModwjNgB2qsC6qu1Ej6kGqQYwVvNPqV3RzI7AeK4rAdVAGGYYk77UdFz0VM6ZBOhFM+5qHBEiEpD/PslsJam/9w81UumFd3wEzS+h51GjhntHwl5env1kIOphS2QTHVOFs3r4ddj1oLm9NMVm/pGYoGd9b/RAG7L5otwgqD+5K3EIQwes5NZFet7mVi69QRf5fuVeEhBJwWe+jS6SIWLqiEeg4087O6cblr10ecBGL/UhE/LVY+fIQ9TKdg3Fw+019/hlzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/R/4XIw5lfmvOQ3o5nmrAepIzfIDGhsrXRpU3RI6qnY=; b=O7qQojlqJXFw0F+Uofm+eyi3tQvMkRyO/M1ZnD3vLCood7+vqLmGOy8AZOLxvPsuNWkRpvgozzBZYG7TyzX2g+S+nlo5kRUjo3OWFb3BU0de0vymaFMMPtyR7MwlkMjnSO3m8pzw/u+yV5obulHJaVpMhLILZd5v9QTAJYS5iEv5lPBefRKdbTfpyfNU9WrOmV9cLQGLuJHpzf5vuFBPmT3vMHOgnwPMuUsjZPSe95HuLO9Hbmlbfyl4GLVejj+iufXer7Lj35SKZB/KOY/u+ZNtlHiOhdUZyjFgmInA+Yk+fs/B8jYctcqCIHofkD0ND1UfZ8emF+I6vm28VsitAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none Received: from BYAPR11MB3205.namprd11.prod.outlook.com (2603:10b6:a03:1e::32) by BYAPR11MB3207.namprd11.prod.outlook.com (2603:10b6:a03:7c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 16:18:37 +0000 Received: from BYAPR11MB3205.namprd11.prod.outlook.com ([fe80::4c19:cf97:4c5c:384f]) by BYAPR11MB3205.namprd11.prod.outlook.com ([fe80::4c19:cf97:4c5c:384f%7]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 16:18:37 +0000 To: "Carlos O'Donell" Subject: Re: [RFC PATCH 0/3] implement dlmopen hooks for gdb Thread-Topic: [RFC PATCH 0/3] implement dlmopen hooks for gdb Thread-Index: AQHWjEUItgsuWR/AnUqLWHBJ6LeSng== Date: Wed, 16 Sep 2020 16:18:37 +0000 Message-ID: <20200916161836.GW7261@zorba> References: <20200626193228.1953-1-danielwa@cisco.com> <0f791d3a-20bc-4524-54eb-ce6df108fbff@redhat.com> <20200723184054.GD9875@zorba> <3ff42e45-b394-bf50-38c4-93baecc71497@redhat.com> In-Reply-To: <3ff42e45-b394-bf50-38c4-93baecc71497@redhat.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: DR, OOF, AutoReply X-MS-TNEF-Correlator: user-agent: Mutt/1.9.4 (2018-02-28) x-originating-ip: [128.107.241.161] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fd4a0f73-d131-4613-4ef2-08d85a5c2aa6 x-ms-traffictypediagnostic: BYAPR11MB3207: x-ld-processed: 5ae1af62-9505-4097-a69a-c1553ef7840e,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OcIyWklewWO1O5tIaVGPSnQV0qf09tbw628A91DwyIFVjJ9b1ybksA1YI/jw6AT59EFe+KyE4wf0yde/LJr8IuEZBcMNMc6+3j/4oDclPdUnOPJKU1iklMVSWpRQ5sSrTML6OlYaaoP119+9QvvrUF56ttPiQuz++34ODCj4xftZORqDx2ex7EcAxDew8PWC9wsBkXFMqfawxzk3vEK/z8PBdb8V0cNZALYv/P1dZQOdqcvuq5KP8qqnAJCLF3o+B97LGFokdUeMXRqduNM9FxwpkL/iUemGt2CHmnZPi4ofPx1YaacW3uMwFoivs1kLkemHh+apmcBDJpDBPdEBag== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3205.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(7916004)(396003)(376002)(39860400002)(366004)(136003)(346002)(316002)(478600001)(6486002)(1076003)(71200400001)(9686003)(76116006)(66556008)(6512007)(54906003)(64756008)(2906002)(66476007)(66446008)(5660300002)(86362001)(66946007)(33716001)(6506007)(53546011)(8676002)(26005)(8936002)(33656002)(186003)(107886003)(4326008)(83380400001)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 0kYGk9pA0e0SkUR45KYTZKSh2XjrY1QN/tskUNj/2IWRRObjNTTmKnmjHzXv/UG/2mV4d9LB+yoC974e3s5tuF2clCU6/3Ki8meI2ZqitGXic7yutK5jxz2uBtjQg1TGZ/TDkSeP7nIe4nS4tnpbMbOh0YDdp7rssbmQwkvkrsxZ1/qXyPPYZiOR/Lr5pVEJWPah5aTTf9hH2BEDMEW4/xdk8Vx5ceaASxGswiJonW6H3uNHR5Hff/vnHvsE9TrcSTVm06fArjqRvgLA/s8U9MBlCx0MxDtyxoFDZGxjPCSJI82G7AgCV4oNZPmHk6y7Zg3df3Y0WIzvzpBKLJgwO8Ahc//5bT606kjBQhB/QC25MiEPQhTFneI1GYNDARsLAy8boPnz/2WmEGPXNItqKGPDO3RKTlb0qrnRcVX6wzHhvmHV2tCiVPDfmqGMpGzs5QL3yK2ufQYNDX5XT6Ts+d3JA+ZTKySsmIzRCG2PdNGaiF1dp0eXVNjFOT/m2KwyrgpUBi3h9zF3ZTZtXFCOCEctfhY5ZWy4oZdLTkwe6IzS473brZ2bqNE2mJxszKVR8e95YzsY55WZOOxHC6qyrj0YSIOv6Q40GnVE2FQM2RdSdlzj4anwJoUiyOigAkXGbaW5ogzL8AKaSnSRi6fLUw== Content-Type: text/plain; charset="us-ascii" Content-ID: <85D7C465EEA3D546BA65814219BDC963@namprd11.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3205.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd4a0f73-d131-4613-4ef2-08d85a5c2aa6 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2020 16:18:37.0359 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UZh4+BikUgLIjNKihKTEVUQAV6nMuNeqAMAQOJNy42yRssNf3aK/G+krQ2WQ29Jt2BjwkiI0R+ZnC6belaLAZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3207 X-OriginatorOrg: cisco.com X-Outbound-SMTP-Client: 173.37.102.15, xch-rcd-005.cisco.com X-Outbound-Node: alln-core-10.cisco.com X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "Daniel Walker \(danielwa\) via Libc-alpha" Reply-To: "Daniel Walker \(danielwa\)" Cc: Florian Weimer , Pedro Alves , "libc-alpha@sourceware.org" , "Jeremy Stenglein \(jstengle\)" , "xe-linux-external\(mailer list\)" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Thu, Jul 23, 2020 at 05:20:23PM -0400, Carlos O'Donell wrote: > On 7/23/20 2:40 PM, Daniel Walker (danielwa) wrote: > > On Fri, Jun 26, 2020 at 05:17:17PM -0400, Carlos O'Donell wrote: > >> On 6/26/20 3:32 PM, Daniel Walker via Libc-alpha wrote: > >>> Cisco System, Inc. has a need to have dlmopen support in gdb, which > >>> required glibc changes. I think it was known when glibc implemented > >>> dlmopen that gdb would not work with it. > >>> > >>> Since 2015 Cisco has had these patches in our inventor to fix issues = in > >>> glibc which prevented this type of gdb usage. > >>> > >>> This RFC is mainly to get guidance on this implementation. We have so= me > >>> individuals who have signed the copyright assignment for glibc, and w= e > >>> will submit these (or different patches) formally thru those channels= if > >>> no one has issues with the implementation. > >>> > >>> Also included in this are a couple of fixes which went along with the > >>> original implementation. > >>> > >>> Please provide any comments you might have. > >>> > >>> Conan C Huang (3): > >>> Segfault when dlopen with RTLD_GLOBAL in dlmopened library > >>> glibc: dlopen RTLD_NOLOAD optimization > >>> add r_debug multiple namespaces support > >>> > >>> elf/dl-close.c | 7 ++++++- > >>> elf/dl-debug.c | 13 ++++++++++--- > >>> elf/dl-open.c | 8 +++++++- > >>> elf/link.h | 4 ++++ > >>> 4 files changed, 27 insertions(+), 5 deletions(-) > >>> > >> > >> Thanks for looking at this. It is something the community would > >> absolutely like to see. I'll comment quickly to provide direction. > >> > >> Florian Weimer, Pedro Alves, and I were talking about this as > >> recently as April where we tried to agree to just adding a > >> _r_debug_dlmopen with a new ABI for the debugger to use. > >> > >=20 > >=20 > > Here's another RFC I suppose. It's basic code I've only compile tested.= It's > > based on the comments, and the threads you provided. It just abstracts = out the > > next link into another structure. Let me know if this is in the ballpar= k of the > > discussions. >=20 > I only looked over this briefly, but I think it's on the right track. >=20 > The point is to use *another* data symbol for the debugger to use to acce= ss > the link maps. Then the debugger can look for that and try to use that to > access a list of maps. >=20 > Your next step would be to export the symbol via Versions at the current > symbol node GLIBC_2.32 (soon to be GLIBC_2.33). >=20 > The harder part will be the debugger changes because you have to look for > _r_debug_dlmopen in preference to _r_debug, and they are different layout= s, > and once you find _r_debug_dlmopen you have to be able to maintain the > lookup scope of the namespace you're in within the debugger. >=20 The second structure seems to work except making it available to GDB. I wou= ld guess there are suggestions for this from you or this list. A couple ideas, 1) GDB does pointer arithmetic off the r_debug DT_DEBUG value to find the r_debug_dlmopen structure. Add a linker script into glibc to force the two structures arrangement in memory, or use a section tag. 2) Add another dynamic linker entry to go along with DT_DEBUG like DT_DEBUG_DLMOPEN. Any other ideas for this ? Thanks, Daniel=