Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VC4 kernel framework driver - memory leak #2293

Closed
nkichukov opened this issue Nov 29, 2017 · 1 comment
Closed

VC4 kernel framework driver - memory leak #2293

nkichukov opened this issue Nov 29, 2017 · 1 comment

Comments

@nkichukov
Copy link

Hi all,

I have identified a memory leak in the VC4 kernel framework driver implementation on raspberry pi 3b. Details follow below:

kernel: 4.14.0-v7+
compiler: gcc-6.4
raspberry pi running in 32bit mode
OS: Gentoo Linux
Kernel configuration is attached, see below.

Whenever kodi(v17.6) is playing video, I can see that /proc/slabinfo reports number of kmalloc-128 constantly increasing and never releasing:
kmalloc-128 84916 84924 384 21 2 : tunables 0 0 0 : slabdata 4044 4044 0

In about 24 hours this has taken up about 600MB of the memory and the Pi needs to be restarted to avoid swapping. If I stop kodi playback and leave it idle, the kmalloc-128 remains the same until playback is resumed which starts increasing again. If I stop the X server and kodi altogether, the memory is not released.

The memleak pattern is like the one below

(from /sys/kernel/debug/kmemleak):

unreferenced object 0x95ce16c0 (size 128):
comm "kodi.bin", pid 2075, jiffies 891363 (age 2338.023s)
hex dump (first 32 bytes):
01 00 00 00 5c ed 1e 7f 00 00 00 00 00 00 00 00 ...............
d0 16 ce 95 d0 16 ce 95 00 3a fb b4 00 00 00 00 .........:......
backtrace:
[<802827c8>] kmem_cache_alloc_trace+0x234/0x2f8
[<7f1e461c>] vc4_submit_cl_ioctl+0x730/0xb50 [vc4]
[<7f0d796c>] drm_ioctl_kernel+0x78/0xb8 [drm]
[<7f0d7cd4>] drm_ioctl+0x1b4/0x37c [drm]
[<802ac090>] do_vfs_ioctl+0xb0/0x8b4
[<802ac8d8>] SyS_ioctl+0x44/0x6c
[<80108140>] ret_fast_syscall+0x0/0x28
[] 0xffffffff

Let me know if additional information is required to track this issue down.

rpi-4.14.y-kernel_configuration_file.gz

Thank you,
-Nikolay

@pelwell
Copy link
Contributor

pelwell commented Nov 29, 2017

It would be best to report this in the VC4 author's repo: https://github.com/anholt/linux/issues

I notice that there is already an issue entitled "vc4: Memory leaks in linux-next-20171110" which looks like it could be a duplicate:

unreferenced object 0xffff800037e03b80 (size 128):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants