lockgetpc may not panic if the given lock is nil. this is because lockgetpc() is called from procdump, where it is not know if the lock is nil or not. for good measure and symmetry, locksetpc will ignore a nil lock. Reference: /n/atom/patch/applied/mcslockttp Date: Thu May 15 04:37:21 CES 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/port/mcslock.c Thu May 15 04:35:27 2014 +++ /sys/src/nix/port/mcslock.c Thu May 15 04:35:28 2014 @@ -203,8 +203,7 @@ { LockEntry *ql; - ql = l->e; - if(ql != nil && ql->used == l) + if(l != nil && (ql = l->e) != nil && ql->used == l) return ql->pc; return 0; } @@ -214,7 +213,6 @@ { LockEntry *ql; - ql = l->e; - if(ql != nil && ql->used == l && ql->m == m) + if(l != nil && (ql = l->e) != nil && ql->used == l && ql->m == m) ql->pc = pc; }