Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc Only print fatal trap info if the resulting...



details:   https://anonhg.NetBSD.org/src/rev/45d00bb42142
branches:  trunk
changeset: 780660:45d00bb42142
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Aug 02 13:50:14 2012 +0000

description:
Only print fatal trap info if the resulting signal would be uncaught.
(this avoid the messages from libcrypto when it probes for capabilities).

diffstat:

 sys/arch/powerpc/booke/trap.c   |  12 +++++++++---
 sys/arch/powerpc/powerpc/trap.c |  24 ++++++++++++++++--------
 2 files changed, 25 insertions(+), 11 deletions(-)

diffs (116 lines):

diff -r 93084a2a322d -r 45d00bb42142 sys/arch/powerpc/booke/trap.c
--- a/sys/arch/powerpc/booke/trap.c     Thu Aug 02 12:43:41 2012 +0000
+++ b/sys/arch/powerpc/booke/trap.c     Thu Aug 02 13:50:14 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.20 2012/08/01 21:30:22 matt Exp $   */
+/*     $NetBSD: trap.c,v 1.21 2012/08/02 13:50:15 matt Exp $   */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.20 2012/08/01 21:30:22 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.21 2012/08/02 13:50:15 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -877,7 +877,13 @@
                        ksi.ksi_signo = SIGKILL;
                }
                if (rv != 0) {
-                       if (cpu_printfataltraps) {
+                       /*
+                        * Only print a fatal trap if the signal will be
+                        * uncaught.
+                        */
+                       if (cpu_printfataltraps
+                           && !sigismember(&p->p_sigctx.ps_sigcatch,
+                                   ksi.ksi_signo)) {
                                printf("%s: pid %d.%d (%s):"
                                    " %s exception in user mode\n",
                                    __func__, p->p_pid, l->l_lid, p->p_comm,
diff -r 93084a2a322d -r 45d00bb42142 sys/arch/powerpc/powerpc/trap.c
--- a/sys/arch/powerpc/powerpc/trap.c   Thu Aug 02 12:43:41 2012 +0000
+++ b/sys/arch/powerpc/powerpc/trap.c   Thu Aug 02 13:50:14 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.146 2012/02/19 21:06:25 rmind Exp $ */
+/*     $NetBSD: trap.c,v 1.147 2012/08/02 13:50:14 matt Exp $  */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.146 2012/02/19 21:06:25 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.147 2012/08/02 13:50:14 matt Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -245,7 +245,8 @@
                        break;
                }
                ci->ci_ev_udsi_fatal.ev_count++;
-               if (cpu_printfataltraps) {
+               if (cpu_printfataltraps
+                   && !sigismember(&p->p_sigctx.ps_sigcatch, SIGSEGV)) {
                        printf("trap: pid %d.%d (%s): user %s DSI trap @ %#lx "
                            "by %#lx (DSISR %#x, err=%d)\n",
                            p->p_pid, l->l_lid, p->p_comm,
@@ -306,7 +307,8 @@
                        break;
                }
                ci->ci_ev_isi_fatal.ev_count++;
-               if (cpu_printfataltraps) {
+               if (cpu_printfataltraps
+                   && !sigismember(&p->p_sigctx.ps_sigcatch, SIGSEGV)) {
                        printf("trap: pid %d.%d (%s): user ISI trap @ %#lx "
                            "(SRR1=%#lx)\n", p->p_pid, l->l_lid, p->p_comm,
                            tf->tf_srr0, tf->tf_srr1);
@@ -332,7 +334,8 @@
                ci->ci_ev_ali.ev_count++;
                if (fix_unaligned(l, tf) != 0) {
                        ci->ci_ev_ali_fatal.ev_count++;
-                       if (cpu_printfataltraps) {
+                       if (cpu_printfataltraps
+                           && !sigismember(&p->p_sigctx.ps_sigcatch, SIGBUS)) {
                                printf("trap: pid %d.%d (%s): user ALI trap @ "
                                    "%#lx by %#lx (DSISR %#x)\n",
                                    p->p_pid, l->l_lid, p->p_comm,
@@ -356,7 +359,8 @@
                vec_load();
                break;
 #else
-               if (cpu_printfataltraps) {
+               if (cpu_printfataltraps
+                   && !sigismember(&p->p_sigctx.ps_sigcatch, SIGILL)) {
                        printf("trap: pid %d.%d (%s): user VEC trap @ %#lx "
                            "(SRR1=%#lx)\n",
                            p->p_pid, l->l_lid, p->p_comm,
@@ -372,7 +376,8 @@
 #endif
        case EXC_MCHK|EXC_USER:
                ci->ci_ev_umchk.ev_count++;
-               if (cpu_printfataltraps) {
+               if (cpu_printfataltraps
+                   && !sigismember(&p->p_sigctx.ps_sigcatch, SIGBUS)) {
                        printf("trap: pid %d (%s): user MCHK trap @ %#lx "
                            "(SRR1=%#lx)\n",
                            p->p_pid, p->p_comm, tf->tf_srr0, tf->tf_srr1);
@@ -416,10 +421,13 @@
                                ksi.ksi_code = ILL_PRVOPC;
                        } else
                                ksi.ksi_code = ILL_ILLOPC;
-                       if (cpu_printfataltraps)
+                       if (cpu_printfataltraps
+                           && !sigismember(&p->p_sigctx.ps_sigcatch,
+                                   ksi.ksi_signo)) {
                                printf("trap: pid %d.%d (%s): user PGM trap @"
                                    " %#lx (SRR1=%#lx)\n", p->p_pid, l->l_lid,
                                    p->p_comm, tf->tf_srr0, tf->tf_srr1);
+                       }
                        (*p->p_emul->e_trapsignal)(l, &ksi);
                }
                break;



Home | Main Index | Thread Index | Old Index