re: panic: locking xyz against myself (linux DRM?!)

2015-07-25 Thread matthew green

 Now, whenever the system is up for a few days, and I didn't think of 
 restarting firefox for a while, it eventually crashes with:
  panic: kernel diagnostic assertion ((mutex-wwm_state != WW_OWNED) || 
  (mutex-wwm_u.owner != curlwp)) failed: file 
  /usr/src/sys/external/bsd/drm2/linux/
 linux_ww_mutex.c, line 760 locking 0xfe804fc70220 against myself: 
 0xfe811c5b2840
[ ... ]

 Any ideas?  Does anyone else have the same problem?
 
 I can extract information from the crash dump if required.

this is PR 49862 that we don't have any good idea about yet. :-(

i've seen it 4 times.  once a while ago, then 3 times in the
space of an hour (all while scrolling around in google maps
inside firefox.)


.mrg.


Re: panic: locking xyz against myself (linux DRM?!)

2015-07-25 Thread Taylor R Campbell
   Date: Sun, 26 Jul 2015 07:48:22 +1000
   from: matthew green m...@eterna.com.au

Now, whenever the system is up for a few days, and I didn't think of 
restarting firefox for a while, it eventually crashes with:
 panic: kernel diagnostic assertion ((mutex-wwm_state != WW_OWNED) || 
(mutex-wwm_u.owner != curlwp)) failed: file 
/usr/src/sys/external/bsd/drm2/linux/
linux_ww_mutex.c, line 760 locking 0xfe804fc70220 against myself: 
0xfe811c5b2840
   [ ... ]
   
Any ideas?  Does anyone else have the same problem?

I can extract information from the crash dump if required.

   this is PR 49862 that we don't have any good idea about yet. :-(

I've been offering the attached patch to try to debug the source of
the problem before the symptom you described happens.  I haven't
gotten any diagnostics back from anyone yet.  If you can, please try
it out and let me know.
Agent pid 1518
Index: sys/sys/lockdebug.h
===
RCS file: /cvsroot/src/sys/sys/lockdebug.h,v
retrieving revision 1.14
diff -p -u -r1.14 lockdebug.h
--- sys/sys/lockdebug.h 27 Apr 2013 08:12:34 -  1.14
+++ sys/sys/lockdebug.h 28 Jun 2015 14:37:58 -
@@ -86,11 +113,20 @@ void   lockdebug_wakeup(volatile void *, u
 
 #else  /* LOCKDEBUG */
 
+#include sys/lwp.h
+
 #defineLOCKDEBUG_ALLOC(lock, ops, addr)false
 #defineLOCKDEBUG_FREE(dodebug, lock)   /* nothing */
 #defineLOCKDEBUG_WANTLOCK(dodebug, lock, where, s) /* nothing */
+#ifdef DIAGNOSTIC
+#defineLOCKDEBUG_LOCKED(dodebug, lock, al, where, s)   \
+   do { if (s) curlwp-l_shlocks++; else curlwp-l_exlocks++; } while (0)
+#defineLOCKDEBUG_UNLOCKED(dodebug, lock, where, s) \
+   do { if (s) curlwp-l_shlocks--; else curlwp-l_exlocks--; } while (0)
+#else
 #defineLOCKDEBUG_LOCKED(dodebug, lock, al, where, s)   /* nothing */
 #defineLOCKDEBUG_UNLOCKED(dodebug, lock, where, s) /* nothing */
+#endif
 #defineLOCKDEBUG_BARRIER(lock, slp)/* nothing */
 #defineLOCKDEBUG_MEM_CHECK(base, sz)   /* nothing */
 #defineLOCKDEBUG_WAKEUP(dodebug, lock, where)  /* nothing */
Index: sys/sys/userret.h
===
RCS file: /cvsroot/src/sys/sys/userret.h,v
retrieving revision 1.26
diff -p -u -r1.26 userret.h
--- sys/sys/userret.h   7 Apr 2013 07:54:53 -   1.26
+++ sys/sys/userret.h   28 Jun 2015 14:37:58 -
@@ -83,6 +83,10 @@ mi_userret(struct lwp *l)
 #ifndef __HAVE_PREEMPTION
KASSERT(curcpu()-ci_biglock_count == 0);
 #endif
+#ifndef LOCKDEBUG
+   KASSERTMSG(l-l_exlocks == 0, %hu exlocks held, l-l_exlocks);
+   KASSERTMSG(l-l_shlocks == 0, %hu shlocks held, l-l_shlocks);
+#endif
 
/*
 * Handle exceptional events: pending signals, stop/exit actions,


Re: panic: locking xyz against myself (linux DRM?!)

2015-07-25 Thread Timo Buhrmester
 I've been offering the attached patch to try to debug the source of
 the problem before the symptom you described happens.  I haven't
 gotten any diagnostics back from anyone yet.  If you can, please try
 it out and let me know.
I believe we're already discussing this on IRC, but for the record, with your 
patch and LOCKDEBUG I get:

panic: kernel diagnostic assertion ((mutex-wwm_state != WW_OWNED) || 
(mutex-wwm_u.owner != curlwp)) failed: file 
/usr/src/sys/external/bsd/drm2/linux/linux_ww_mutex.c, line 760 locking 
0xfe8084178220 against myself: 0xfe811d915700
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip 8028be15 cs 8 rflags 246 cr2 7f7ff2e62000 ilevel 
8 rsp fe804175dad8
curlwp 0xfe811d915700 pid 2288.1 lowest kstack 0xfe804175a2c0
Stopped in pid 2288.1 (Xorg) at netbsd:breakpoint+0x5:  leave
db{0} bt
breakpoint() at netbsd:breakpoint+0x5
vpanic() at netbsd:vpanic+0x13c
kern_assert() at netbsd:kern_assert+0x4f
linux_ww_mutex_trylock() at netbsd:linux_ww_mutex_trylock+0xed
ttm_bo_uvm_fault() at netbsd:ttm_bo_uvm_fault+0x69
radeon_ttm_fault() at netbsd:radeon_ttm_fault+0x6a
uvm_fault_internal() at netbsd:uvm_fault_internal+0x828
trap() at netbsd:trap+0x249
--- trap (number 6) ---
7f7ff002e4ed:
db{0}


Cheers


re: panic: locking xyz against myself (linux DRM?!)

2015-07-25 Thread matthew green

 I've been offering the attached patch to try to debug the source of
 the problem before the symptom you described happens.  I haven't
 gotten any diagnostics back from anyone yet.  If you can, please try
 it out and let me know.

i've got this running on my laptop but i'm not using it very heavily
right now.

however, i did see a problem with this patch on a different system
i meant to tell you about... ah, good, the console log is still handy:

radeondrmkmsfb0 at radeon0
radeon0: info: registered panic notifier
wsdisplay0 at radeondrmkmsfb0 kbdmux 1
panic: kernel diagnostic assertion l-l_exlocks == 0 failed: file 
/usr/src5/sys/sys/userret.h, line 87 53 exlocks held
cpu0: Begin traceback...
vpanic(c0ae3318,dc7f2f1c,dc7f2f9c,c083941d,c0ae3318,c0ab4a0d,c0ae32e0,c0ae32b4,57,35)
 at netbsd:vpanic+0x121
kern_assert(c0ae3318,c0ab4a0d,c0ae32e0,c0ae32b4,57,35,dc7f2f58,c0688593,0,c4acbd80)
 at netbsd:kern_assert+0x23
trap() at netbsd:trap+0xbae
--- trap (number 6) ---
bbbefe30:
cpu0: End traceback...
fatal breakpoint trap in supervisor mode
trap type 1 code 0 eip c022a654 cs 8 eflags 246 cr2 bbbefe30 ilevel 0 esp 
dc7f2f00
curlwp 0xc4ab2000 pid 1 lid 1 lowest kstack 0xdc7f02c0
Stopped in pid 1.1 (init) atnetbsd:breakpoint+0x4:  popl%ebp

i didn't look any further right then, i just reverted the patch.

config options appear to be just DIAGNOSTIC and makeoptions DEBUG.


.mrg.