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 E6A0E3857C50 for ; Thu, 20 Aug 2020 22:20:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E6A0E3857C50 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.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8B0441E009; Thu, 20 Aug 2020 18:20:11 -0400 (EDT) Subject: Re: [PATCH 1/4] Add sniffer for Cygwin x86_64 core dumps To: Jon Turney , gdb-patches@sourceware.org References: <20200812191816.23246-1-jon.turney@dronecode.org.uk> <20200812191816.23246-2-jon.turney@dronecode.org.uk> From: Simon Marchi Message-ID: Date: Thu, 20 Aug 2020 18:20:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200812191816.23246-2-jon.turney@dronecode.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, 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, 20 Aug 2020 22:20:13 -0000 On 2020-08-12 3:18 p.m., Jon Turney wrote: > Similarly to existing i386_cygwin_core_osabi_sniffer() > > gdb/ChangeLog: > > 2020-07-01 Jon Turney > > * amd64-windows-tdep.c (amd64_cygwin_core_osabi_sniffer): New. > (_initialize_amd64_windows_tdep): Register amd64_cygwin_core_osabi_sniffer. Hi Jon, I am trying to test this using these steps: 1. Write a dummy C program that just sleeps in Cygwin, compile it (gcc test.c -g3 -O0) and run it 2. Run "dumper" on it 3. Load it in GDB (back on my amd64 Linux host) I get this in step 3: $ ./gdb --data-directory=data-directory -nx -q ~/a.exe Reading symbols from /home/simark/a.exe... (gdb) core ~/core.core BFD: BFD (GNU Binutils) 2.35.50.20200820 internal error, aborting at /home/simark/src/binutils-gdb/bfd/bfd.c:1311 in _bfd_doprnt_scan BFD: Please report this bug. This happens while BFD encounters an error and tries to print this format string: "%pB: win32pstatus NOTE_INFO_MODULE of size %lu is too small to contain a name of size %zu" _bfd_doprnt_scan aborts because it doesn't like the z length modifier: (top-gdb) p ptr[-1] $2 = 122 'z' So there are two issues here: 1. The actual error, the note being too small for the name. If I go up in elfcore_grok_win32pstatus, the name_size doesn't make sense: (top-gdb) p name_size $9 = 4194304 whereas the note size makes sense: (top-gdb) p note->descsz $10 = 1276 2. The internal error from trying to print that error message I realize this probably isn't caused by your patch at all but... I thought you'd like to know about it anyway. I can provide more info for either if needed. Simon