From apostbackup@yahoo.com  Thu May  6 03:31:38 2004
Return-Path: <apostbackup@yahoo.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D707E16A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  6 May 2004 03:31:38 -0700 (PDT)
Received: from web60306.mail.yahoo.com (web60306.mail.yahoo.com [216.109.118.117])
	by mx1.FreeBSD.org (Postfix) with SMTP id 43FF943D62
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  6 May 2004 03:31:38 -0700 (PDT)
	(envelope-from apostbackup@yahoo.com)
Received: from [80.61.177.100] by web60306.mail.yahoo.com via HTTP; Thu, 06 May 2004 03:31:37 PDT
Message-Id: <20040506103137.42262.qmail@web60306.mail.yahoo.com>
Date: Thu, 6 May 2004 03:31:37 -0700 (PDT)
From: andre post <apostbackup@yahoo.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Andre Post <apost@high-low.net>
Subject: usb driver memory leak grows wired memory until panic/reboot

>Number:         66324
>Category:       kern
>Synopsis:       [usb] usb driver memory leak grows wired
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-usb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 06 03:40:17 PDT 2004
>Closed-Date:    Mon Jan 10 03:50:24 GMT 2005
>Last-Modified:  Mon Jan 10 03:50:24 GMT 2005
>Originator:     Andre Post
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
kern.ostype: FreeBSD
kern.osrelease: 5.1-RELEASE
kern.osrevision: 199506
kern.version: FreeBSD 5.1-RELEASE #7: Wed Dec 10
10:56:43 CET 2003
    user@hostname:/usr/obj/usr/src/sys/MYKERNEL ucom
and uftdi drivers compiled into the kernel to
facilitate usb communication with an LCD display

>Description:
Observed problems:
- Machine locks up, panics, reboots periodically
- Wired memory slowly grows, the machine starts using
swap until all memory is taken and the machine dies
- top and ps show that there is no process that
accounts for the occupied wired memory

Analysis:
Browsing the mailing lists showed there were few
people having the same problems. I found only 1
response that was of use and pointed me in the
direction of the usb drivers. On our machines we use
the ucom and uftdi drivers to communicate with an LCD
display. We use lcdproc to display system stats on the
display. ps and top showed that all userland processes
including lcdproc did not account for the wired memory
leak. Killing the userland lcd applications did not
free the wired memory...only a reboot frees it. When
not feeding data to the lcd screen, the wired memory
levels remain constant and behave normally.

There was a fix for something similar that was
supposedly patched in 4.9 but apparently never wound
up in the 5.x branch:
http://www.freebsd.org/cgi/query-pr.cgi?pr=31659
The useful post that pointed me in the right
direction:
http://lists.freebsd.org/pipermail/freebsd-current/2003-July/007545.html

I don't know if this is of any additional value but
the output of 'pstat -t' includes the usb connection
with an extremely large value in the 'COL' field.

>How-To-Repeat:
For our situation:
        compile a new kernel with 'device ucom' and
'device uftdi' and connect an lcd display that makes
use of those drivers. Userland apps can send data to
the lcd display by using '/dev/ucom0'. Make sure to
send a lot of data to the display and do so
constantly. Over time (depending on the amount of data
per time unit), you'll see the used wired memory grow.

>Fix:
Temporary workaround:
        Reduce the amount of traffic that goes over
the usb connection.



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-usb 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Nov 4 07:09:28 GMT 2004 
Responsible-Changed-Why:  
Reassign to appropriate mailing list. 

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

From: Julian Elischer <julian@elischer.org>
To: freebsd-gnats-submit@FreeBSD.org, apostbackup@yahoo.com
Cc:  
Subject: Re: kern/66324: [usb] usb driver memory leak grows wired
Date: Mon, 03 Jan 2005 21:53:39 -0800

 Is this still true?
 
 
 going through the PRs doing a cleanup pass.
 
 julian
 
 
State-Changed-From-To: open->closed 
State-Changed-By: julian 
State-Changed-When: Mon Jan 10 03:48:41 GMT 2005 
State-Changed-Why:  
Unable to contact author. have not been able to duplicae it since 
updating the USB stack some time ago.  Assume fixed unless proved otherwise.. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66324 
>Unformatted:
 X-send-pr-version: 3.113
 X-GNATS-Notify:
 
 
 memory until panic/reboot
