Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Jon Turney <jon.turney@dronecode.org.uk>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/4] Add sniffer for Cygwin x86_64 core dumps
Date: Thu, 20 Aug 2020 18:20:11 -0400	[thread overview]
Message-ID: <e3286e62-7ee8-01a1-2fc3-dd3e28fcbf57@simark.ca> (raw)
In-Reply-To: <20200812191816.23246-2-jon.turney@dronecode.org.uk>

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  <jon.turney@dronecode.org.uk>
> 
> 	* 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


  reply	other threads:[~2020-08-20 22:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 19:18 [PATCH 0/4] Add gdb support for Cygwin x86_64 core dumps (v2) Jon Turney
2020-08-12 19:18 ` [PATCH 1/4] Add sniffer for Cygwin x86_64 core dumps Jon Turney
2020-08-20 22:20   ` Simon Marchi [this message]
2020-08-21 15:25     ` Jon Turney
2020-08-21 16:22       ` Simon Marchi
2020-08-21 16:28         ` Jon Turney
2020-08-22 19:41           ` Simon Marchi
2020-08-22 19:52             ` Jon Turney
2020-08-24 15:47               ` Simon Marchi
2020-08-24 17:02                 ` Jon Turney
2020-08-12 19:18 ` [PATCH 2/4] Add amd64_windows_gregset_reg_offset Jon Turney
2020-08-20 22:08   ` Simon Marchi
2020-09-18 16:31     ` Jon Turney
2020-08-12 19:18 ` [PATCH 3/4] Promote windows_core_xfer_shared_libraries and windows_core_pid_to_str Jon Turney
2020-08-12 19:18 ` [PATCH 4/4] Add handling for 64-bit module addresses in Cygwin core dumps Jon Turney
2020-08-24 18:34   ` Simon Marchi
2020-09-15 21:44     ` Jon Turney
2020-09-16  2:20       ` Simon Marchi
2020-09-16  9:15         ` Christian Biesinger
2020-08-12 19:30 ` [PATCH 0/4] Add gdb support for Cygwin x86_64 core dumps (v2) Eli Zaretskii
2020-08-13 14:43   ` Jon Turney
2020-08-13 16:48     ` Eli Zaretskii
2020-08-18 15:32       ` Jon Turney
2020-08-18 16:15         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3286e62-7ee8-01a1-2fc3-dd3e28fcbf57@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=jon.turney@dronecode.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox