From nobody Sat Nov 16 12:03:12 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 4XrCFr4s2vz5dFXT for ; Sat, 16 Nov 2024 12:03:12 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XrCFr2R0wz545q for ; Sat, 16 Nov 2024 12:03:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731758592; 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=VZcQi5lA62ogq73YtPqUsJa4B9AN/sDiVklOe59NfRs=; b=ITpnwKoUnM40U1YKbVarDf9KuWHFi2LWzc59ew0mu8H2X839+nF56dEe31CNDebbYizAzG e+d0Tpfbzavb2eyMQhEOl3OJI9sTwFn14eHH3FeHbztfNlRTA8PNGH3YnW8Q/K0q0yU/LX YDT1ZYprYlgpGLFbSvYU3bzbYTLPIgUKbKz3wWXipVSIX156mDV90wLRobP4RHTrXyml/1 x6zrgQ7SzRBll2sw2cG02FshMMh68dyvEp4u4X1kWifBmqtKGcVFBObvrse8wcwVla6VFP tJ1A5Tx84MMpNJVHGz44t4yoLJHej3t66Xd2IQtcuLvd5mdI1mtFVl8QnEQA0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731758592; a=rsa-sha256; cv=none; b=xQ58vaE4ip+ZWbSKnf/LaRK9rOW2pIb2IIoF3cgmmqklOf2FPGQi9sfqPLqd8tfJ9TKrJX 5HYd4YaaV+azfCGFdW2toWpGRgcvCoF6ghPdyHIUv9U2bdyC8V/YUaj/cbUTL0Y/eP1jFd g6nXhvonVgaSqm1THWJLTHIA+uNzpoEuMq76cH8dRo1MJcxfJcCob3IOz1OfjUgEDy0nj0 Ij19czxTokWVLUBLtcIKETSEjOIb3XvPiSDED1PM9qw55tsPhIotT7lK7kxThLm0FcrE8B ISDPmKcTgNKlVdxGF9t/SFNq5Ji+flRAC61pWVtuwUoerd2CVnhF7Xmhw6lc6Q== 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 4XrCFr21mgz14sW for ; Sat, 16 Nov 2024 12:03:12 +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 4AGC3CNr059551 for ; Sat, 16 Nov 2024 12:03:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4AGC3CqD059550 for threads@FreeBSD.org; Sat, 16 Nov 2024 12:03:12 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 282794] TSAN false positive Date: Sat, 16 Nov 2024 12:03:12 +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.1-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: X-BeenThere: freebsd-threads@freebsd.org Sender: owner-freebsd-threads@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282794 Bug ID: 282794 Summary: TSAN false positive Product: Base System Version: 14.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: threads Assignee: threads@FreeBSD.org Reporter: pjfloyd@wanadoo.fr This example contains one genuine thread hazard. #include #include int main() { char counter =3D 0; auto future1 =3D std::async(std::launch::async, [&]() { counter++; }); auto future2 =3D std::async(std::launch::async, [&]() { return counter; }); future1.wait(); // Cast to int to print it as a numerical value rather than a character std::cout << (int)future2.get(); } (just "clang++ -g -o test test.cpp -pthread" to build it). As well as the genuine error I also get WARNING: ThreadSanitizer: data race (pid=3D77285) Write of size 8 at 0x000803b17008 by thread T2: #0 memset /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_co= mmon_interceptors_memintrinsics.inc:87:3 (test1+0x27a626) #1 __crt_calloc /usr/src/libexec/rtld-elf/rtld_malloc.c:168:3 (libthr.so.3+0x1e4f6) #2 std::__1::__thread_specific_ptr::set_pointer(std= ::__1::__thread_struct*) /usr/include/c++/v1/__thread/thread.h:111:3 (bt1+0x2dd3b4) #3 void* std::__1::__thread_proxy[abi:se180100]>, void (std::__1::__async_assoc_state>::*)= (), std::__1::__async_assoc_state>*>>(void*) /usr/include/c++/v1/__thread/thread.h:200:25 (bt1+0x2db9bc) Previous write of size 8 at 0x000803b17008 by thread T1: #0 memset /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_co= mmon_interceptors_memintrinsics.inc:87:3 (bt1+0x27a626) #1 __crt_calloc /usr/src/libexec/rtld-elf/rtld_malloc.c:168:3 (libthr.so.3+0x1e4f6) #2 std::__1::__thread_specific_ptr::set_pointer(std= ::__1::__thread_struct*) /usr/include/c++/v1/__thread/thread.h:111:3 (bt1+0x2dd3b4) #3 void* std::__1::__thread_proxy[abi:se180100]>, void (std::__1::__async_assoc_state>::*)= (), std::__1::__async_assoc_state>*>>(void*) /usr/include/c++/v1/__thread/thread.h:200:25 (bt1+0x2d9d4c) This looks like something during thread startup. On Linux I only get the one genuine error. --=20 You are receiving this mail because: You are the assignee for the bug.=