NetBSD Problem Report #44674

From campbell@mumble.net  Thu Mar  3 20:50:41 2011
Return-Path: <campbell@mumble.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id D564B63B84D
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  3 Mar 2011 20:50:41 +0000 (UTC)
Message-Id: <20110303205039.B09B698298@pluto.mumble.net>
Date: Thu,  3 Mar 2011 20:50:39 +0000 (UTC)
From: Taylor R Campbell <campbell+netbsd@mumble.net>
Reply-To: Taylor R Campbell <campbell+netbsd@mumble.net>
To: gnats-bugs@gnats.NetBSD.org
Subject: unlocking xscreensaver makes my MacBook1,1 spontaneously reboot
X-Send-Pr-Version: 3.95

>Number:         44674
>Category:       kern
>Synopsis:       unlocking xscreensaver makes my MacBook1,1 spontaneously reboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 03 20:55:00 +0000 2011
>Closed-Date:    Sat Mar 05 10:39:43 +0000 2011
>Last-Modified:  Sun Mar 06 22:50:02 +0000 2011
>Originator:     Taylor R Campbell <campbell+netbsd@mumble.net>
>Release:        NetBSD 5.99.47
>Organization:
>Environment:
System: NetBSD oberon.local 5.99.47 NetBSD 5.99.47 (RIAMONODEBUG) #31: Mon Feb 28 05:14:15 UTC 2011 riastradh@smalltalk.local:/home/riastradh/netbsd/current/obj/sys/arch/i386/compile/RIAMONODEBUG i386
Architecture: i386
Machine: i386
>Description:

	When I unlock xscreensaver, after entering my pass phrase and
	hitting RET, my MacBook1,1 spontaneously reboots.  No panic
	message, no core dump, no log messages after the fact --
	nothing.  I tried this with three different kernels: one from
	CVS as of about 2011-02-15, one as of about 2011-02-28, and one
	as of today, 2011-03-03.

	Other random details:

	. X is modular X.org from pkgsrc,
	. the system is running in an init.root chroot on cgd,
	. userland is from 5.1_STABLE; only kernel is -current, and
	. I haven't tried a 5.1_STABLE kernel for various reasons.

	If I ktrace xscreensaver with `ktrace -d -i -s -t A', here's
	what I see each time at the end of the kdump, which corresponds
	with pam-pwauth_suid and pwauth_suid_helper:

   567      1 xscreensaver CALL  pipe
   567      1 xscreensaver RET   pipe 8, 9
   567      1 xscreensaver CALL  __sigprocmask14(1,0xbfbfe300,0xbfbfe2f0)
   567      1 xscreensaver RET   __sigprocmask14 0
   567      1 xscreensaver CALL  __vfork14
   653      1 xscreensaver EMUL  "netbsd"
   653      1 xscreensaver RET   fork 0
   653      1 xscreensaver CALL  dup2(8,0)
   653      1 xscreensaver RET   dup2 0
   653      1 xscreensaver CALL  close(8)
   653      1 xscreensaver RET   close 0
   653      1 xscreensaver CALL  close(9)
   653      1 xscreensaver RET   close 0
   653      1 xscreensaver CALL  execve(0xbb9156cc,0xbfbfe2c4,0xbfbfe87c)
   653      1 xscreensaver NAMI  "/pkg/2010Q4/pkg/libexec/pwauth_suid_helper"
   653      1 xscreensaver CSW   stop kernel
   653      1 xscreensaver CSW   resume kernel
   653      1 xscreensaver CSW   stop kernel
   653      1 xscreensaver CSW   resume kernel
   653      1 xscreensaver NAMI  "/usr/libexec/ld.elf_so"
   653      1 xscreensaver ARG   "/pkg/2010Q4/pkg/libexec/pwauth_suid_helper"
   653      1 xscreensaver ARG   "riastradh"
   653      1 xscreensaver ENV   "ENV=/home/riastradh/.shrc"
   653      1 xscreensaver ENV   "XAUTHORITY=/home/riastradh/.Xauthority"
   653      1 xscreensaver ENV   "KRB5_CONFIG=/etc/krb5-csail.conf"
   653      1 xscreensaver ENV   "PWD=/home/riastradh"
   653      1 xscreensaver ENV   "LANG=en_US.UTF-8"
   653      1 xscreensaver ENV   "HOME=/home/riastradh"
   653      1 xscreensaver ENV   "_=/bin/sh"
   653      1 xscreensaver ENV   "LESS=-i"
   653      1 xscreensaver ENV   "PATH=/pkg/2010Q4/pkg/libexec/xscreensaver:/b\
	in:/sbin:/command:/usr/pkg/bin:/usr/pkg/sbin:/usr/bin:/usr/sbin:/usr/l\
	ocal/bin:/usr/local/sbin"
   653      1 xscreensaver ENV   "SSH_AGENT_PID=528"
   653      1 xscreensaver ENV   "TERM=screen"
   653      1 xscreensaver ENV   "TERMCAP=SC|screen|VT 100/ANSI X3.64 virtual \
	terminal:\\\n	:DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E\
	[Z:\\\n	:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:ct=\\E[3g:\\\
	\n	:do=^J:nd=\\E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\\\
	\n	:le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E(B:\\\n\
		:li#25:co#80:am:xn:xv:LP:sr=\\EM:al=\\E[L:AL=\\E[%dL:cs=\\E[%i\
	%d;%dr:\\\n	:dl=\\E[M:DL=\\E[%dM:dc=\\E[P:DC=\\E[%dP:im=\\E[4h:ei=\
	\\E[4l:mi:IC=\\E[%d@:\\\n	:ks=\\E[?1h\\E=:ke=\\E[?1l\\E>:vi=\\E[\
	?25l:ve=\\E[34h\\E[?25h:vs=\\E[34l:\\\n	:ti=\\E[?1049h:te=\\E[?1049l:u\
	s=\\E[4m:ue=\\E[24m:so=\\E[3m:se=\\E[23m:\\\n	:mb=\\E[5m:md=\\E[1m:m\
	r=\\E[7m:me=\\E[m:ms:\\\n	:Co#8:pa#64:AF=\\E[3%dm:AB=\\E[4%dm:op\
	=\\E[39;49m:AX:as=\\E(0:ae=\\E(B:\\\n	:ac=\\140\\140aaffggjjkkllmmnn\
	ooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\\\n	:k0=\\E[10~:k1\
	=\\EOP:k2=\\EOQ:k3=\\EOR:k4=\\EOS:k5=\\E[15~:k6=\\E[17~:\\\n	:k7=\\\
	E[18~:k8=\\E[19~:k9=\\E[20~:k;=\\E[21~:F1=\\E[23~:F2=\\E[24~:kb=^H:\\\
	\n	:kh=\\E[1~:@1=\\E[1~:kH=\\E[4~:@7=\\E[4~:kN=\\E[6~:kP=\\E[5~:k\
	I=\\E[2~:\\\n	:kD=\\E[3~:ku=\\EOA:kd=\\EOB:kr=\\EOC:kl=\\EOD:"
   653      1 xscreensaver ENV   "SSH_AUTH_SOCK=/tmp/ssh-00000524aa/agent.524"
   653      1 xscreensaver ENV   "OLDPWD=/home/riastradh"
   653      1 xscreensaver ENV   "USER=riastradh"
   653      1 xscreensaver ENV   "PAGER=/usr/bin/less"
   653      1 xscreensaver ENV   "EDITOR=/usr/pkg/bin/emacsclient -c -t -a /us\
	r/pkg/bin/emacs"
   653      1 xscreensaver ENV   "LC_COLLATE=C"
   653      1 xscreensaver ENV   "LOGNAME=riastradh"
   653      1 xscreensaver ENV   "SHELL=/bin/sh"
   653      1 xscreensaver ENV   "LESSHISTFILE=-"
   653      1 xscreensaver ENV   "CVS_RSH=ssh"
   653      1 xscreensaver ENV   "DISPLAY=:0"
   653      1 xscreensaver ENV   "WINDOWPATH=5"
   653      1 xscreensaver ENV   "WINDOW=0"
   653      1 xscreensaver ENV   "VISUAL=/usr/pkg/bin/emacsclient -c -t -a /us\
	r/pkg/bin/emacs"
   567      1 xscreensaver CSW   stop kernel
   567      1 xscreensaver CSW   resume kernel
   567      1 xscreensaver RET   __vfork14 653/0x28d
   567      1 xscreensaver CALL  close(8)
   567      1 xscreensaver RET   close 0
   567      1 xscreensaver CALL  write(9,0xbb894c90,0xa)
   567      1 xscreensaver GIO   fd 9 wrote 10 bytes
       ".........."
   567      1 xscreensaver RET   write 10/0xa
   567      1 xscreensaver CALL  close(9)
   567      1 xscreensaver RET   close 0
   567      1 xscreensaver CALL  wait4(0x28d,0xbfbfe318,0,0)

>How-To-Repeat:

	Run xscreensaver to lock the screen.  Unlock the screen.  Watch
	in horror as the machine spontaneously reboots, and then in sad
	desperation as the spontaneity wears off after several times in
	a row.

>Fix:

	Yes, please!

>Release-Note:

>Audit-Trail:
From: Taylor R Campbell <campbell+netbsd@mumble.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/44674: unlocking xscreensaver makes my MacBook1,1 spontaneously reboot
Date: Thu, 3 Mar 2011 22:19:04 +0000

 (Used the wrong subject line the first time around.  Sorry if this
 duplicated, but I don't think it is.)

 Found it: sigtimedwait is broken in COMPAT_50.  Also, /netbsd in my
 unencrypted root and /netbsd in my encrypted `root' on cgd disagreed,
 which is why savecore didn't recognize the core dump; once I fixed
 that I got at the core dump and a stack trace.

 Here's the fix.  The CTASSERT is totally needless, idle paranoia.

 Index: kern_time_50.c
 ===================================================================
 RCS file: /cvsroot/src/sys/compat/common/kern_time_50.c,v
 retrieving revision 1.18
 diff -p -u -r1.18 kern_time_50.c
 --- kern_time_50.c	19 Jan 2011 10:21:16 -0000	1.18
 +++ kern_time_50.c	3 Mar 2011 22:09:40 -0000
 @@ -453,8 +453,9 @@ static int
  tscopyin(const void *u, void *s, size_t len)
  {
  	struct timespec50 ts50;
 -	KASSERT(len == sizeof(ts50));
 -	int error = copyin(u, &ts50, len);
 +	__CTASSERT(sizeof ts50 <= sizeof(struct timespec));
 +	KASSERT(len == sizeof(struct timespec));
 +	int error = copyin(u, &ts50, sizeof ts50);
  	if (error)
  		return error;
  	timespec50_to_timespec(&ts50, s);

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44674 CVS commit: src/sys/compat/common
Date: Thu, 3 Mar 2011 20:36:57 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Fri Mar  4 01:36:56 UTC 2011

 Modified Files:
 	src/sys/compat/common: kern_time_50.c

 Log Message:
 PR/44674: Taylor R Campbell: Fix compat copyin and copyout routines which
 were obviously broken.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.19 src/sys/compat/common/kern_time_50.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 05 Mar 2011 10:39:43 +0000
State-Changed-Why:
Christos committed it.
good catch :-)


From: Taylor R Campbell <campbell+netbsd@mumble.net>
To: gnats-bugs@NetBSD.org
Cc: "Christos Zoulas" <christos@netbsd.org>
Subject: Re: PR/44674 CVS commit: src/sys/compat/common
Date: Sun, 6 Mar 2011 21:23:34 +0000

    Date: Thu, 3 Mar 2011 20:36:57 -0500
    From: "Christos Zoulas" <christos@netbsd.org>

    PR/44674: Taylor R Campbell: Fix compat copyin and copyout routines which
    were obviously broken.

 Thanks, I somehow overlooked same problem in the tscopyout routine.
 Problem gone.

 If you're looking at time_t-related COMPAT_50 bugs, by the way,
 there's also kern/44582.

From: christos@zoulas.com (Christos Zoulas)
To: Taylor R Campbell <campbell+netbsd@mumble.net>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/44674 CVS commit: src/sys/compat/common
Date: Sun, 6 Mar 2011 17:46:06 -0500

 On Mar 6,  9:23pm, campbell+netbsd@mumble.net (Taylor R Campbell) wrote:
 -- Subject: Re: PR/44674 CVS commit: src/sys/compat/common

 |    Date: Thu, 3 Mar 2011 20:36:57 -0500
 |    From: "Christos Zoulas" <christos@netbsd.org>
 | 
 |    PR/44674: Taylor R Campbell: Fix compat copyin and copyout routines which
 |    were obviously broken.
 | 
 | Thanks, I somehow overlooked same problem in the tscopyout routine.
 | Problem gone.
 | 
 | If you're looking at time_t-related COMPAT_50 bugs, by the way,
 | there's also kern/44582.

 IMHO the cost of fixing them in terms of maintainance outweights the benefit.

 christos

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.