kern/66324: usb driver memory leak grows wired memory until panic/reboot

andre post apostbackup at
Thu May 6 03:40:18 PDT 2004

>Number:         66324
>Category:       kern
>Synopsis:       usb driver memory leak grows wired
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 06 03:40:17 PDT 2004
>Originator:     Andre Post
>Release:        FreeBSD 5.1-RELEASE i386
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 at hostname:/usr/obj/usr/src/sys/MYKERNEL ucom
and uftdi drivers compiled into the kernel to
facilitate usb communication with an LCD display

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

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:
The useful post that pointed me in the right

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.

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.

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 
 X-send-pr-version: 3.113
 memory until panic/reboot

More information about the freebsd-bugs mailing list