From owner-freebsd-ports-bugs@freebsd.org Tue May 31 11:47:15 2016 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37665B535CD for ; Tue, 31 May 2016 11:47:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0E799130A for ; Tue, 31 May 2016 11:47:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u4VBlEqG084330 for ; Tue, 31 May 2016 11:47:14 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 209886] devel/valgrind: spurious invalid free() when using aligned_alloc() Date: Tue, 31 May 2016 11:47:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: fuz@fuz.su X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bdrewery@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name 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-ports-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 11:47:15 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209886 Bug ID: 209886 Summary: devel/valgrind: spurious invalid free() when using aligned_alloc() Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: bdrewery@FreeBSD.org Reporter: fuz@fuz.su Assignee: bdrewery@FreeBSD.org Flags: maintainer-feedback?(bdrewery@FreeBSD.org) The simple program #include int main() { free(aligned_alloc(8, 8)); return (0); } causes valgrind(1) to complain about a spurious invalid free(): =3D=3D1557=3D=3D Memcheck, a memory error detector =3D=3D1557=3D=3D Copyright (C) 2002-2013, and GNU GPL'd, by Julian Sewa= rd et al. =3D=3D1557=3D=3D Using Valgrind-3.10.1 and LibVEX; rerun with -h for co= pyright info =3D=3D1557=3D=3D Command: ./a =3D=3D1557=3D=3D=20 =3D=3D1557=3D=3D Invalid free() / delete / delete[] / realloc() =3D=3D1557=3D=3D at 0x4C232BC: free (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so) =3D=3D1557=3D=3D by 0x4007CB: main (in /tmp/a) =3D=3D1557=3D=3D Address 0x5806058 is not stack'd, malloc'd or (recent= ly) free'd =3D=3D1557=3D=3D=20 =3D=3D1557=3D=3D=20 =3D=3D1557=3D=3D HEAP SUMMARY: =3D=3D1557=3D=3D in use at exit: 0 bytes in 0 blocks =3D=3D1557=3D=3D total heap usage: 0 allocs, 1 frees, 0 bytes allocat= ed =3D=3D1557=3D=3D=20 =3D=3D1557=3D=3D All heap blocks were freed -- no leaks are possible =3D=3D1557=3D=3D=20 =3D=3D1557=3D=3D For counts of detected and suppressed errors, rerun wi= th: -v =3D=3D1557=3D=3D ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0= from 0) I suspect that valgrind doesn't properly intercept aligned_alloc(3) and thus doesn't recognize the address when it is passed to free(). This issue does not occu= r on Linux, I suspect it comes from the interaction between jemalloc(3) and valgrind. --=20 You are receiving this mail because: You are the assignee for the bug.=