From nobody@FreeBSD.org  Sat Jan  1 18:19:43 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E2E4A16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  1 Jan 2005 18:19:43 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D001E43D2D
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  1 Jan 2005 18:19:43 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j01IJhpL043284
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 1 Jan 2005 18:19:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j01IJh5M043282;
	Sat, 1 Jan 2005 18:19:43 GMT
	(envelope-from nobody)
Message-Id: <200501011819.j01IJh5M043282@www.freebsd.org>
Date: Sat, 1 Jan 2005 18:19:43 GMT
From: Graham Lilley <gray@mistaken-identity.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cue0 device configuration causes kernel panic
X-Send-Pr-Version: www-2.3

>Number:         75710
>Category:       kern
>Synopsis:       [cue] cue0 device configuration causes kernel panic
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 01 18:20:07 GMT 2005
>Closed-Date:    
>Last-Modified:  Tue Jan 15 23:20:00 UTC 2008
>Originator:     Graham Lilley
>Release:        5.3-RELEASE
>Organization:
Personal Use
>Environment:
FreeBSD 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004
root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
After a fresh installation on a Compaq Armada 110 Laptop (celeron 700mhz model), attaching a CATC Netmate II USB Ethernet adapter, is detected in dmesg, but when attempting to perform "ifconfig cue0 inet 10.0.7.22 netmask 255.255.255.0" the machine panics. Panic details as follows:

Fatal Trap 12: page fault while in kernel mode
fault virtual address = 0x64206567
fault code = supervisor read, page not present
instruction pointer = 0x8:0xc05b1f10
stack pointer = 0x10:0xce2878bc
frame pointer = 0x10:0xce2878d4
code segment = base 0x0, limit 0xfffff, type 0x1b
             = DPL 0, pres 1, def32 1, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 406 (ifconfig)
trap numbers = 12
panic: page fault
Uptime: 3:38s
Cannot dump. No dump device defined.
>How-To-Repeat:
at the console, type: "ifconfig cue0 up" or type: "ifconfig cue0 inet <IP> netmask <mask>"
>Fix:
      
>Release-Note:
>Audit-Trail:

From: Derrick Brashear <shadow@dementia.org>
To: bug-followup@FreeBSD.org, gray@mistaken-identity.co.uk
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Mon, 20 Aug 2007 23:23:57 -0400

 Still reproducible with 6.2-RELEASE-p6 (as shipped with pfSense 1.2  
 rc1), reliably. 

From: Derrick Brashear <shadow@dementia.org>
To: bug-followup@FreeBSD.org, gray@mistaken-identity.co.uk
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Tue, 21 Aug 2007 08:24:59 -0400

 As a note I am reproducing this on another configuration, a small form  
 factor PC, rather than portable hardware. The bug is presumably in the  
 cue driver itself and unrelated to other hardware.
 

From: John Baldwin <jhb@FreeBSD.org>
To: bug-followup@FreeBSD.org, gray@mistaken-identity.co.uk
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Wed, 22 Aug 2007 13:44:30 -0400

 Can you provide a stack trace (preferable from a core dump, but even from ddb 
 would be helpful)?
 
 -- 
 John Baldwin

From: Derrick Brashear <dbrashear@sinenomine.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Thu, 23 Aug 2007 00:03:07 -0400

 The 6.2 RELEASE p6 kernel which came with pfsense appears to lack ddb  
 and I lack a toolchain currently to build one. I'll see  what I can  
 come up with, but it will probably take a couple days.
 

From: Derrick Brashear <dbrashear@sinenomine.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Wed, 29 Aug 2007 20:02:02 -0400

 Using usbd_device2interface_handle instead of just referring directly  
 to uaa->iface in the cue attach routine makes it not crash, at least,  
 and seems to be correct to boot. I need to test one more change and  
 then I will send a diff.
 

From: Derrick Brashear <dbrashear@sinenomine.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Wed, 29 Aug 2007 20:18:48 -0400

 Still broken (it breaks the network on the machine somehow; an  
 outgoing ping on the machines' other, non-cue interface gets one  
 reply; one dup'd packet, and nothing further, and inbound ssh connects  
 and hangs) but no more crashing.
 
 --- ./if_cue.c?rev=1.57.2.3;content-type=text 
 %2Fplain;only_with_tag=RELENG_6_2
 Sun Oct  9 03:59:36 2005
 +++ /usr/src/sys/dev/usb/if_cue.c       Thu Aug 30 01:02:38 2007
 @@ -448,10 +450,13 @@
          usb_interface_descriptor_t      *id;
          usb_endpoint_descriptor_t       *ed;
          int                     i;
 +        usbd_interface_handle   iface;
 +        usbd_status             err;
 
          bzero(sc, sizeof(struct cue_softc));
 +
 +
          sc->cue_dev = self;
 -       sc->cue_iface = uaa->iface;
          sc->cue_udev = uaa->device;
          sc->cue_unit = device_get_unit(self);
 
 @@ -461,7 +466,16 @@
                  USB_ATTACH_ERROR_RETURN;
          }
 
 -       id = usbd_get_interface_descriptor(uaa->iface);
 +        err = usbd_device2interface_handle(uaa->device,  
 CUE_IFACE_IDX, &iface);
 +        if (err) {
 +                printf("cue%d: getting interface handle failed\n",
 +                    sc->cue_unit);
 +                USB_ATTACH_ERROR_RETURN;
 +        }
 +
 +        sc->cue_iface = iface;
 +
 +       id = usbd_get_interface_descriptor(sc->cue_iface);
 
          usbd_devinfo(uaa->device, 0, devinfo);
          device_set_desc_copy(self, devinfo);
 @@ -469,12 +483,12 @@
 
          /* Find endpoints. */
          for (i = 0; i < id->bNumEndpoints; i++) {
 -               ed = usbd_interface2endpoint_descriptor(uaa->iface, i);
 +               ed = usbd_interface2endpoint_descriptor(iface, i);
                  if (!ed) {
                          printf("cue%d: couldn't get ep %d\n",
                              sc->cue_unit, i);
                          USB_ATTACH_ERROR_RETURN;
 -               }
 +               }
                  if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
                      UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
                          sc->cue_ed[CUE_ENDPT_RX] = ed- 
  >bEndpointAddress;
 
 
 

From: Derrick Brashear <dbrashear@sinenomine.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Wed, 29 Aug 2007 22:04:33 -0400

 Hm. the backtrace I sent seems to have been deleted instead of being  
 approved. Oh well.
 
 Anyway, this patch solves that part of the problem, at least.
 

From: Palle Girgensohn <girgen@FreeBSD.org>
To: bug-followup@FreeBSD.org, gray@mistaken-identity.co.uk
Cc:  
Subject: Re: kern/75710: [cue] cue0 device configuration causes kernel panic
Date: Tue, 15 Jan 2008 23:50:59 +0100

 Hi!
 
 Last trail in this discussion says that the patch fixes the problem. 
 Perhaps the patch could be committed?
 
 /Palle
  
>Unformatted:
