From nobody Sat Apr 20 06:11:39 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VM1P92Jl4z5H77D for ; Sat, 20 Apr 2024 06:11:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VM1P91HzQz57kt for ; Sat, 20 Apr 2024 06:11:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713593501; a=rsa-sha256; cv=none; b=Xbnv3Vh3g41ex/quP+zEVRAolFXg66Hd5GvRUCiVqbNuNj85c4Xbte8LVc2GwNM3JOsbZi nJVxgjyMpvdemIjymjUCqUekWq07IvYxks/HmS6GMnJzSihMdbl6QeEHHi6uCnhiit7ZJJ NJ6g5yxEEz3iafy79LGtnUZhukzsdO9lJZZE6f8+rvMA+woDFhEsC9Pz/dK0EeBR6OF3Au fW0xbTEg6a4+qRdj6YTIQg0XIGtsZ1Uftu68AJpXnxDyBjzsnZtgTg8uIEmkgGq1A9Gn2y Zi0JYeOmLxL5KvEWSE5G1pdyzTJ/fcdJGUKyRv9dslqG1fjvBCBLIMLbcLiZFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713593501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dx2xu4/+pNmajXk4lcOwYvOZ9c/SD09StUyzc5yhZWA=; b=omaTq7FzioMFxJqnm8RZ5EbyWZmQMQa7PYRyFUDyXbssYe3fGjrEmyVtgsRFqNa935d1rX NdHkB8CBxtSD3pfjdhvgmvR5ygUpXInYOrtoaun1Kw59f8WcjVWqUquo/Ya26Ejw8md79H U8PElKFTjNB/yA6CVQdR5+05cRD8QDtX/DunRguk5BOCiqnzxHCWOqCgJdsgaAJKud9Cw4 XkqXoHVJx32rOMbGKvnUWjUjz1mZL+gDQ+gqwjP/qjvxgFxt4ZQJl+wAGf5puNjIw217iY rQ5eyInnPGtnw1vK2qeXSJrztL7TY8YawUWp1ZdEhIxJtBKjBii0w5vSvS0cUw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VM1P90pPHzQMT for ; Sat, 20 Apr 2024 06:11:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 43K6BfRw082602 for ; Sat, 20 Apr 2024 06:11:41 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43K6Bekl082590 for bugs@FreeBSD.org; Sat, 20 Apr 2024 06:11:40 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 278476] fd and memory leak in ls Date: Sat, 20 Apr 2024 06:11:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: pjfloyd@wanadoo.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278476 Bug ID: 278476 Summary: fd and memory leak in ls Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: pjfloyd@wanadoo.fr This is on 14.0-RELEASE amd64 (and arm64). I'm using Valgrind built from git head. If you use the package / ports version you will get one or two more 'still reachable' reports. If I run valgrind --leak-check=3Dfull --show-leak-kinds=3Dall --track-fds=3Dall ls then I get =3D=3D65577=3D=3D FILE DESCRIPTORS: 4 open (3 std) at exit. =3D=3D65577=3D=3D Open file descriptor 3: . =3D=3D65577=3D=3D at 0x49F0BCA: _open (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x4950AF8: fts_open (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10CA22: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D Open file descriptor 2: /dev/pts/3 =3D=3D65577=3D=3D =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D Open file descriptor 1: /dev/pts/3 =3D=3D65577=3D=3D =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D Open file descriptor 0: /dev/pts/3 =3D=3D65577=3D=3D =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D HEAP SUMMARY: =3D=3D65577=3D=3D in use at exit: 10,176 bytes in 5 blocks =3D=3D65577=3D=3D total heap usage: 141 allocs, 136 frees, 36,463 bytes a= llocated =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D 984 bytes in 1 blocks are still reachable in loss record = 1 of 5 =3D=3D65577=3D=3D at 0x4852321: realloc (vg_replace_malloc.c:1806) =3D=3D65577=3D=3D by 0x10EB7D: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10D78D: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10CBF4: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D 1,280 bytes in 1 blocks are indirectly lost in loss recor= d 2 of 5 =3D=3D65577=3D=3D at 0x4852613: reallocf (vg_replace_malloc.c:1808) =3D=3D65577=3D=3D by 0x49506CD: fts_open (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10CA22: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D 1,368 bytes in 1 blocks are indirectly lost in loss recor= d 3 of 5 =3D=3D65577=3D=3D at 0x4852613: reallocf (vg_replace_malloc.c:1808) =3D=3D65577=3D=3D by 0x4951BF3: ??? (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x4951FC5: fts_children (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10CBE3: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D 5,096 (2,448 direct, 2,648 indirect) bytes in 1 blocks ar= e definitely lost in loss record 5 of 5 =3D=3D65577=3D=3D at 0x4852105: calloc (vg_replace_malloc.c:1679) =3D=3D65577=3D=3D by 0x4950625: fts_open (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10CA22: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? =3D=3D65577=3D=3D=20 =3D=3D65577=3D=3D LEAK SUMMARY: =3D=3D65577=3D=3D definitely lost: 2,448 bytes in 1 blocks =3D=3D65577=3D=3D indirectly lost: 2,648 bytes in 2 blocks =3D=3D65577=3D=3D possibly lost: 0 bytes in 0 blocks =3D=3D65577=3D=3D still reachable: 984 bytes in 1 blocks =3D=3D65577=3D=3D suppressed: 4,096 bytes in 1 blocks Piece by piece that is The following is the leaking file descriptor =3D=3D65577=3D=3D Open file descriptor 3: . =3D=3D65577=3D=3D at 0x49F0BCA: _open (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x4950AF8: fts_open (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10CA22: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? I guess the following are allocations related to opening the file descripto= r. =3D=3D65577=3D=3D 1,280 bytes in 1 blocks are indirectly lost in loss recor= d 2 of 5 =3D=3D65577=3D=3D at 0x4852613: reallocf (vg_replace_malloc.c:1808) =3D=3D65577=3D=3D by 0x49506CD: fts_open (in /lib/libc.so.7) ... =3D=3D65577=3D=3D 1,368 bytes in 1 blocks are indirectly lost in loss recor= d 3 of 5 =3D=3D65577=3D=3D at 0x4852613: reallocf (vg_replace_malloc.c:1808) =3D=3D65577=3D=3D by 0x4951BF3: ??? (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x4951FC5: fts_children (in /lib/libc.so.7) I don't know what this is, possibly not related (if so another one for my wishlist https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259294) =3D=3D65577=3D=3D 984 bytes in 1 blocks are still reachable in loss record = 1 of 5 =3D=3D65577=3D=3D at 0x4852321: realloc (vg_replace_malloc.c:1806) =3D=3D65577=3D=3D by 0x10EB7D: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10D78D: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10CBF4: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x10C9D6: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x493CAF9: __libc_start1 (in /lib/libc.so.7) =3D=3D65577=3D=3D by 0x10BA6C: ??? (in /bin/ls) =3D=3D65577=3D=3D by 0x4823007: ??? --=20 You are receiving this mail because: You are the assignee for the bug.=