From d638c6316f2021e055ef3b139f99aa5989c122d0 Mon Sep 17 00:00:00 2001 From: Hans Rosenfeld Date: Thu, 12 Jul 2018 13:01:22 +0000 Subject: OS-7053 dump_ttrace() chokes on softints Reviewed by: Jerry Jelinek Reviewed by: Patrick Mooney Approved by: Patrick Mooney --- usr/src/uts/i86pc/io/apix/apix.c | 2 +- usr/src/uts/i86pc/os/trap.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/usr/src/uts/i86pc/io/apix/apix.c b/usr/src/uts/i86pc/io/apix/apix.c index a5a4823a91..33ade10c44 100644 --- a/usr/src/uts/i86pc/io/apix/apix.c +++ b/usr/src/uts/i86pc/io/apix/apix.c @@ -356,7 +356,7 @@ apix_get_intr_handler(int cpu, short vec) apix_vector_t *apix_vector; ASSERT(cpu < apic_nproc && vec < APIX_NVECTOR); - if (cpu >= apic_nproc) + if (cpu >= apic_nproc || vec >= APIX_NVECTOR) return (NULL); apix_vector = apixs[cpu]->x_vectbl[vec]; diff --git a/usr/src/uts/i86pc/os/trap.c b/usr/src/uts/i86pc/os/trap.c index cbb7026067..0da153355e 100644 --- a/usr/src/uts/i86pc/os/trap.c +++ b/usr/src/uts/i86pc/os/trap.c @@ -2080,6 +2080,7 @@ dump_ttrace(void) #endif /* Define format for the TYPE and VC fields */ const char fmt2[] = "%4s %3x"; + const char fmt2s[] = "%4s %3s"; char data2[9]; /* length of string formatted by fmt2 + 1 */ /* * Define format for the HANDLER field. Width is arbitrary, but should @@ -2169,6 +2170,14 @@ dump_ttrace(void) break; case TT_INTERRUPT: + if (rec->ttr_regs.r_trapno == T_SOFTINT) { + (void) snprintf(data2, sizeof (data2), + fmt2s, "intr", "-"); + (void) snprintf(data3, sizeof (data3), + fmt3s, "(fakesoftint)"); + break; + } + (void) snprintf(data2, sizeof (data2), fmt2, "intr", rec->ttr_vector); if (get_intr_handler != NULL) -- cgit v1.2.3