NetBSD Problem Report #53398

From www@NetBSD.org  Tue Jun 26 12:08:25 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 035EA7A1BC
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 26 Jun 2018 12:08:25 +0000 (UTC)
Message-Id: <20180626120824.273577A1D3@mollari.NetBSD.org>
Date: Tue, 26 Jun 2018 12:08:24 +0000 (UTC)
From: prlw1@cam.ac.uk
Reply-To: prlw1@cam.ac.uk
To: gnats-bugs@NetBSD.org
Subject: iwn0 off after X logout
X-Send-Pr-Version: www-1.0

>Number:         53398
>Category:       kern
>Synopsis:       iwn0 off after X logout
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 26 12:10:00 +0000 2018
>Last-Modified:  Thu Jul 19 09:20:01 +0000 2018
>Originator:     Patrick Welche
>Release:        NetBSD-8.99.20/amd64
>Organization:
>Environment:
>Description:
I can't believe it, but it is reproducible:

login via xdm
fire up xterm
su
wpa_supplicant -B -i iwn0 -c...
dhcpcd -L4 iwn0

then logout (shutdown) from xdm

note the lack of network. (Originally I had ssh'd in, and the connection froze.)

open a terminal (ctl-alt-f1), login as root, and observe that iwn0 is down.

ifconfig iwn0 up

and all is well - the connection becomes active and a lease is acquired with no further intervention.
>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Martin Husemann <martin@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Tue, 26 Jun 2018 12:14:50 +0000

 This hardly is a kernel issue, are you sure none of your session scripts
 (or whatever) does a ifconfig down ?

 Martin

 (fwiw: I use xdm and xfce4 and it does not happen for me)

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Tue, 26 Jun 2018 13:21:37 +0100

 This is stock native xsrc xdm. No fancy gnome session. I can say for
 certain that this wasn't happening a year ago. Has something changed so
 we suddenly drop links more often than we used to / avoid having a
 working network as much as possible ?

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Tue, 26 Jun 2018 14:30:42 +0200

 On Tue, Jun 26, 2018 at 12:25:01PM +0000, Patrick Welche wrote:
 >  This is stock native xsrc xdm.

 Same here.

 > No fancy gnome session.

 Here neither ;-)

 > I can say for
 >  certain that this wasn't happening a year ago. Has something changed so
 >  we suddenly drop links more often than we used to / avoid having a
 >  working network as much as possible ?

 No, we have not. Since you said "ifcofnig iwn0 up" is all that is needed,
 it can't be dhcpcd being killed or wpa_supplicant terminating.

 It must be some userland problem in your local setup.

 Something in /etc/X11/xdm/TakeConsole?

 Martin

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Tue, 26 Jun 2018 13:39:27 +0100

 On Tue, Jun 26, 2018 at 12:35:01PM +0000, Martin Husemann wrote:
 >  It must be some userland problem in your local setup.

 I hope you are right...
 >
 >  Something in /etc/X11/xdm/TakeConsole?

 $ cat TakeConsole 
 #!/bin/sh
 # Reassign ownership of the console to root, this should disallow
 # assignment of console output to any random users's xterm
 #
 chmod 622 /dev/console
 chown root /dev/console

From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Tue, 26 Jun 2018 22:02:43 +0700

     Date:        Tue, 26 Jun 2018 12:10:00 +0000 (UTC)
     From:        prlw1@cam.ac.uk
     Message-ID:  <20180626121000.EA6B57A281@mollari.NetBSD.org>

   | login via xdm
   | fire up xterm
   | su
   | wpa_supplicant -B -i iwn0 -c...
   | dhcpcd -L4 iwn0

 When you exit xdm (or the kernel) will do a session reset, and kill everything
 running in that same session (dhcpcd probably protects itself, I don't think
 wpa_supplicant does that).

   | open a terminal (ctl-alt-f1), login as root, and observe that iwn0 is down.
   | ifconfig iwn0 up
   | and all is well - the connection becomes active and a lease is acquired with no further intervention.

 Start wpa_supplicant (and dhcpcd) from /etc/rc rather than by hand.   You can
 run wpa_gui (from pkgsrc) in the xdm session if you need (or want) to interact
 with wpa_supplicant to get the link up - it isn't needed that wpa_supplicant bring
 up the link from rc.d,  just that it be started from there rather than from the xdm
 session.

 kre

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Thu, 28 Jun 2018 09:59:37 +0100

 Note that wpa_supplicant continues to run on X session exit, and all that
 is needed is a "ifconfig iwn0 up" - the mystery is what is bringing it
 down.

 Today's experiment:

 Boot up laptop (xdm=YES in rc.conf)
 ctrl-alt-f1
 login as root
 wpa_supplicant -B -i iwn0 -c ...
 dhcpcd -4L iwn0
 ping www.netbsd.org (successful)

 ctrl-alt-f8 for xdm login
 ping www.netbsd.org (successful)
 logout

 ctrl-alt-f1

 see iwn0: fatal firmware error
 firmwre error log:
   error type = "UNKNOWN" (0x000022CE)

 ifconfig shows interface is down.


 ifconfig iwn0 up
 ping www.netbsd.org (successful)


 wpa_supplicant and dhcpcd were not started within X.

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/53398: iwn0 off after X logout
Date: Thu, 19 Jul 2018 10:17:01 +0100

 On Thu, Jun 28, 2018 at 09:00:01AM +0000, Patrick Welche wrote:
 >  Today's experiment:

 After updating the world yesterday, I can no longer reproduce this. The
 main observation is that I no longer get serious/lengthy disk activitity
 switching to/from the X vt.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.