From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 00CF13851C25 for ; Wed, 20 May 2020 15:04:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 00CF13851C25 Received: by mail-lj1-x22d.google.com with SMTP id c11so1946127ljn.2 for ; Wed, 20 May 2020 08:04:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9fEhFy2/3iirp5OaWxhUM5kYcik8auzwxwqnl/+IvXQ=; b=Md4ZnUyhf1rSEaVroOmVKm27x72nh9DbTSOMnp+Oc4AEg84bSO392QTldzuzV8LU91 TeEDCe3K4dUJiPzG2IDXziBuDy7WSsCJtvCsSLd/nv1fRAv2fDAXLGS2yznwRik9wPi9 zIIgezqTQaWI2Aeil3X+TOiFI+z0Q/NJB2nEdKtWUpdpcqMl0pwJn4+U8Hg++25SNLIu lWSZR+qMHXFNzvXesnHMbRBJrtGEQaIJ9qOL1MGN7slRK2sBx8nz/H6IY+D4WIHtfN48 mzwD1aqXpMolB0C/ENaTWpUWgHAUAJh0aQPVBikQL0pTURY66k6WjiJJOt9G6+caUE5t G6Ig== X-Gm-Message-State: AOAM531Obs+F+m9A7TuL6qpz3DvOs8vk3lI03xn3hg1WVYUrvvVeKscK RKIdnpq/nYAQwy0UwAIVO9R0SEcabGrcuRJbnlD0iw== X-Google-Smtp-Source: ABdhPJw6UV03j5zPNafF6iOSZ6zgOw1Dk8ZDvaLgfGDFYttsaVSMk7y22mMwN5jCYDrLRPGLcq3mtWTHeb69cm2SiIA= X-Received: by 2002:a2e:991a:: with SMTP id v26mr845271lji.470.1589987066729; Wed, 20 May 2020 08:04:26 -0700 (PDT) MIME-Version: 1.0 References: <072e4b2b-4d71-b343-c8ef-0edbc6ab6804@simark.ca> <59eeb6ee-1ab2-e5aa-000a-2fb6d522b8d0@simark.ca> In-Reply-To: From: mlimber Date: Wed, 20 May 2020 11:04:15 -0400 Message-ID: Subject: Re: [PATCH] [PR 25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text To: Simon Marchi Cc: gdb-patches@sourceware.org X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 15:04:31 -0000 On Wed, May 20, 2020 at 10:12 AM Simon Marchi wrote: > On 2020-05-20 9:24 a.m., mlimber wrote: > > Will both bugs be fixed by a change in one place? That is, is my second > patch irrelevant because we'll ultimately fix both bugs at some higher > level? If the patch is still valid, I could work to submit an updated patch > and test case for my non-DWARF bug now, and then you (or you and I) can > work up a test case and fix -- possibly under a new bug ticket -- for the > DWARF bug. > > There are two paths forward I see: > > (1) make sure sect_index_text is always initialized, even if there's no > .text section > (2) make GDB aware that sect_index_text could be left to -1 > > If we chose (1), then the fixes in your patches wouldn't be needed, as > sect_index_text will > never be -1. > > If we chose (2), then we should get rid of the code that invents a > sect_index_text value > when there's no .text section. The fixes in your patches would be needed > (or something > equivalent), but there would be many other similar fixes needed. > > I posted this RFC patch that summarizes the problem and starts to > implement (2): > > https://sourceware.org/pipermail/gdb-patches/2020-May/168767.html > Thanks for digging into this! I took a look. I'm still willing to assist if needed, but you've gone beyond my knowledge of GDB and ELF internals, so I'm not sure if I can be very useful to you. Let me know if there is something further I can do. M PS, I'm surprised mailing list patches are still a thing in the age of Github!