Port-evbmips archive

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

Re: ERLITE frozen in rc script after switching to GCC 5.4



On 2016/11/09 17:37, Nick Hudson wrote:
Starting sshd.
pid 240(sleep): trap: cpu0, TLB miss (load or instr. fetch) in kernel mode
status=0x50200083, cause=0x8, epc=0xffffffff802342a4, vaddr=0x132

TS=1 in status here (bit 21)

Maybe 'mach tlb' will show something

On 2016/11/09 17:25, Nick Hudson wrote:
There are two traps here I think
Starting sshd.
pid 240(sleep): trap: cpu0, TLB miss (load or instr. fetch) in kernel mode
status=0x50200083, cause=0x8, epc=0xffffffff802342a4, vaddr=0x132
tf=0x980000041097bb70 ksp=0x980000041097bcb0 ra=0xffffffff80234280 ppl=0

Can you addr2line on 0xffffffff802342a4 and 0xffffffff80234280?

x/i 0xffffffff802342a4  and a dump of the trapframe would be helpful.


kernel: TLB miss (load or instr. fetch) trap
Stopped in pid 240.1 (sleep) at netbsd:trap+0x664:      lw a6,304(s7)
db> ps

Probably worth doing addr2line on this as well, but it looks like it it's here:

https://nxr.netbsd.org/xref/src/sys/arch/mips/mips/trap.c#213

    213             n = snprintf(str, sz, "tf=%p ksp=%p ra=%#"
    214                 PRIxREGISTER " ppl=%#x\n", tf,
    215                 type == T_NMI
    216                 ? (void*)(uintptr_t)tf->tf_regs[_R_SP]
    217                 : tf+1,

which suggests that tf is 0.

These days, I've struggled to reproduce this panic, but strangely
enough, I cannot anymore. Checking out the source on Nov. 7th does
not help, too; the random freezes take place again without panic
messages.

I don't have the core dump because the kernel was too damaged to dump
it. To make the situation worse, I've removed the kernel (and its
debugging symbols) in accident. I'm so sorry for this.

Inspired to mlelstv@'s commit to compat/netbsd32, I examined and
found wrong type and casting. Some are harmless, but there is a bug
which occurs the y2038 problem. I wonder whether the random freezes
take place due to this kinds of errors in COMPAT_NETBSD32 codes.

Thanks,
Rin
====
--- src/sys/compat/netbsd32/netbsd32.h.orig	2016-11-13 07:02:41.537973489 +0900
+++ src/sys/compat/netbsd32/netbsd32.h	2016-11-13 09:17:23.192461025 +0900
@@ -210,7 +210,7 @@
 typedef netbsd32_pointer_t netbsd32_timevalp_t;
 struct netbsd32_timeval {
 	netbsd32_time_t	tv_sec;		/* seconds */
-	netbsd32_long	tv_usec;	/* and microseconds */
+	suseconds_t	tv_usec;	/* and microseconds */
 };
typedef netbsd32_pointer_t netbsd32_timezonep_t;
--- src/sys/compat/netbsd32/netbsd32_conv.h.orig	2016-11-13 07:02:48.479548407 +0900
+++ src/sys/compat/netbsd32/netbsd32_conv.h	2016-11-13 13:56:31.701511685 +0900
@@ -63,7 +63,7 @@
     struct netbsd32_timeval50 *tv32)
 {
- tv32->tv_sec = (netbsd32_long)tv->tv_sec;
+	tv32->tv_sec = (netbsd32_time50_t)tv->tv_sec;
 	tv32->tv_usec = (netbsd32_long)tv->tv_usec;
 }
@@ -72,8 +72,8 @@
     struct netbsd32_timeval *tv32)
 {
- tv32->tv_sec = (time_t)tv->tv_sec;
-	tv32->tv_usec = (suseconds_t)tv->tv_usec;
+	tv32->tv_sec = (netbsd32_time_t)tv->tv_sec;
+	tv32->tv_usec = tv->tv_usec;
 }
static __inline void
@@ -82,7 +82,7 @@
 {
tv->tv_sec = (time_t)tv32->tv_sec;
-	tv->tv_usec = (suseconds_t)tv32->tv_usec;
+	tv->tv_usec = tv32->tv_usec;
 }
static __inline void
@@ -91,7 +91,7 @@
 {
tv->tv_sec = (time_t)tv32->tv_sec;
-	tv->tv_usec = (suseconds_t)tv32->tv_usec;
+	tv->tv_usec = tv32->tv_usec;
 }
static __inline void
@@ -157,7 +157,7 @@
     struct netbsd32_timespec50 *s32p)
 {
- s32p->tv_sec = (netbsd32_long)p->tv_sec;
+	s32p->tv_sec = (netbsd32_time50_t)p->tv_sec;
 	s32p->tv_nsec = (netbsd32_long)p->tv_nsec;
 }
@@ -166,7 +166,7 @@
     struct netbsd32_timespec *s32p)
 {
- s32p->tv_sec = (netbsd32_long)p->tv_sec;
+	s32p->tv_sec = (netbsd32_time_t)p->tv_sec;
 	s32p->tv_nsec = (netbsd32_long)p->tv_nsec;
 }


Home | Main Index | Thread Index | Old Index