NetBSD Problem Report #50597

From wwwNetBSD.org  Tue Dec 29 12:57:22 2015
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A41097A20C
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 29 Dec 2015 12:57:22 +0000 (UTC)
Message-Id: <20151229125721.3DBE57ACBD@mollari.NetBSD.org>
Date: Tue, 29 Dec 2015 12:57:21 +0000 (UTC)
From: roy@roypittman.com
Reply-To: roy@roypittman.com
To: gnats-bugs@NetBSD.org
Subject: using xsane causes my computer to crash
X-Send-Pr-Version: www-1.0

>Number:         50597
>Category:       kern
>Synopsis:       using xsane causes my computer to crash
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    skrll
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 29 13:00:00 +0000 2015
>Closed-Date:    Mon Feb 22 07:52:39 +0000 2016
>Last-Modified:  Sun Mar 06 18:15:00 +0000 2016
>Originator:     Roy Pittman
>Release:        NetBSD/amd64-7.0_STABLE, pkgsrc-2015Q4
>Organization:
>Environment:
NetBSD ratliff 7.0_STABLE NetBSD 7.0_STABLE (RATLIFF) #5: Fri Nov 27 22:56:07 MST 2015  roy@ratliff:/d0/build/netbsd-7/obj/amd64/sys/arch/amd64/compile/RATLIFF amd64
>Description:
Before the update of "sane-backends" (previously pkgsrc-2015Q3)
everything worked properly.  Updating to pkgsrc-2015Q4 is when the problem showed up and updating to the tagged current pkgsrc has not helped.
Using an Epson Perfection 4870 Photo scanner and using sane-backend driver epson2 version sane-backends-1.0.25nb1 any attempt to scan that actually ties to use the scanner including a simple 'scanimage -L' will crash the machine.

dmesg shows my scanner detected as ugen0":
ugen0 at uhub3 port 5
ugen0: EPSON EPSON Scanner, rev 2.00/1.03, addr 2

Here is backtrace output extracted from the 'crash' utility after the most recent dump:
Crash version 7.0_STABLE, image version 7.0_STABLE.
System panicked: trap
Backtrace from time of crash is available.
crash> bt
_KERNEL_OPT_NAGR() at 0
_KERNEL_OPT_NAGR() at 0
vpanic() at vpanic+0x145
snprintf() at snprintf
startlwp() at startlwp
calltrap() at calltrap+0x11
cdev_close() at cdev_close+0x86
spec_close() at spec_close+0x12c
VOP_CLOSE() at VOP_CLOSE+0x33
vn_close() at vn_close+0x4a
closef() at closef+0x4a
fd_close() at fd_close+0x10a
sys_close() at sys_close+0x1b
syscall() at syscall+0x9a
--- syscall (number 6) ---
7f7fed03c65a:
crash> 
>How-To-Repeat:
Attempt a scan with the above named equipment.
>Fix:
Not known to me.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->skrll
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Tue, 29 Dec 2015 21:22:50 +0000
Responsible-Changed-Why:
Nick, can you please take a look?
(this looks like a kernel bug, not a pkgsrc one)


From: roy@betweentheleaves.com
To: gnats-bugs@netbsd.org
Cc: "John D. Baker" <jdbaker@mylinuxisp.com>
Subject: Re: kern/50597 an addendum: reverting to sane-backends pkgsrc-2015q3
 causes my scanner to be usable
Date: Wed, 30 Dec 2015 12:09:38 -0700

 I have a little new information that may be useful.

 I reverted only sane-backends to the pkgsrc-2015Q3 version and 
 everything worked again: my scanner was usable by xsane and gimp just as 
 before.

 A friend of mine tells me that sane-backends from pkgsrc-2015Q4 with a 
 PowerLook 2100XL scanner works
 just fine.

 Hope this helps.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: skrll@NetBSD.org, roy@roypittman.com
Subject: Re: kern/50597 an addendum: reverting to sane-backends pkgsrc-2015q3 causes my scanner to be usable
Date: Wed, 30 Dec 2015 20:13:54 +0100

 Nevertheless, this is a kernel bug. It would be great to have a simpler
 test case (or one that doesn't require having that particular device).

 Martin

From: roy@betweentheleaves.com
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/50597 an addendum: reverting to sane-backends pkgsrc-2015q3
 causes my scanner to be usable
Date: Wed, 30 Dec 2015 15:22:23 -0700

 Martin,

 I am not sure whether to rely to you or to the gnats- address.  I want 
 to be most helpful and least troubling.
 Nevertheless:

 > On Mon, 21 Dec 2015, John D. Baker wrote:
 > 
 >> It turns out that 'gphoto2' uses "libusb" (version 0) while 
 >> "sane-backends"
 >> uses "libusb1" (version 1).  So, using 'gphoto2' to access a digital
 >> camera will not excercise the same "libusb" binary as 'scanimage' 
 >> would.
 >> 
 >> It may yet be a useful excercise to poke at 'gphoto2', although not
 >> directly applicable.
 > 
 > For what it's worth, I dug out my Nikon CoolPix L22 and gave it a whirl
 > with "gphoto2".  It worked fine on both i386 and amd64 netbsd-7 
 > machines.
 > 
 > Technically, "sane-backends" has a "gphoto2" backend, but the pkgsrc
 > system explicitly disables it from being built.
 > 
 > Trying to figure out if something else will trigger the crash.  The
 > CoolPix is the only USB gadget I have that isn't a network, printer,
 > serial port, mass-storage, or human-interface (keyboard/mouse) device.


 Hope this helps.

From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50597 an addendum: reverting to sane-backends pkgsrc-2015q3
 causes my scanner to be usable
Date: Thu, 31 Dec 2015 07:13:59 +0100

 On Wed, Dec 30, 2015 at 07:10:01PM +0000, roy@betweentheleaves.com wrote:
 >  I have a little new information that may be useful.
 >  
 >  I reverted only sane-backends to the pkgsrc-2015Q3 version and 
 >  everything worked again: my scanner was usable by xsane and gimp just as 
 >  before.
 >  
 >  A friend of mine tells me that sane-backends from pkgsrc-2015Q4 with a 
 >  PowerLook 2100XL scanner works
 >  just fine.
 >  
 >  Hope this helps.

 This makes it sounds like there is a problem in the upstream package.
 Can you please file a bug report with the sane-backends people?

 Thank you,
  Thomas

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: skrll@NetBSD.org, roy@roypittman.com
Subject: Re: kern/50597 an addendum: reverting to sane-backends pkgsrc-2015q3 causes my scanner to be usable
Date: Thu, 31 Dec 2015 11:39:52 +0100

 On Thu, Dec 31, 2015 at 06:15:00AM +0000, Thomas Klausner wrote:
 >  This makes it sounds like there is a problem in the upstream package.
 >  Can you please file a bug report with the sane-backends people?

 I would like to have the local problem (the kernel crash) fixed first -
 maybe it already would start working then?

 Nick, any ideas how to get better debug information?

 Martin

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50597: using xsane causes my computer to crash
Date: Mon, 15 Feb 2016 16:16:18 -0600 (CST)

 May be same as/related to:

   kern/50810: Kernel page fault trap in ugenclose()

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: roy@betweentheleaves.com
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/50597: using xsane causes my computer to crash
Date: Mon, 15 Feb 2016 15:48:19 -0700

 >  May be same as/related to:
 > 
 >    kern/50810: Kernel page fault trap in ugenclose()
 > 
 I don't find kern/50810. I must be looking in the wrong place.  I looked 
 in  pkgsrc-Bugs. Any ideas?

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sun, 21 Feb 2016 13:14:31 +0000
State-Changed-Why:
PR/50810 (http://gnats.netbsd.org/50810) is likely a duplicate and
has candidate fix.  Please try the diff in the PR.


From: roy@betweentheleaves.com
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/50597 (using xsane causes my computer to crash)
Date: Sun, 21 Feb 2016 17:21:47 -0700

 > Please try the diff in the PR.

 I did and it worked!  Thank you -
 Roy

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50597: using xsane causes my computer to crash
Date: Sun, 21 Feb 2016 20:54:19 -0600 (CST)

 I adapted the patch in kern/50810 to netbsd-7 (sys/dev/usb/ugen.c r1.124)
 and built a kernel for the submitter to test.

 The patch reportedly fixes the problem in this PR.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50597 CVS commit: src/sys/dev/usb
Date: Mon, 22 Feb 2016 07:46:00 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Mon Feb 22 07:46:00 UTC 2016

 Modified Files:
 	src/sys/dev/usb: ugen.c

 Log Message:
 Only clear the endpoint information in ugen_set_interface only if setting
 the new altno suceeds.

 Avoids the null de-ref in PR/50597 and PR/50810


 To generate a diff of this commit:
 cvs rdiff -u -r1.129 -r1.130 src/sys/dev/usb/ugen.c

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

State-Changed-From-To: feedback->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Mon, 22 Feb 2016 07:52:39 +0000
State-Changed-Why:
Duplicate of PR/50810 (pending-pullups)


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50597 CVS commit: [netbsd-7] src/sys/dev/usb
Date: Sun, 6 Mar 2016 18:08:04 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Mar  6 18:08:04 UTC 2016

 Modified Files:
 	src/sys/dev/usb [netbsd-7]: ugen.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #1124):
 	sys/dev/usb/ugen.c: revision 1.127
 	sys/dev/usb/ugen.c: revision 1.128
 	sys/dev/usb/ugen.c: revision 1.129
 	sys/dev/usb/ugen.c: revision 1.130
 s/0/NULL/
 One more s/0/NULL/
 Remove always true conditional
 Only clear the endpoint information in ugen_set_interface only if setting
 the new altno suceeds.
 Avoids the null de-ref in PR/50597 and PR/50810


 To generate a diff of this commit:
 cvs rdiff -u -r1.124 -r1.124.2.1 src/sys/dev/usb/ugen.c

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50597 CVS commit: [netbsd-7-0] src/sys/dev/usb
Date: Sun, 6 Mar 2016 18:10:20 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Mar  6 18:10:20 UTC 2016

 Modified Files:
 	src/sys/dev/usb [netbsd-7-0]: ugen.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #1124):
 	sys/dev/usb/ugen.c: revision 1.127
 	sys/dev/usb/ugen.c: revision 1.128
 	sys/dev/usb/ugen.c: revision 1.129
 	sys/dev/usb/ugen.c: revision 1.130
 s/0/NULL/
 One more s/0/NULL/
 Remove always true conditional
 Only clear the endpoint information in ugen_set_interface only if setting
 the new altno suceeds.
 Avoids the null de-ref in PR/50597 and PR/50810


 To generate a diff of this commit:
 cvs rdiff -u -r1.124 -r1.124.4.1 src/sys/dev/usb/ugen.c

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

>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.