From owner-freebsd-bugs@freebsd.org Thu Sep 20 14:38:40 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76EEB109EA2C for ; Thu, 20 Sep 2018 14:38:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3958FCA2 for ; Thu, 20 Sep 2018 14:38:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id C44EF109EA2A; Thu, 20 Sep 2018 14:38:39 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88AF4109EA29 for ; Thu, 20 Sep 2018 14:38:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6C78FC9A for ; Thu, 20 Sep 2018 14:38:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 43AC015A9A for ; Thu, 20 Sep 2018 14:38:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w8KEccHc037152 for ; Thu, 20 Sep 2018 14:38:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w8KEccrL037151 for bugs@FreeBSD.org; Thu, 20 Sep 2018 14:38:38 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: Thu, 20 Sep 2018 14:38:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new 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: koue@chaosophia.net 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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2018 14:38:40 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231517 Bug ID: 231517 Summary: fts: causes error in valgrind Product: Base System Version: 11.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: koue@chaosophia.net Hi, Calling 'fts_close' immediately after 'fts_open' causes error in valgrind: $ valgrind --track-origins=3Dyes --tool=3Dmemcheck --leak-check=3Dyes --show-reachable=3Dyes ./ftstest =3D=3D76510=3D=3D Memcheck, a memory error detector =3D=3D76510=3D=3D Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward = et al. =3D=3D76510=3D=3D Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyr= ight info =3D=3D76510=3D=3D Command: ./ftstest =3D=3D76510=3D=3D=20 =3D=3D76510=3D=3D Conditional jump or move depends on uninitialised value(s) =3D=3D76510=3D=3D at 0x4EA2297: fts_close (in /lib/libc.so.7) =3D=3D76510=3D=3D by 0x4008D9: main (in /root/fts/ftstest) =3D=3D76510=3D=3D Uninitialised value was created by a heap allocation =3D=3D76510=3D=3D at 0x4C245B1: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) =3D=3D76510=3D=3D by 0x4EA1F01: fts_open (in /lib/libc.so.7) =3D=3D76510=3D=3D by 0x40089E: main (in /root/fts/ftstest) =3D=3D76510=3D=3D=20 =3D=3D76510=3D=3D=20 =3D=3D76510=3D=3D HEAP SUMMARY: =3D=3D76510=3D=3D in use at exit: 0 bytes in 0 blocks =3D=3D76510=3D=3D total heap usage: 5 allocs, 5 frees, 2,647 bytes alloca= ted =3D=3D76510=3D=3D=20 =3D=3D76510=3D=3D All heap blocks were freed -- no leaks are possible =3D=3D76510=3D=3D=20 =3D=3D76510=3D=3D For counts of detected and suppressed errors, rerun with:= -v =3D=3D76510=3D=3D ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 fr= om 0) ftstest.c =3D=3D=3D=3D=3D=3D=3D=3D=3D #include #include #include int main(void) { FTS *fts; FTSENT *e; char *path =3D "/etc"; char * const path_argv[] =3D { path, NULL }; if ((fts =3D fts_open(path_argv, FTS_LOGICAL, NULL)) =3D=3D NULL) { printf("fts_open error: %s\n", path); return (1); } fts_close(fts); return (0); } If 'fts_read' is called before 'fts_close' no complaints from vagrind. + while ((e =3D fts_read(fts)) !=3D NULL) { + printf("name: %s, mtime: %ld\n", e->fts_name, e->fts_statp->st_mtime); + } I don't know if its related but I found same issue in GNU maillist: https://lists.gnu.org/archive/html/bug-gnulib/2018-05/msg00117.html --=20 You are receiving this mail because: You are the assignee for the bug.=