linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: fault.c: fix unhandled page fault message
@ 2015-07-15 15:30 Levente Kurusa
  2015-07-15 19:08 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Levente Kurusa @ 2015-07-15 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

Even if the signal was handled using signal(2) the message
would be printed. Fix that by checking whether the signal
is handled.

Signed-off-by: Levente Kurusa <lkurusa@redhat.com>
---
 arch/arm/mm/fault.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index 0d629b8..bbf5d73 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -164,8 +164,9 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
 	struct siginfo si;
 
 #ifdef CONFIG_DEBUG_USER
-	if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
-	    ((user_debug & UDBG_BUS)  && (sig == SIGBUS))) {
+	if ((((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
+	     ((user_debug & UDBG_BUS)  && (sig == SIGBUS))) &&
+	     unhandled_signal(tsk, sig)) {
 		printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
 		       tsk->comm, sig, addr, fsr);
 		show_pte(tsk->mm, addr);
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] arm: fault.c: fix unhandled page fault message
  2015-07-15 15:30 [PATCH] arm: fault.c: fix unhandled page fault message Levente Kurusa
@ 2015-07-15 19:08 ` Russell King - ARM Linux
  2015-07-16  7:45   ` Levente Kurusa
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2015-07-15 19:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 15, 2015 at 05:30:50PM +0200, Levente Kurusa wrote:
> Even if the signal was handled using signal(2) the message
> would be printed. Fix that by checking whether the signal
> is handled.

Why?

Even if the application handles the signal, the point of this debugging is
to have the kernel report the reason for the fault.

Just because the application has installed a SIGSEGV handler to print some
nice "oops" message, and to cleanly shut down (eg, like Xorg) doesn't mean
we should hide this debugging.  In fact, as such handlers generally get in
the way of getting a decent dump from the application, having the kernel
report this information is even more valuable in this situation.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm: fault.c: fix unhandled page fault message
  2015-07-15 19:08 ` Russell King - ARM Linux
@ 2015-07-16  7:45   ` Levente Kurusa
  0 siblings, 0 replies; 3+ messages in thread
From: Levente Kurusa @ 2015-07-16  7:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

----- Original Message -----
> On Wed, Jul 15, 2015 at 05:30:50PM +0200, Levente Kurusa wrote:
> > Even if the signal was handled using signal(2) the message
> > would be printed. Fix that by checking whether the signal
> > is handled.
> 
> Why?

One of the reasons is that arm64 prints the same message only when the signal
is unhandled.

The other is the message saying "unhandled". :-)

But, don't get me wrong, I found the 'problem' by having a quick glimpse at the code
(even though I have a testcase now...), so if you think this is right this way,
then so be it.

> 
> Even if the application handles the signal, the point of this debugging is
> to have the kernel report the reason for the fault.
> 
> Just because the application has installed a SIGSEGV handler to print some
> nice "oops" message, and to cleanly shut down (eg, like Xorg) doesn't mean
> we should hide this debugging.  In fact, as such handlers generally get in
> the way of getting a decent dump from the application, having the kernel
> report this information is even more valuable in this situation.

I agree, but I find this being controlled by a kernel config option _and_ a
parameter makes it harder to use. Maybe we could switch to the sysctl,
"debug.exception-trace" like some other architectures do? What do you think?

Thanks,
    Levente

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-16  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-15 15:30 [PATCH] arm: fault.c: fix unhandled page fault message Levente Kurusa
2015-07-15 19:08 ` Russell King - ARM Linux
2015-07-16  7:45   ` Levente Kurusa

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).