From unknown Sat Aug 16 18:32:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8755: "ls -l" leaks memory Resent-From: Ola Olsson Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 29 May 2011 01:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8755 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 8755@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.130663164427253 (code B ref -1); Sun, 29 May 2011 01:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 May 2011 01:14:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQUZu-00075W-Bh for submit@debbugs.gnu.org; Sat, 28 May 2011 21:14:03 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQTsT-00066Z-2X for submit@debbugs.gnu.org; Sat, 28 May 2011 20:29:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQTsM-0000oJ-Fg for submit@debbugs.gnu.org; Sat, 28 May 2011 20:29:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQTsM-0000oF-EF for submit@debbugs.gnu.org; Sat, 28 May 2011 20:29:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQTsK-0000JU-FY for bug-coreutils@gnu.org; Sat, 28 May 2011 20:29:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQTsJ-0000nr-0r for bug-coreutils@gnu.org; Sat, 28 May 2011 20:29:00 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:39964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQTsI-0000nn-Kc for bug-coreutils@gnu.org; Sat, 28 May 2011 20:28:58 -0400 Received: by wyf19 with SMTP id 19so2450010wyf.0 for ; Sat, 28 May 2011 17:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=RHEWDTyppureyD3f7fRLL/kGlAzfsb7PEAxKuAeN42s=; b=P1jYo3QI3qTLH8mlp4bqUK2lrXpRbVWTeMXn4zyIyayWuvCtUq9hIKu1U9581PpTT6 ZL+sqpM5xvCF4zhkGqYTXmFNMtIrfRJf9NxmQG0TifvB6jXeLf8sW1uGLkqKM96NMNhi ES1kbEw5rFJEi2FzsVklWcQJ4+pLkhxbSC7lk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Qtn+Rqn9YYWcwG172Q5ZUlIU6RigdqVVQNd09oFp/G+EnA1ZxCZp2E/x4sCrE5Yh7z qErNnAf4S52cBzNh64Gwn0Bkqq8eIwrnwafIayStXZPdG+3j2llHgU5ED3EFWyvnaKuJ 3CQcTLR8Yt2YYYMkUQC628lW1kho6dkEhcqW4= MIME-Version: 1.0 Received: by 10.216.221.30 with SMTP id q30mr3286638wep.84.1306628935617; Sat, 28 May 2011 17:28:55 -0700 (PDT) Received: by 10.216.138.229 with HTTP; Sat, 28 May 2011 17:28:55 -0700 (PDT) Date: Sun, 29 May 2011 02:28:55 +0200 Message-ID: From: Ola Olsson Content-Type: multipart/alternative; boundary=0016e659f0928f8e0a04a45f4196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Sat, 28 May 2011 21:14:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --0016e659f0928f8e0a04a45f4196 Content-Type: text/plain; charset=ISO-8859-1 According to valgrind, ls -l leaks memory. I have included the "coreutils version", "uname -a" information, Expected output from valgrind ("ls") and non-expected output ("ls -l"). My first bug report ever, please tell me if something is wrong. I am using a dell e4300 laptop, ola@ola-Latitude-E4300:~$ ls --version ls (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Richard M. Stallman and David MacKenzie. ola@ola-Latitude-E4300:~$ uname -a Linux ola-Latitude-E4300 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux ola@ola-Latitude-E4300:~$ valgrind --version valgrind-3.6.1 Good run: ola@ola-Latitude-E4300:~$ valgrind ls ==4039== Memcheck, a memory error detector ==4039== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==4039== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==4039== Command: ls ==4039== Desktop Documents Downloads examples.desktop Music Pictures Public Templates Videos WATCHDOG ==4039== ==4039== HEAP SUMMARY: ==4039== in use at exit: 21,805 bytes in 16 blocks ==4039== total heap usage: 51 allocs, 35 frees, 59,016 bytes allocated ==4039== ==4039== LEAK SUMMARY: ==4039== definitely lost: 0 bytes in 0 blocks ==4039== indirectly lost: 0 bytes in 0 blocks ==4039== possibly lost: 0 bytes in 0 blocks ==4039== still reachable: 21,805 bytes in 16 blocks ==4039== suppressed: 0 bytes in 0 blocks ==4039== Rerun with --leak-check=full to see details of leaked memory ==4039== ==4039== For counts of detected and suppressed errors, rerun with: -v ==4039== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4) Bad run: ola@ola-Latitude-E4300:~$ valgrind --leak-check=full ls -l ==4056== Memcheck, a memory error detector ==4056== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==4056== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==4056== Command: ls -l ==4056== total 40 drwxr-xr-x 4 ola ola 4096 2011-05-28 18:56 Desktop drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Documents drwxr-xr-x 2 ola ola 4096 2011-05-28 07:41 Downloads -rw-r--r-- 1 ola ola 179 2011-05-25 20:26 examples.desktop drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Music drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Pictures drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Public drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Templates drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Videos -rw-r--r-- 1 ola ola 2278 2011-05-26 08:52 WATCHDOG ==4056== ==4056== HEAP SUMMARY: ==4056== in use at exit: 20,285 bytes in 38 blocks ==4056== total heap usage: 198 allocs, 160 frees, 80,622 bytes allocated ==4056== ==4056== 300 (60 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 27 of 29 ==4056== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4056== by 0x5556396: nss_parse_service_list (nsswitch.c:626) ==4056== by 0x5556948: __nss_database_lookup (nsswitch.c:167) ==4056== by 0x68A6553: ??? ==4056== by 0x550992C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256) ==4056== by 0x550921E: getpwuid (getXXbyYY.c:117) ==4056== by 0x40D4A9: ??? (in /bin/ls) ==4056== by 0x402D52: ??? (in /bin/ls) ==4056== by 0x40674F: ??? (in /bin/ls) ==4056== by 0x4081B0: ??? (in /bin/ls) ==4056== by 0x547BEFE: (below main) (libc-start.c:226) ==4056== ==4056== 300 (60 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 28 of 29 ==4056== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4056== by 0x5556396: nss_parse_service_list (nsswitch.c:626) ==4056== by 0x5556948: __nss_database_lookup (nsswitch.c:167) ==4056== by 0x68A451B: ??? ==4056== by 0x5507F0C: getgrgid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256) ==4056== by 0x550765E: getgrgid (getXXbyYY.c:117) ==4056== by 0x40D649: ??? (in /bin/ls) ==4056== by 0x4067E5: ??? (in /bin/ls) ==4056== by 0x4081B0: ??? (in /bin/ls) ==4056== by 0x547BEFE: (below main) (libc-start.c:226) ==4056== ==4056== LEAK SUMMARY: ==4056== definitely lost: 120 bytes in 2 blocks ==4056== indirectly lost: 480 bytes in 20 blocks ==4056== possibly lost: 0 bytes in 0 blocks ==4056== still reachable: 19,685 bytes in 16 blocks ==4056== suppressed: 0 bytes in 0 blocks ==4056== Reachable blocks (those to which a pointer was found) are not shown. ==4056== To see them, rerun with: --leak-check=full --show-reachable=yes ==4056== ==4056== For counts of detected and suppressed errors, rerun with: -v ==4056== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 from 4) ola@ola-Latitude-E4300:~$ /Ola --0016e659f0928f8e0a04a45f4196 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable According to valgrind, ls -= l leaks memory. I have included the "coreutils version", "un= ame -a" information, Expected output from valgrind ("ls") an= d non-expected output ("ls -l").
My first bug report ever, please tell me if something is wrong. I am using = a dell e4300 laptop,

ola@ola-Latitude-E4300:~$ ls --version
ls (G= NU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free = software: you are free to change and redistribute it.
There is NO WARRAN= TY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.

ola@ola-Lati= tude-E4300:~$ uname -a
Linux ola-Latitude-E4300 2.6.38-8-generic #42-Ubu= ntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
ola@ola-Latitude-E4300:~$ valgrind --version
valgrind-3.6.1

Good = run:
ola@ola-Latitude-E4300:~$ valgrind ls
=3D=3D4039=3D=3D Memcheck,= a memory error detector
=3D=3D4039=3D=3D Copyright (C) 2002-2010, and G= NU GPL'd, by Julian Seward et al.
=3D=3D4039=3D=3D Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyrig= ht info
=3D=3D4039=3D=3D Command: ls
=3D=3D4039=3D=3D
Desktop=A0 = Documents=A0 Downloads=A0 examples.desktop=A0 Music=A0=A0=A0 Pictures=A0 Pu= blic=A0 Templates=A0 Videos=A0 WATCHDOG
=3D=3D4039=3D=3D
=3D=3D4039=3D=3D HEAP SUMMARY:
=3D=3D4039=3D=3D=A0= =A0=A0=A0 in use at exit: 21,805 bytes in 16 blocks
=3D=3D4039=3D=3D=A0= =A0 total heap usage: 51 allocs, 35 frees, 59,016 bytes allocated
=3D=3D= 4039=3D=3D
=3D=3D4039=3D=3D LEAK SUMMARY:
=3D=3D4039=3D=3D=A0=A0=A0 = definitely lost: 0 bytes in 0 blocks
=3D=3D4039=3D=3D=A0=A0=A0 indirectly lost: 0 bytes in 0 blocks
=3D=3D403= 9=3D=3D=A0=A0=A0=A0=A0 possibly lost: 0 bytes in 0 blocks
=3D=3D4039=3D= =3D=A0=A0=A0 still reachable: 21,805 bytes in 16 blocks
=3D=3D4039=3D=3D= =A0=A0=A0=A0=A0=A0=A0=A0 suppressed: 0 bytes in 0 blocks
=3D=3D4039=3D= =3D Rerun with --leak-check=3Dfull to see details of leaked memory
=3D=3D4039=3D=3D
=3D=3D4039=3D=3D For counts of detected and suppressed= errors, rerun with: -v
=3D=3D4039=3D=3D ERROR SUMMARY: 0 errors from 0 = contexts (suppressed: 4 from 4)


Bad run:
ola@ola-Latitude-E43= 00:~$ valgrind --leak-check=3Dfull ls -l
=3D=3D4056=3D=3D Memcheck, a memory error detector
=3D=3D4056=3D=3D Copy= right (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
=3D=3D40= 56=3D=3D Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info<= br>=3D=3D4056=3D=3D Command: ls -l
=3D=3D4056=3D=3D
total 40
drwxr-xr-x 4 ola ola 4096 2011-05-28 18:56= Desktop
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Documents
drwxr-x= r-x 2 ola ola 4096 2011-05-28 07:41 Downloads
-rw-r--r-- 1 ola ola=A0 17= 9 2011-05-25 20:26 examples.desktop
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Music
drwxr-xr-x 2 ola ola 40= 96 2011-05-25 20:31 Pictures
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 = Public
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Templates
drwxr-xr-= x 2 ola ola 4096 2011-05-25 20:31 Videos
-rw-r--r-- 1 ola ola 2278 2011-05-26 08:52 WATCHDOG
=3D=3D4056=3D=3D =3D=3D4056=3D=3D HEAP SUMMARY:
=3D=3D4056=3D=3D=A0=A0=A0=A0 in use at e= xit: 20,285 bytes in 38 blocks
=3D=3D4056=3D=3D=A0=A0 total heap usage: = 198 allocs, 160 frees, 80,622 bytes allocated
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D 300 (60 direct, 240 indirect) bytes i= n 1 blocks are definitely lost in loss record 27 of 29
=3D=3D4056=3D=3D= =A0=A0=A0 at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
=3D=3D4056=3D= =3D=A0=A0=A0 by 0x5556396: nss_parse_service_list (nsswitch.c:626)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x5556948: __nss_database_lookup (nsswitch.c:1= 67)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x68A6553: ???
=3D=3D4056=3D=3D=A0= =A0=A0 by 0x550992C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256)
=3D=3D4= 056=3D=3D=A0=A0=A0 by 0x550921E: getpwuid (getXXbyYY.c:117)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x40D4A9: ??? (in /bin/ls)
=3D=3D4056=3D=3D= =A0=A0=A0 by 0x402D52: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x4= 0674F: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x4081B0: ??? (in /= bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x547BEFE: (below main) (libc-start= .c:226)
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D 300 (60 direct, 240 indirect) bytes i= n 1 blocks are definitely lost in loss record 28 of 29
=3D=3D4056=3D=3D= =A0=A0=A0 at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
=3D=3D4056=3D= =3D=A0=A0=A0 by 0x5556396: nss_parse_service_list (nsswitch.c:626)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x5556948: __nss_database_lookup (nsswitch.c:1= 67)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x68A451B: ???
=3D=3D4056=3D=3D=A0= =A0=A0 by 0x5507F0C: getgrgid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256)
=3D=3D4= 056=3D=3D=A0=A0=A0 by 0x550765E: getgrgid (getXXbyYY.c:117)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x40D649: ??? (in /bin/ls)
=3D=3D4056=3D=3D= =A0=A0=A0 by 0x4067E5: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x4= 081B0: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x547BEFE: (below m= ain) (libc-start.c:226)
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D LEAK SUMMA= RY:
=3D=3D4056=3D=3D=A0=A0=A0 definitely lost: 120 bytes in 2 blocks
=3D=3D4= 056=3D=3D=A0=A0=A0 indirectly lost: 480 bytes in 20 blocks
=3D=3D4056=3D= =3D=A0=A0=A0=A0=A0 possibly lost: 0 bytes in 0 blocks
=3D=3D4056=3D=3D= =A0=A0=A0 still reachable: 19,685 bytes in 16 blocks
=3D=3D4056=3D=3D=A0= =A0=A0=A0=A0=A0=A0=A0 suppressed: 0 bytes in 0 blocks
=3D=3D4056=3D=3D Reachable blocks (those to which a pointer was found) are = not shown.
=3D=3D4056=3D=3D To see them, rerun with: --leak-check=3Dfull= --show-reachable=3Dyes
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D For counts= of detected and suppressed errors, rerun with: -v
=3D=3D4056=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 fro= m 4)
ola@ola-Latitude-E4300:~$

/Ola
--0016e659f0928f8e0a04a45f4196-- From unknown Sat Aug 16 18:32:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ola Olsson Subject: bug#8755: closed (Re: bug#8755: "ls -l" leaks memory) Message-ID: References: <4DE2D392.5010801@draigBrady.com> X-Gnu-PR-Message: they-closed 8755 X-Gnu-PR-Package: coreutils Reply-To: 8755@debbugs.gnu.org Date: Sun, 29 May 2011 23:19:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1306711142-24930-1" This is a multi-part message in MIME format... ------------=_1306711142-24930-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8755: "ls -l" leaks memory which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8755@debbugs.gnu.org. --=20 8755: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8755 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1306711142-24930-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8755-done) by debbugs.gnu.org; 29 May 2011 23:18:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQpFJ-0006T5-Bv for submit@debbugs.gnu.org; Sun, 29 May 2011 19:18:09 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QQpFD-0006SY-LC for 8755-done@debbugs.gnu.org; Sun, 29 May 2011 19:18:07 -0400 Received: (qmail 30530 invoked from network); 29 May 2011 23:17:57 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 29 May 2011 23:17:57 -0000 Message-ID: <4DE2D392.5010801@draigBrady.com> Date: Mon, 30 May 2011 00:15:30 +0100 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Ola Olsson Subject: Re: bug#8755: "ls -l" leaks memory References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8755-done Cc: 8755-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 29/05/11 01:28, Ola Olsson wrote: > According to valgrind, ls -l leaks memory. I have > included the "coreutils version", "uname -a" information, Expected output > from valgrind ("ls") and non-expected output ("ls -l"). ls does leak but inconsequentially. Explicitly freeing the memory would only waste time managing the heap just before we'd exit anyway. cheers, Pádraig. ------------=_1306711142-24930-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 May 2011 01:14:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQUZu-00075W-Bh for submit@debbugs.gnu.org; Sat, 28 May 2011 21:14:03 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQTsT-00066Z-2X for submit@debbugs.gnu.org; Sat, 28 May 2011 20:29:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQTsM-0000oJ-Fg for submit@debbugs.gnu.org; Sat, 28 May 2011 20:29:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQTsM-0000oF-EF for submit@debbugs.gnu.org; Sat, 28 May 2011 20:29:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:35629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQTsK-0000JU-FY for bug-coreutils@gnu.org; Sat, 28 May 2011 20:29:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQTsJ-0000nr-0r for bug-coreutils@gnu.org; Sat, 28 May 2011 20:29:00 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:39964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQTsI-0000nn-Kc for bug-coreutils@gnu.org; Sat, 28 May 2011 20:28:58 -0400 Received: by wyf19 with SMTP id 19so2450010wyf.0 for ; Sat, 28 May 2011 17:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=RHEWDTyppureyD3f7fRLL/kGlAzfsb7PEAxKuAeN42s=; b=P1jYo3QI3qTLH8mlp4bqUK2lrXpRbVWTeMXn4zyIyayWuvCtUq9hIKu1U9581PpTT6 ZL+sqpM5xvCF4zhkGqYTXmFNMtIrfRJf9NxmQG0TifvB6jXeLf8sW1uGLkqKM96NMNhi ES1kbEw5rFJEi2FzsVklWcQJ4+pLkhxbSC7lk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Qtn+Rqn9YYWcwG172Q5ZUlIU6RigdqVVQNd09oFp/G+EnA1ZxCZp2E/x4sCrE5Yh7z qErNnAf4S52cBzNh64Gwn0Bkqq8eIwrnwafIayStXZPdG+3j2llHgU5ED3EFWyvnaKuJ 3CQcTLR8Yt2YYYMkUQC628lW1kho6dkEhcqW4= MIME-Version: 1.0 Received: by 10.216.221.30 with SMTP id q30mr3286638wep.84.1306628935617; Sat, 28 May 2011 17:28:55 -0700 (PDT) Received: by 10.216.138.229 with HTTP; Sat, 28 May 2011 17:28:55 -0700 (PDT) Date: Sun, 29 May 2011 02:28:55 +0200 Message-ID: Subject: "ls -l" leaks memory From: Ola Olsson To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=0016e659f0928f8e0a04a45f4196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 28 May 2011 21:14:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --0016e659f0928f8e0a04a45f4196 Content-Type: text/plain; charset=ISO-8859-1 According to valgrind, ls -l leaks memory. I have included the "coreutils version", "uname -a" information, Expected output from valgrind ("ls") and non-expected output ("ls -l"). My first bug report ever, please tell me if something is wrong. I am using a dell e4300 laptop, ola@ola-Latitude-E4300:~$ ls --version ls (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Richard M. Stallman and David MacKenzie. ola@ola-Latitude-E4300:~$ uname -a Linux ola-Latitude-E4300 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux ola@ola-Latitude-E4300:~$ valgrind --version valgrind-3.6.1 Good run: ola@ola-Latitude-E4300:~$ valgrind ls ==4039== Memcheck, a memory error detector ==4039== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==4039== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==4039== Command: ls ==4039== Desktop Documents Downloads examples.desktop Music Pictures Public Templates Videos WATCHDOG ==4039== ==4039== HEAP SUMMARY: ==4039== in use at exit: 21,805 bytes in 16 blocks ==4039== total heap usage: 51 allocs, 35 frees, 59,016 bytes allocated ==4039== ==4039== LEAK SUMMARY: ==4039== definitely lost: 0 bytes in 0 blocks ==4039== indirectly lost: 0 bytes in 0 blocks ==4039== possibly lost: 0 bytes in 0 blocks ==4039== still reachable: 21,805 bytes in 16 blocks ==4039== suppressed: 0 bytes in 0 blocks ==4039== Rerun with --leak-check=full to see details of leaked memory ==4039== ==4039== For counts of detected and suppressed errors, rerun with: -v ==4039== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4) Bad run: ola@ola-Latitude-E4300:~$ valgrind --leak-check=full ls -l ==4056== Memcheck, a memory error detector ==4056== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==4056== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==4056== Command: ls -l ==4056== total 40 drwxr-xr-x 4 ola ola 4096 2011-05-28 18:56 Desktop drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Documents drwxr-xr-x 2 ola ola 4096 2011-05-28 07:41 Downloads -rw-r--r-- 1 ola ola 179 2011-05-25 20:26 examples.desktop drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Music drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Pictures drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Public drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Templates drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Videos -rw-r--r-- 1 ola ola 2278 2011-05-26 08:52 WATCHDOG ==4056== ==4056== HEAP SUMMARY: ==4056== in use at exit: 20,285 bytes in 38 blocks ==4056== total heap usage: 198 allocs, 160 frees, 80,622 bytes allocated ==4056== ==4056== 300 (60 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 27 of 29 ==4056== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4056== by 0x5556396: nss_parse_service_list (nsswitch.c:626) ==4056== by 0x5556948: __nss_database_lookup (nsswitch.c:167) ==4056== by 0x68A6553: ??? ==4056== by 0x550992C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256) ==4056== by 0x550921E: getpwuid (getXXbyYY.c:117) ==4056== by 0x40D4A9: ??? (in /bin/ls) ==4056== by 0x402D52: ??? (in /bin/ls) ==4056== by 0x40674F: ??? (in /bin/ls) ==4056== by 0x4081B0: ??? (in /bin/ls) ==4056== by 0x547BEFE: (below main) (libc-start.c:226) ==4056== ==4056== 300 (60 direct, 240 indirect) bytes in 1 blocks are definitely lost in loss record 28 of 29 ==4056== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==4056== by 0x5556396: nss_parse_service_list (nsswitch.c:626) ==4056== by 0x5556948: __nss_database_lookup (nsswitch.c:167) ==4056== by 0x68A451B: ??? ==4056== by 0x5507F0C: getgrgid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256) ==4056== by 0x550765E: getgrgid (getXXbyYY.c:117) ==4056== by 0x40D649: ??? (in /bin/ls) ==4056== by 0x4067E5: ??? (in /bin/ls) ==4056== by 0x4081B0: ??? (in /bin/ls) ==4056== by 0x547BEFE: (below main) (libc-start.c:226) ==4056== ==4056== LEAK SUMMARY: ==4056== definitely lost: 120 bytes in 2 blocks ==4056== indirectly lost: 480 bytes in 20 blocks ==4056== possibly lost: 0 bytes in 0 blocks ==4056== still reachable: 19,685 bytes in 16 blocks ==4056== suppressed: 0 bytes in 0 blocks ==4056== Reachable blocks (those to which a pointer was found) are not shown. ==4056== To see them, rerun with: --leak-check=full --show-reachable=yes ==4056== ==4056== For counts of detected and suppressed errors, rerun with: -v ==4056== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 from 4) ola@ola-Latitude-E4300:~$ /Ola --0016e659f0928f8e0a04a45f4196 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable According to valgrind, ls -= l leaks memory. I have included the "coreutils version", "un= ame -a" information, Expected output from valgrind ("ls") an= d non-expected output ("ls -l").
My first bug report ever, please tell me if something is wrong. I am using = a dell e4300 laptop,

ola@ola-Latitude-E4300:~$ ls --version
ls (G= NU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free = software: you are free to change and redistribute it.
There is NO WARRAN= TY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.

ola@ola-Lati= tude-E4300:~$ uname -a
Linux ola-Latitude-E4300 2.6.38-8-generic #42-Ubu= ntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
ola@ola-Latitude-E4300:~$ valgrind --version
valgrind-3.6.1

Good = run:
ola@ola-Latitude-E4300:~$ valgrind ls
=3D=3D4039=3D=3D Memcheck,= a memory error detector
=3D=3D4039=3D=3D Copyright (C) 2002-2010, and G= NU GPL'd, by Julian Seward et al.
=3D=3D4039=3D=3D Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyrig= ht info
=3D=3D4039=3D=3D Command: ls
=3D=3D4039=3D=3D
Desktop=A0 = Documents=A0 Downloads=A0 examples.desktop=A0 Music=A0=A0=A0 Pictures=A0 Pu= blic=A0 Templates=A0 Videos=A0 WATCHDOG
=3D=3D4039=3D=3D
=3D=3D4039=3D=3D HEAP SUMMARY:
=3D=3D4039=3D=3D=A0= =A0=A0=A0 in use at exit: 21,805 bytes in 16 blocks
=3D=3D4039=3D=3D=A0= =A0 total heap usage: 51 allocs, 35 frees, 59,016 bytes allocated
=3D=3D= 4039=3D=3D
=3D=3D4039=3D=3D LEAK SUMMARY:
=3D=3D4039=3D=3D=A0=A0=A0 = definitely lost: 0 bytes in 0 blocks
=3D=3D4039=3D=3D=A0=A0=A0 indirectly lost: 0 bytes in 0 blocks
=3D=3D403= 9=3D=3D=A0=A0=A0=A0=A0 possibly lost: 0 bytes in 0 blocks
=3D=3D4039=3D= =3D=A0=A0=A0 still reachable: 21,805 bytes in 16 blocks
=3D=3D4039=3D=3D= =A0=A0=A0=A0=A0=A0=A0=A0 suppressed: 0 bytes in 0 blocks
=3D=3D4039=3D= =3D Rerun with --leak-check=3Dfull to see details of leaked memory
=3D=3D4039=3D=3D
=3D=3D4039=3D=3D For counts of detected and suppressed= errors, rerun with: -v
=3D=3D4039=3D=3D ERROR SUMMARY: 0 errors from 0 = contexts (suppressed: 4 from 4)


Bad run:
ola@ola-Latitude-E43= 00:~$ valgrind --leak-check=3Dfull ls -l
=3D=3D4056=3D=3D Memcheck, a memory error detector
=3D=3D4056=3D=3D Copy= right (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
=3D=3D40= 56=3D=3D Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info<= br>=3D=3D4056=3D=3D Command: ls -l
=3D=3D4056=3D=3D
total 40
drwxr-xr-x 4 ola ola 4096 2011-05-28 18:56= Desktop
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Documents
drwxr-x= r-x 2 ola ola 4096 2011-05-28 07:41 Downloads
-rw-r--r-- 1 ola ola=A0 17= 9 2011-05-25 20:26 examples.desktop
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Music
drwxr-xr-x 2 ola ola 40= 96 2011-05-25 20:31 Pictures
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 = Public
drwxr-xr-x 2 ola ola 4096 2011-05-25 20:31 Templates
drwxr-xr-= x 2 ola ola 4096 2011-05-25 20:31 Videos
-rw-r--r-- 1 ola ola 2278 2011-05-26 08:52 WATCHDOG
=3D=3D4056=3D=3D =3D=3D4056=3D=3D HEAP SUMMARY:
=3D=3D4056=3D=3D=A0=A0=A0=A0 in use at e= xit: 20,285 bytes in 38 blocks
=3D=3D4056=3D=3D=A0=A0 total heap usage: = 198 allocs, 160 frees, 80,622 bytes allocated
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D 300 (60 direct, 240 indirect) bytes i= n 1 blocks are definitely lost in loss record 27 of 29
=3D=3D4056=3D=3D= =A0=A0=A0 at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
=3D=3D4056=3D= =3D=A0=A0=A0 by 0x5556396: nss_parse_service_list (nsswitch.c:626)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x5556948: __nss_database_lookup (nsswitch.c:1= 67)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x68A6553: ???
=3D=3D4056=3D=3D=A0= =A0=A0 by 0x550992C: getpwuid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256)
=3D=3D4= 056=3D=3D=A0=A0=A0 by 0x550921E: getpwuid (getXXbyYY.c:117)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x40D4A9: ??? (in /bin/ls)
=3D=3D4056=3D=3D= =A0=A0=A0 by 0x402D52: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x4= 0674F: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x4081B0: ??? (in /= bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x547BEFE: (below main) (libc-start= .c:226)
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D 300 (60 direct, 240 indirect) bytes i= n 1 blocks are definitely lost in loss record 28 of 29
=3D=3D4056=3D=3D= =A0=A0=A0 at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
=3D=3D4056=3D= =3D=A0=A0=A0 by 0x5556396: nss_parse_service_list (nsswitch.c:626)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x5556948: __nss_database_lookup (nsswitch.c:1= 67)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x68A451B: ???
=3D=3D4056=3D=3D=A0= =A0=A0 by 0x5507F0C: getgrgid_r@@GLIBC_2.2.5 (getXXbyYY_r.c:256)
=3D=3D4= 056=3D=3D=A0=A0=A0 by 0x550765E: getgrgid (getXXbyYY.c:117)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x40D649: ??? (in /bin/ls)
=3D=3D4056=3D=3D= =A0=A0=A0 by 0x4067E5: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x4= 081B0: ??? (in /bin/ls)
=3D=3D4056=3D=3D=A0=A0=A0 by 0x547BEFE: (below m= ain) (libc-start.c:226)
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D LEAK SUMMA= RY:
=3D=3D4056=3D=3D=A0=A0=A0 definitely lost: 120 bytes in 2 blocks
=3D=3D4= 056=3D=3D=A0=A0=A0 indirectly lost: 480 bytes in 20 blocks
=3D=3D4056=3D= =3D=A0=A0=A0=A0=A0 possibly lost: 0 bytes in 0 blocks
=3D=3D4056=3D=3D= =A0=A0=A0 still reachable: 19,685 bytes in 16 blocks
=3D=3D4056=3D=3D=A0= =A0=A0=A0=A0=A0=A0=A0 suppressed: 0 bytes in 0 blocks
=3D=3D4056=3D=3D Reachable blocks (those to which a pointer was found) are = not shown.
=3D=3D4056=3D=3D To see them, rerun with: --leak-check=3Dfull= --show-reachable=3Dyes
=3D=3D4056=3D=3D
=3D=3D4056=3D=3D For counts= of detected and suppressed errors, rerun with: -v
=3D=3D4056=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 fro= m 4)
ola@ola-Latitude-E4300:~$

/Ola
--0016e659f0928f8e0a04a45f4196-- ------------=_1306711142-24930-1-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 31 04:01:25 2011 Received: (at control) by debbugs.gnu.org; 31 May 2011 08:01:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRJtF-0007NW-Bq for submit@debbugs.gnu.org; Tue, 31 May 2011 04:01:25 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRJtD-0007NK-J7 for control@debbugs.gnu.org; Tue, 31 May 2011 04:01:23 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 2005160060; Tue, 31 May 2011 10:01:18 +0200 (CEST) From: Jim Meyering To: control@debbugs.gnu.org Subject: notabug Date: Tue, 31 May 2011 10:01:17 +0200 Message-ID: <87fwnvjo36.fsf@rho.meyering.net> Lines: 2 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) tags 8755 notabug thanks