qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Richard Henderson" <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PATCH] linux-user/elfload: Fix pr_pid values in core files
Date: Fri, 02 Aug 2024 15:23:29 +0200	[thread overview]
Message-ID: <c1ce916ad55ea8f6260fbc3beaea340dce4ca0bb.camel@linux.ibm.com> (raw)
In-Reply-To: <a218c0ba-3527-4e31-b8a7-e34b6f2bad1f@linaro.org>

On Fri, 2024-08-02 at 15:20 +0200, Philippe Mathieu-Daudé wrote:
> On 1/8/24 22:23, Ilya Leoshkevich wrote:
> > Analyzing qemu-produced core dumps of multi-threaded apps runs
> > into:
> > 
> >      (gdb) info threads
> >        [...]
> >        21   Thread 0x3ff83cc0740 (LWP 9295) warning: Couldn't find
> > general-purpose registers in core file.
> >      <unavailable> in ?? ()
> > 
> > The reason is that all pr_pid values are the same, because the same
> > TaskState is used for all CPUs when generating NT_PRSTATUS notes.
> > 
> > Fix by using TaskStates associated with individual CPUs.
> > 
> > Cc: qemu-stable@nongnu.org
> > Fixes: 243c47066253 ("linux-user/elfload: Write corefile elf header
> > in one block")
> 
> Isn't it
> 
> Fixes: edf8e2af14 ("linux-user: implemented ELF coredump")
> 
> ?

I haven't tested it, but this looks correct:

static void fill_thread_info(struct elf_note_info *info, const CPUState
*env)
{
    TaskState *ts = (TaskState *)env->opaque;

> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> >   linux-user/elfload.c | 8 +++-----
> >   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 



      reply	other threads:[~2024-08-02 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 20:23 [PATCH] linux-user/elfload: Fix pr_pid values in core files Ilya Leoshkevich
2024-08-01 21:45 ` Richard Henderson
2024-08-02 13:20 ` Philippe Mathieu-Daudé
2024-08-02 13:23   ` Ilya Leoshkevich [this message]

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=c1ce916ad55ea8f6260fbc3beaea340dce4ca0bb.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=laurent@vivier.eu \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).