VirtualBox

Opened 3 years ago

Last modified 3 years ago

#20280 new defect

Memory Leak in vboxdrv

Reported by: Larry Finger Owned by:
Component: host support Version: VirtualBox 6.1.18
Keywords: Cc:
Guest type: Linux Host type: Linux

Description

I detected a small memory leak in the openSUSE version that I maintain. To see if the problem had been fixed, I installed test build revision 143492. It has the same problem.

The kmemleak report is as follows:

localhost:cat > /sys/kernel/debug/kmemleak
unreferenced object 0xffff88827c95b380 (size 128):
  comm "EMT-0", pid 4550, jiffies 4294918407 (age 94.516s)
  hex dump (first 32 bytes):
    19 01 09 18 01 00 00 80 58 00 00 00 58 00 00 00  ........X...X...
    10 12 61 19 58 00 00 00 08 00 00 00 00 00 00 00  ..a.X...........
  backtrace:
    [<000000008fe681f2>] rtR0MemAllocEx+0xc5/0x130 [vboxdrv]
    [<00000000064e6217>] VBoxHost_RTMemAllocZTag+0x2a/0x70 [vboxdrv]
    [<00000000523d21fa>] rtR0MemObjNew+0x37/0x70 [vboxdrv]
    [<00000000df0eec39>] rtR0MemObjNativeMapKernel+0x57/0x140 [vboxdrv]
    [<000000008419dc13>] VBoxHost_RTR0MemObjMapKernelExTag+0x12d/0x1f0 [vboxdrv]
    [<00000000ec3fe3f7>] SUPR0PageMapKernel+0x1e2/0x270 [vboxdrv]
unreferenced object 0xffff88827c95b600 (size 128):
  comm "EMT-0", pid 4550, jiffies 4294918412 (age 94.496s)
  hex dump (first 32 bytes):
    19 01 09 18 01 00 00 80 58 00 00 00 58 00 00 00  ........X...X...
    10 12 61 19 58 00 00 00 08 00 00 00 00 00 00 00  ..a.X...........
  backtrace:
    [<000000008fe681f2>] rtR0MemAllocEx+0xc5/0x130 [vboxdrv]
    [<00000000064e6217>] VBoxHost_RTMemAllocZTag+0x2a/0x70 [vboxdrv]
    [<00000000523d21fa>] rtR0MemObjNew+0x37/0x70 [vboxdrv]
    [<00000000df0eec39>] rtR0MemObjNativeMapKernel+0x57/0x140 [vboxdrv]
    [<000000008419dc13>] VBoxHost_RTR0MemObjMapKernelExTag+0x12d/0x1f0 [vboxdrv]
    [<00000000ec3fe3f7>] SUPR0PageMapKernel+0x1e2/0x270 [vboxdrv]
unreferenced object 0xffff88827c95b680 (size 128):
  comm "EMT-0", pid 4550, jiffies 4294918412 (age 94.496s)
  hex dump (first 32 bytes):
    19 01 09 18 01 00 00 80 58 00 00 00 58 00 00 00  ........X...X...
    10 12 61 19 58 00 00 00 08 00 00 00 00 00 00 00  ..a.X...........
  backtrace:
    [<000000008fe681f2>] rtR0MemAllocEx+0xc5/0x130 [vboxdrv]
    [<00000000064e6217>] VBoxHost_RTMemAllocZTag+0x2a/0x70 [vboxdrv]
    [<00000000523d21fa>] rtR0MemObjNew+0x37/0x70 [vboxdrv]
    [<00000000df0eec39>] rtR0MemObjNativeMapKernel+0x57/0x140 [vboxdrv]
    [<000000008419dc13>] VBoxHost_RTR0MemObjMapKernelExTag+0x12d/0x1f0 [vboxdrv]
    [<00000000ec3fe3f7>] SUPR0PageMapKernel+0x1e2/0x270 [vboxdrv]
localhost:~ # 

To trigger this leak, load the GUI, start and stop a VM, and then close the GUI. Until the final step, the kmemleak scan is clean. Note, this is a real leak. If vboxdrv is unloaded, the backtrace info is lost. The first leaked block is reported as:

unreferenced object 0xffff88827c95b380 (size 128):
  comm "EMT-0", pid 4550, jiffies 4294918407 (age 1095.172s)
  hex dump (first 32 bytes):
    19 01 09 18 01 00 00 80 58 00 00 00 58 00 00 00  ........X...X...
    10 12 61 19 58 00 00 00 08 00 00 00 00 00 00 00  ..a.X...........
  backtrace:
    [<000000008fe681f2>] 0xffffffffa0c9fb05
    [<00000000064e6217>] 0xffffffffa0c9d82a
    [<00000000523d21fa>] 0xffffffffa0c9edd7
    [<00000000df0eec39>] 0xffffffffa0ca1067
    [<000000008419dc13>] 0xffffffffa0c9e55d
    [<00000000ec3fe3f7>] 0xffffffffa0c8c1b2

Attachments (1)

r0drv-memleak-fix.patch (529 bytes ) - added by aeichner 3 years ago.

Download all attachments as: .zip

Change History (2)

by aeichner, 3 years ago

Attachment: r0drv-memleak-fix.patch added

comment:1 by aeichner, 3 years ago

Thanks for the report, this should be fixed in the next maintenance release. The attached patch fixes the issue as well, would be great if you could try it out.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use