From nobody Wed Jun 08 19:17:50 2022 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 E39D2843CD0 for ; Wed, 8 Jun 2022 19:17:50 +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 4LJH7254z3z3LPS for ; Wed, 8 Jun 2022 19:17:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 8461D15998 for ; Wed, 8 Jun 2022 19:17:50 +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 258JHo8J032879 for ; Wed, 8 Jun 2022 19:17:50 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 258JHotH032878 for bugs@FreeBSD.org; Wed, 8 Jun 2022 19:17:50 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 231517] fts: causes error in valgrind Date: Wed, 08 Jun 2022 19:17:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.2-STABLE 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: Message-ID: In-Reply-To: References: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654715870; 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: in-reply-to:in-reply-to:references:references; bh=inewwVLlYadg/WR5+2zkaQPpVbg9ZbAsjSs7JuriWF4=; b=TFr5o9Eg/PAu6sa+SyK7ZB0LAlx0IXrRXYbEAZh31EvsfEX36qsFaGjZrpnhHoheCaVF5M +HeL31iPrwnuABpFCxJEQ3X2iES2tDvf6rcAfKRUQp5/AaU12dURqM3yBl9rOvtGwrnZ3a zUT72Rpazi1NA/1DwV7D/7x31gJGzk9ITd9QkZfK4yxdagl9Gi06jYbeaRBpDChZLM3Tiy S61FLN/PYE1MRg2a6cRfEzcQWSU9viZFppqILq+SC84ft5OxCYUMwdrh7cohQlO0OytxvT yLZSqSMnpR9EqMenn9SnJ98qX5Ef03WCa+oAybveikiDer/up0RLe32ykMb22A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654715870; a=rsa-sha256; cv=none; b=vf9DCsNPasctg5cbEz5brSBTlQEX3IWdrg90veQFX9N7y3d7sO1LyyhkJsz2qUIQQp1wPx WvgDO+S8UZUNxTOo7P5aTYSDHjOQiPYUaCxoWrIHFQsqDtmUl+6CbzMBw263K9kZUPkE9k r67EuO6MiDnf//9xUS502IpMg8CGFPKjfB0XdChMXysDXafspAgtshwsXRt9zq7F9FJRCg +VNvSympFC+F8a92SslkyiUnOJo/ldZ65vF50ZXkkqk9vQ8nD+XhWDU+hGsNApqj+4+0s3 77hTBZsvUqAmgawQTq3M63x1x0K3VUbhwuFdpxBA1+JGzuVcXnZVjvwKmkk1Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231517 --- Comment #1 from Paul Floyd --- With a debug build of libc I get =3D=3D1494=3D=3D Conditional jump or move depends on uninitialised value(s) =3D=3D1494=3D=3D at 0x48F29D7: fts_close (lib/libc/gen/fts.c:256) =3D=3D1494=3D=3D by 0x2019B6: main (ftstest.c:17) =3D=3D1494=3D=3D Uninitialised value was created by a heap allocation =3D=3D1494=3D=3D at 0x484CBC4: malloc (vg_replace_malloc.c:397) =3D=3D1494=3D=3D by 0x48F2606: fts_alloc (lib/libc/gen/fts.c:1022) =3D=3D1494=3D=3D by 0x48F2606: fts_open (lib/libc/gen/fts.c:195) =3D=3D1494=3D=3D by 0x20197E: main (ftstest.c:13) fts_open does this struct _fts_private *priv; if ((priv =3D calloc(1, sizeof(*priv))) =3D=3D NULL) return (NULL); sp =3D &priv->ftsp_fts; if ((sp->fts_cur =3D fts_alloc(sp, "", 0)) =3D=3D NULL) where the first member of _fts_private is FTS ftsp_fts; meaning p[riv and sp are equivalent addresses. And the error code is if (sp->fts_cur) { for (p =3D sp->fts_cur; p->fts_level >=3D FTS_ROOTLEVEL;) {= // ERROR It's what p points to that is not initialized: gdb) p p $5 =3D (FTSENT *) 0x54652d0 (gdb) p sizeof(*p) $6 =3D 152 (gdb) mo check_memory defined 0x54652d0 152 Address 0x54652D0 len 152 not defined: Uninitialised value at 0x54652D0 was created by a heap allocation =3D=3D1649=3D=3D at 0x484CBC4: malloc (vg_replace_malloc.c:397) =3D=3D1649=3D=3D by 0x48F2606: fts_alloc (lib/libc/gen/fts.c:1022) =3D=3D1649=3D=3D by 0x48F2606: fts_open (lib/libc/gen/fts.c:195) =3D=3D1649=3D=3D by 0x20197E: main (ftstest.c:13) Address 0x54652d0 is 0 bytes inside a block of size 377 alloc'd =3D=3D1649=3D=3D at 0x484CBC4: malloc (vg_replace_malloc.c:397) =3D=3D1649=3D=3D by 0x48F2606: fts_alloc (lib/libc/gen/fts.c:1022) =3D=3D1649=3D=3D by 0x48F2606: fts_open (lib/libc/gen/fts.c:195) =3D=3D1649=3D=3D by 0x20197E: main (ftstest.c:13) [using vgdb and the monitor command] As far as I'm concerned it's a bug in fts_open. --=20 You are receiving this mail because: You are the assignee for the bug.=