From nobody Thu Feb 15 12:31:35 2024 X-Original-To: threads@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 4TbDvW6qwhz53TDF for ; Thu, 15 Feb 2024 12:31:35 +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 4TbDvW56LNz57c6 for ; Thu, 15 Feb 2024 12:31:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708000295; a=rsa-sha256; cv=none; b=eiwRkumF8M/sj1xoIb36kXCsm65+sHgJD84SH6KskmHSqdtH8qL1yepbYunSuJDg8Z2pkb 3IcPpEhG+HOgVNXFDEzHniXk+zpuVxhCn5TKWdjTX8Px8I6VPhYyJIzO4DfOz1jsF0+C3t mCjrjyWki/8VZJs6w8yoYDkI84bQDGe4iU5UhBNhEg2bb0+VISlDEyrOeaFZrslPGWExxb o1CIMobSuK553PD53RiBS5H67M1mbWLoQKMKHC/8KSPidTTD45rViSqk/dVLtPzcKI/0+J fRvwyY851dKgMxzN6Wkmzn7pb/NaZrCoWX60qK3y50iMwtXpu2L+qEU7XeQfyg== 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=1708000295; 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=dloa2u/DGoNoMIPNmInC/cL8KEVoNTuUqj051rDztfo=; b=FUJYL0TC4HqwgeDVF7gapKwmwoEUxVI4GfAGdNNjTXWTTXMoAsL2TeslXgR+53F2cms+kI BRnXfB9fuB9Bes9ji7VWZs4QCR2KplhNzGlGK1NPyH3Xc1jj5tbZo35IH0yBk2Cr0/rpcf tR/EC63gqeBszLF/9tc+EZYc/6wFfSTReeq8UkdXyAETrC3/Aw+O2wot5vyM0Fsuxc9swG Gke8ZYVbPOX4H4tMzC9mHdcwHZHqITzZuzHNronNPwX0PYTAs+Q8zTCUIE/up/KQZpwMWu XKMfrelXQObIwz2Vib2/noQW2wgZb8TARBn7vyNensR6I8JqSvFzlwi/pF1jbQ== 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 4TbDvW49HvzhnZ for ; Thu, 15 Feb 2024 12:31:35 +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 41FCVZ7j062000 for ; Thu, 15 Feb 2024 12:31:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41FCVZcd061993 for threads@FreeBSD.org; Thu, 15 Feb 2024 12:31:35 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: threads@FreeBSD.org Subject: [Bug 277065] [libthr] reachable memory Date: Thu, 15 Feb 2024 12:31:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads 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: threads@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: Threading List-Archive: https://lists.freebsd.org/archives/freebsd-threads List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-threads@freebsd.org X-BeenThere: freebsd-threads@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277065 Bug ID: 277065 Summary: [libthr] reachable memory Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: threads Assignee: threads@FreeBSD.org Reporter: pjfloyd@wanadoo.fr This is a follow on from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276818 Using the same testcase I see two reachable allocations in Valgrind =3D=3D3215=3D=3D 64 bytes in 1 blocks are still reachable in loss record 2 = of 3 =3D=3D3215=3D=3D at 0x48518C5: calloc (vg_replace_malloc.c:1601) =3D=3D3215=3D=3D by 0x4C7C772: ??? (in /lib/libthr.so.3) =3D=3D3215=3D=3D by 0x4C75385: ??? (in /lib/libthr.so.3) =3D=3D3215=3D=3D by 0x4C743AE: ??? (in /lib/libthr.so.3) =3D=3D3215=3D=3D by 0x400ABFC: ??? (in /libexec/ld-elf.so.1) =3D=3D3215=3D=3D by 0x40098C8: ??? (in /libexec/ld-elf.so.1) =3D=3D3215=3D=3D by 0x4006B88: ??? (in /libexec/ld-elf.so.1) =3D=3D3215=3D=3D=20 =3D=3D3215=3D=3D 1,664 bytes in 1 blocks are still reachable in loss record= 3 of 3 =3D=3D3215=3D=3D at 0x48518C5: calloc (vg_replace_malloc.c:1601) =3D=3D3215=3D=3D by 0x4C75374: ??? (in /lib/libthr.so.3) =3D=3D3215=3D=3D by 0x4C743AE: ??? (in /lib/libthr.so.3) =3D=3D3215=3D=3D by 0x400ABFC: ??? (in /libexec/ld-elf.so.1) =3D=3D3215=3D=3D by 0x40098C8: ??? (in /libexec/ld-elf.so.1) =3D=3D3215=3D=3D by 0x4006B88: ??? (in /libexec/ld-elf.so.1) First problem (for me) is that Valgrind isn't reading debuginfo so I'm not seeing file and line number. In gdb if I put breakpoints on those addresses I see that they are 4 breakpoint keep y 0x0000000004c75374 in _thr_alloc at /usr/src/lib/libthr/thread/thr_list.c:154 5 breakpoint keep y 0x0000000004c7c772 in _sleepq_alloc at /usr/src/lib/libthr/thread/thr_sleepq.c:66 For some reason gdb doesn't stop on the breakpoints. And if gdb can get file and line number then so should Valgrind. The allocations are if (thread =3D=3D NULL) { if (total_threads > MAX_THREADS) return (NULL); atomic_fetchadd_int(&total_threads, 1); thread =3D calloc(1, sizeof(struct pthread)); if (thread =3D=3D NULL) { atomic_fetchadd_int(&total_threads, -1); return (NULL); } if ((thread->sleepqueue =3D _sleepq_alloc()) =3D=3D NULL || (thread->wake_addr =3D _thr_alloc_wake_addr()) =3D=3D N= ULL) { thr_destroy(curthread, thread); atomic_fetchadd_int(&total_threads, -1); return (NULL); } and struct sleepqueue * _sleepq_alloc(void) { struct sleepqueue *sq; sq =3D calloc(1, sizeof(struct sleepqueue)); TAILQ_INIT(&sq->sq_blocked); SLIST_INIT(&sq->sq_freeq); return (sq); } --=20 You are receiving this mail because: You are the assignee for the bug.=