Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1483543 - quotacheck tool leaks memory when scanning ext file system directly
quotacheck tool leaks memory when scanning ext file system directly
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: quota (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Petr Pisar
Robin Hack
https://sourceforge.net/p/linuxquota/...
: Patch
Depends On:
Blocks: 1465904
  Show dependency treegraph
 
Reported: 2017-08-21 07:26 EDT by Petr Pisar
Modified: 2018-04-10 04:43 EDT (History)
2 users (show)

See Also:
Fixed In Version: quota-4.01-16.el7
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 04:42:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed fix (3.82 KB, patch)
2017-08-21 07:38 EDT, Petr Pisar
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0667 None None None 2018-04-10 04:43 EDT

  None (edit)
Description Petr Pisar 2017-08-21 07:26:57 EDT
Since quota-4.01-15.el7.x86_64, quotacheck tool uses direct scanning for ext4 file system. There are some memory leaks in the direct scanning feature:

# dd if=/dev/zero of=disk.img bs=1M count=40
# mkfs.ext4 -F disk.img
# mount -o loop,jqfmt=vfsv1,usrjquota=aquota.user disk.img /mnt/1
# valgrind --leak-check=yes quotacheck -f /mnt/1/
==8864== Memcheck, a memory error detector
==8864== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==8864== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==8864== Command: quotacheck -f /mnt/1/
==8864== 
==8864== 
==8864== HEAP SUMMARY:
==8864==     in use at exit: 25,099 bytes in 30 blocks
==8864==   total heap usage: 227 allocs, 197 frees, 72,131 bytes allocated
==8864== 
==8864== 1,392 (88 direct, 1,304 indirect) bytes in 1 blocks are definitely lost in loss record 19 of 23
==8864==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==8864==    by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x10DC36: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x10B095: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x52A0C04: (below main) (in /usr/lib64/libc-2.17.so)
==8864== 
==8864== 8,464 (144 direct, 8,320 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 23
==8864==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==8864==    by 0x4E5749D: ext2fs_open_inode_scan (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x10DC5F: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x10B095: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x52A0C04: (below main) (in /usr/lib64/libc-2.17.so)
==8864== 
==8864== 15,243 (88 direct, 15,155 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 23
==8864==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==8864==    by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x10DC08: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x10B095: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x52A0C04: (below main) (in /usr/lib64/libc-2.17.so)
==8864== 
==8864== LEAK SUMMARY:
==8864==    definitely lost: 320 bytes in 3 blocks
==8864==    indirectly lost: 24,779 bytes in 27 blocks
==8864==      possibly lost: 0 bytes in 0 blocks
==8864==    still reachable: 0 bytes in 0 blocks
==8864==         suppressed: 0 bytes in 0 blocks
==8864== 
==8864== For counts of detected and suppressed errors, rerun with: -v
==8864== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)

The same applies to ext2 and ext3 file systems. This is not a new bug, it just became more prominent as former quota packages did not use direct scanning on ext4.
Comment 2 Petr Pisar 2017-08-21 07:38 EDT
Created attachment 1316222 [details]
Proposed fix
Comment 8 errata-xmlrpc 2018-04-10 04:42:52 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0667

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