From nobody@FreeBSD.org  Fri Feb  1 16:52:33 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id A323737B402
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  1 Feb 2002 16:52:25 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g120qPS52461;
	Fri, 1 Feb 2002 16:52:25 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200202020052.g120qPS52461@freefall.freebsd.org>
Date: Fri, 1 Feb 2002 16:52:25 -0800 (PST)
From: "Marcus L. Reid" <marcus@punq.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Kernel crash on fclose() of /dev/kbd1 when USB keyboard is detached while file is open.
X-Send-Pr-Version: www-1.0
X-GNATS-Notify: iedowse

>Number:         34544
>Category:       kern
>Synopsis:       [kbd] Kernel crash on fclose() of /dev/kbd1 when USB keyboard is detached while file is open.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 01 17:00:00 PST 2002
>Closed-Date:    Thu Nov 04 02:39:14 GMT 2004
>Last-Modified:  Thu Nov 04 02:39:14 GMT 2004
>Originator:     Marcus L. Reid
>Release:        4.5-RELEASE
>Organization:
Gampro
>Environment:
FreeBSD zork.punq.net 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Fri Feb  1 16:06:37 PST 2002     root@zork.punq.net:/usr/obj/home/archive/releases/RELENG_4_5/src/sys/ZORK  i386
>Description:
When a USB keyboard is detached while a process has /dev/kbd1 open, the machine crashes hard when the process tries to fclose() the file.     
>How-To-Repeat:
int
main(void)
{
        FILE *fp;

        /* USB keyboard is attached. */
        fp = fopen("/dev/kbd1", "r");
        if(fp) {
                printf("Unplug the keyboard in the next 10 seconds.\n");
                sleep(10);
        }
        else {
                fprintf(stderr, "Couldn't open /dev/kbd1\n");
                exit(1);
        }
        /* USB keyboard is detached by now. */
        fclose(fp);
        /* Boom. */

        exit(0);
}
   
>Fix:
      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joe 
Responsible-Changed-By: kris 
Responsible-Changed-When: Thu Jul 17 17:29:12 PDT 2003 
Responsible-Changed-Why:  
Assign to USB maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34544 

From: Naveen Kumar <g_naveen_k@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org, marcus@punq.net
Cc:  
Subject: Re: kern/34544: Kernel crash on fclose() of /dev/kbd1 when USB keyboard is detached while file is open.
Date: Thu, 19 Feb 2004 14:54:55 -0800 (PST)

 This may be a generic USB issue. I had a similar
 "problem" with a USB flash drive. Attach the drive, it
 is recognized etc. Mount the filesystem on the drive.
 Works fine. Now detach the drive. Driver detects
 detach successfully. Now try umount on mounted
 filesystem. Kernel will go into panic. 
 
 
 Naveen
 
 __________________________________
 Do you Yahoo!?
 Yahoo! Mail SpamGuard - Read only the mail you want.
 http://antispam.yahoo.com/tools
State-Changed-From-To: open->feedback 
State-Changed-By: iedowse 
State-Changed-When: Thu Nov 4 02:15:40 GMT 2004 
State-Changed-Why:  

Does this problem still occur with more recent FreeBSD releases? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34544 
State-Changed-From-To: feedback->closed 
State-Changed-By: iedowse 
State-Changed-When: Thu Nov 4 02:38:56 GMT 2004 
State-Changed-Why:  

Mail to sumbitter bounces. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34544 
>Unformatted:
