public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Avi Kivity <avi@scylladb.com>, systemtap@sourceware.org
Subject: Re: Systemtap kernel backtraces not working on 4.14.14
Date: Wed, 24 Jan 2018 19:04:00 -0000	[thread overview]
Message-ID: <b0448130-183f-4d19-1cb7-f7ed82081216@redhat.com> (raw)
In-Reply-To: <4e07a614-b734-8d91-b18d-d6313981c191@scylladb.com>

On 01/24/2018 09:48 AM, Avi Kivity wrote:
> Maybe systemtap can't cope with retpolines?

We know that GCC generates incorrect unwind data for retpolines:

   https://gcc.gnu.org/ml/gcc/2018-01/msg00160.html

But that report was derived from first principles, and not by observing 
a bug.

Now the odd thing here is that retpolines should not leave a trace on 
the call stack once they have transferred control to the actual target 
function.  The incorrect unwind information only shows up temporarily, 
prior to the jump.  So it doesn't explain why the backtrace ends at 
__schedule in your case.

However, the kernel might use a different retpoline thunk.  Can you 
capture a vmcore or something like that, to obtain the actual machine 
code after run-time patching?  And perhaps figure out the caller of 
__schedule and disassemble that as well?

There were some kernel fixes on master related to retpolines and 
instrumentation:

commit c86a32c09f8ced67971a2310e3b0dda4d1749007
Author: Masami Hiramatsu <mhiramat@kernel.org>
Date:   Fri Jan 19 01:15:20 2018 +0900

     kprobes/x86: Disable optimizing on the function jumps to indirect thunk

commit c1804a236894ecc942da7dc6c5abe209e56cba93
Author: Masami Hiramatsu <mhiramat@kernel.org>
Date:   Fri Jan 19 01:14:51 2018 +0900

     kprobes/x86: Blacklist indirect thunk functions for kprobes

commit 736e80a4213e9bbce40a7c050337047128b472ac
Author: Masami Hiramatsu <mhiramat@kernel.org>
Date:   Fri Jan 19 01:14:21 2018 +0900

     retpoline: Introduce start/end markers of indirect thunk

Thanks,
Florian

      parent reply	other threads:[~2018-01-24 19:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24  8:49 Avi Kivity
2018-01-24 19:01 ` Frank Ch. Eigler
2018-01-25  8:23   ` Avi Kivity
2018-01-24 19:04 ` Florian Weimer [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=b0448130-183f-4d19-1cb7-f7ed82081216@redhat.com \
    --to=fweimer@redhat.com \
    --cc=avi@scylladb.com \
    --cc=systemtap@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).