From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 5234B38708CD for ; Thu, 14 May 2020 17:32:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5234B38708CD Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AA1F61E79B; Thu, 14 May 2020 13:32:58 -0400 (EDT) Subject: Re: [PATCH] [PR 25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text To: mlimber , gdb-patches@sourceware.org References: From: Simon Marchi Message-ID: <072e4b2b-4d71-b343-c8ef-0edbc6ab6804@simark.ca> Date: Thu, 14 May 2020 13:32:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, 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 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: Thu, 14 May 2020 17:33:09 -0000 On 2020-05-14 1:22 p.m., mlimber via Gdb-patches wrote: > I have replicated this bug in gdb versions 10.0.50.20200514-git and also > 8.2-0ubuntu1~14.04.1. I am using an executable that dynamically links an > shared object with no text segment, viz., libicudata.so.52.2. (FWIW, lldb-8 > does not crash with this same executable + library.) > > I located a patch by Jeremie Courreges-Anglas here: > https://marc.info/?l=openbsd-ports&m=146569238229407&w=2. I applied said > patch, rebuilt gdb, and now I can debug the same executable with gdb. > > I am not an expert on the inner workings of gdb, but I assume those who > review this code can better judge the overall soundness of this change. > > I did not create a new test, but I can try it if necessary. > > I have not previously completed an FSF copyright assignment. I have a > "request for disclaimer" email prepared to send if so directed by the gdb > maintainers. > > Cheers! > > M > Hi, Thanks for the patch. For reference, could you please provide some instructions on how to replicate this bug? How to compile a minimal test case and the GDB commands to trigger the bug. It should ideally be put in the commit message to act as a reference, and it will be useful to write a test. We'll want a test for sure, so if you want to start writing one it would be appreciated. I know that writing GDB test is not the most obvious thing to do when you are not familiar with it, so don't hesitate to ask for help. Simon