Bug 172892 - kernel dm: dm-ioctl memory leak on attempt to load non-existing mapping
kernel dm: dm-ioctl memory leak on attempt to load non-existing mapping
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Brian Brock
Depends On:
Blocks: 168429
  Show dependency treegraph
Reported: 2005-11-10 16:19 EST by David Milburn
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2006-0132
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-07 15:40:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Milburn 2005-11-10 16:19:05 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7

Description of problem:
Customer found memory leak occurred when "dmsetup load" is executed for non-existing mapping.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run the dmsetup load command for non-existing map like below.
   # dmsetup remove foo
   # dd if=/dev/zero of=a bs=1M count=1
   # losetup /dev/loop7 a
   # while true; do echo "0 10 linear 7:7 0" | \
     dmsetup load foo >& /dev/null; done

2. Check the memory usage and the /var/log/messages.

Actual Results:  Memory usage will increase (about 3MB/s on my machine).
On IA-32, vmalloc area will soon become short (within about 1 minute)
and the following message will appear in the /var/log/messages:
Nov  9 13:33:31 nec-em2 kernel: device-mapper: device doesn't appear to be in the dev hash table.
Nov  9 13:34:02 nec-em2 last message repeated 10360 times
Nov  9 13:34:10 nec-em2 kernel: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.

Expected Results:  Memory shouldn't be leaked.

Additional info:

The following patch fixes this problem and it has been posted
to the upstream, accepted by Alasdair.

Comment 1 Alasdair Kergon 2005-11-14 13:08:38 EST
An error path in table_load() forgets to release a table that won't
now be referenced.
Comment 2 Alasdair Kergon 2005-11-14 13:11:48 EST
Comment 8 Red Hat Bugzilla 2006-03-07 15:40:14 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.