From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Marc Khouzam <marc.khouzam@ericsson.com>
Subject: Re: Displaced stepping not always working as expected
Date: Wed, 21 Sep 2011 10:20:00 -0000 [thread overview]
Message-ID: <201109211120.26531.pedro@codesourcery.com> (raw)
In-Reply-To: <F7CE05678329534C957159168FA70DEC578744DE43@EUSAACMS0703.eamcs.ericsson.se>
On Tuesday 20 September 2011 20:54:24, Marc Khouzam wrote:
> Hi,
>
> I just need a hint on where next to look...
> I've been asked to look into problems with non-stop on
> a user-mode-linux virtual machine
> (http://user-mode-linux.sourceforge.net/)
So does this only happen with UML? UML uses ptrace internally for
its own business, I wouldn't be surprised if there's something
wonky going on at that level.
> On that AMD 64bit machine, I cannot step or resume past a breakpoint
> when using non-stop with a multi-threaded program _if_ any of the
> threads is still running. If I interrupt all threads, then displaced
> stepping works.
I wouldn't be surprised if the UM kernel is reporting a spurious
SIGTRAP to gdb. Try "set debug lin-lwp 1" as well, but I don't
think it'll tell you much. Maybe peeking at eflags or the siginfo
of that SIGTRAP reveals something.
> During the failure case, I confirmed that the displaced
> instruction does _not_ get executed (the memory it should have
> changed stays the same). So, the PC stays in the same place
> and the step does not move forward.
>
> I tried to turn on 'set debug infrun 1', but I get the exact same
> logs during the failure as during a success case.
>
> Sometimes, if I keep trying to step, it will finally work (could be
> after 3 attempts, could be after 100 attempts or more). It seems
> related to what the other running thread is doing at the time.
>
> Can someone let me know where in GDB I can look to see why a displaced
> instruction is not being executed? Or maybe other debug logs to enable?
Try "set debug lin-lwp 1", and see if the resume was preempted and
for some bizarre reason the core is getting a cached wait status
instead of really resuming the thread.
Otherwise, this smells like a UML problem.
--
Pedro Alves
next prev parent reply other threads:[~2011-09-21 10:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-20 19:54 Marc Khouzam
2011-09-21 6:09 ` Yao Qi
2011-09-21 10:23 ` Pedro Alves
2011-09-21 15:39 ` Yao Qi
2011-09-21 15:44 ` Pedro Alves
2011-09-21 10:20 ` Pedro Alves [this message]
2011-09-21 20:46 ` Marc Khouzam
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=201109211120.26531.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=marc.khouzam@ericsson.com \
/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