public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] arm64: mm: print file name of faulting vma
Date: Fri, 9 Jun 2017 16:54:55 +0100	[thread overview]
Message-ID: <20170609155455.GJ10665@leverpostej> (raw)
In-Reply-To: <1497022554-1451-3-git-send-email-kristina.martsenko@arm.com>

On Fri, Jun 09, 2017 at 04:35:54PM +0100, Kristina Martsenko wrote:
> Print out the name of the file associated with the vma that faulted.
> This is usually the executable or shared library name. We already print
> out the task name, but also printing the library name is useful for
> pinpointing bugs to libraries.
> 
> Also print the base address and size of the vma, which together with the
> PC (printed by __show_regs) gives the offset into the library.
> 
> Fault prints now look like:
> test[2361]: unhandled level 2 translation fault (11) at 0x00000012, esr 0x92000006, in libfoo.so[ffffa0145000+1000]
> 
> This is already done on x86, for more details see commit 03252919b798
> ("x86: print which shared library/executable faulted in segfault etc.
> messages v3").
> 
> Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>

FWIW:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
> 
> v2:
>  - add this patch
> 
>  arch/arm64/mm/fault.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index b070dcd50ed0..6a2a5dd7cf36 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -256,9 +256,11 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr,
>  
>  	if (unhandled_signal(tsk, sig) && show_unhandled_signals_ratelimited()) {
>  		inf = esr_to_fault_info(esr);
> -		pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n",
> +		pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x",
>  			tsk->comm, task_pid_nr(tsk), inf->name, sig,
>  			addr, esr);
> +		print_vma_addr(KERN_CONT ", in ", regs->pc);
> +		pr_cont("\n");
>  		__show_regs(regs);
>  	}
>  
> -- 
> 2.1.4
> 

  reply	other threads:[~2017-06-09 15:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 15:35 [PATCH v2 1/3] arm64: mm: print out correct page table entries Kristina Martsenko
2017-06-09 15:35 ` [PATCH v2 2/3] arm64: mm: don't print out page table entries on EL0 faults Kristina Martsenko
2017-06-09 15:50   ` Mark Rutland
2017-06-09 15:35 ` [PATCH v2 3/3] arm64: mm: print file name of faulting vma Kristina Martsenko
2017-06-09 15:54   ` Mark Rutland [this message]
2017-06-09 16:04 ` [PATCH v2 1/3] arm64: mm: print out correct page table entries Mark Rutland
2017-06-09 16:33   ` Will Deacon
2017-06-09 16:41     ` Mark Rutland
2017-06-09 20:22 ` Yury Norov
2017-06-15 10:00   ` Will Deacon
2017-06-15 10:12     ` Yury Norov
2017-06-15 10:16       ` Will Deacon

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=20170609155455.GJ10665@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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