vivi memory leak = kernel panic
sudo modprobe vivi
then as a user, build/run the sample code from the V4L2 spec (either the original from the spec or the updated one on linuxtv.org) It eats up some memory pool, the OOM killer whacks what it can till:
[ 290.760597] Kernel panic - not syncing: Out of memory and no killable processes...
vivi = kernel module that ships with ubuntu (which is the same as the one in Linus's kernel.)
Background (answers "Why?" but can be skipped)
I am trying to use vivi to help with the development of some V4L2 drivers and apps and python bindings. It does not require any hardware, is sposed to be an example of how to do things, so should be very handy for working with 5 people who don't all have the same hardware, and we don't want the results to depend on any one piece of hardware anyway. the apps should use the API correctly, and the drivers should implement the API correctly. vivi is like a hardware driver, but does not require any hardware - it just returns a test pattern. Also, there is an example program as part of the V4L2 spec: capture.c. It too seems a good candidate for evaluating if a driver is behaving correctly. So getting these 2 pieces working correctly will help the development of the real software.
1. Install u-server (or -desktop, or -xubuntu, and I am sure any other flavor) on any hardware (well, so far I have only tested on 32 bit systems, but this issues first came out when someone running 64 os on x64 hardware. (I don't feel like asking someone to kernel panic their main box.)
2. sudo adduser foo video
3. sudo modprobe vivi
4. dmesg | grep /dev/video
[ 227.874764] vivi: V4L2 device registered as /dev/video0
4. wget http://
5. gcc capture.c -o capture
6. watch grep Vmalloc /proc/meminfo
VmallocTotal: 897016 kB
VmallocUsed: 3084 kB
VmallocChunk: 893708 kB
7. in another shell: ./capture -d /dev/video0 --read
should see 100 dots: .......
VmallocUsed: 19392 kB
VmallocChunk: 877400 kB
repeat #7 and watch VmallocUsed grow
VmallocUsed: 35700 52008 68316 84624 100,932 101,536
On my 128mb qemu u-server, the 6th time:
[ 6237.229155] Out of memory: kill process 4038 (sshd) score 2808 or a child
[ 6237.232929] Killed process 4039 (bash)
and klogd, dbus-daemon
[ 6237.483670] Killed process 9424 (capture)
[ 6237.699045] vmalloc (614400 pages) failed
[ 6237.722821] Killed process 9374 (watch)
and atd, syslogd, portmap, sshd*2 cron dhclient3 dd getty*5 acpid.
[ 6238.328635] Kernel panic - not syncing: Out of memory and no killable processes...
here is all of meminfo in a spreadsheet:
Linux dell29 2.6.24-19-generic #1 SMP Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux
updated version of capture.c: