From nobody Mon Nov 14 19:08:45 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 4N9zP92dCrz4hnvk for ; Mon, 14 Nov 2022 19:08:45 +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 4N9zP90NZGz3FJL for ; Mon, 14 Nov 2022 19:08:45 +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=1668452925; 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=/2I1l8C9LJvvL2ydGebmhqihKXX5ncrERdtR9okJzno=; b=e3hb0S1s6Zcy8RT4WT3DtbVfSZxVvxfCA5B8ekUQo+3EQzyZ3cpU9NcSshS7XTp+Z5dLAm 43+QNIGfxzC658TJ9WYxp8U45N5OWCMhIJFaOrc5GyS1m1HOVPv02YInvpGDH8gV73JeLc cpm9Oxl9zlPq25nSB/HTkE1qTgzwhE0TFi66GCgdfn3XbXzCRby1iFiwg0T12Kp0yhbdN+ nsSzBcbVVV7wTneUCIE2ETQTCbjRj19fBq4TeZFxwF1SKMUTeLIMuDMiizsCGZfpbcsPgW dxUkXq221SNjhKMq+6gZHXyFS+Zri0xzFnWEsQj4f7lqwxG3t6GMRJ0aTbmq/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668452925; a=rsa-sha256; cv=none; b=du41oKyQWttQj/OVjBMBdtRCwAaV9Li5Jl+OOblw5vTazagkNfvigKhYCce6IBmo/nbmUu lcqkLgNBnDymnOYQklRzzhIIBka+wgo0zboXpaxipVoQzklQXXVqHK4hTPYqCdftNiH0z0 quDXAw+Y2IbwWnNk7T/y7Epd2fAiT8+Vvh9oMX0cHoyLZ3w3YkeubQhXq9HUNqyE1pwGm4 BPLNFdt4aP03oGEM/J66Gs9XXQcsOcHz1uSJ1/MIrvetV3Rr8oq+lchzV3wFqZfbljEk1/ vHrQRz93lx1oUIu3VifveYD4Nsbs+NEowaGSn+kUL+4JUh9Ubbg+7mt8cIrrzQ== 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 4N9zP86ZT2zt4H for ; Mon, 14 Nov 2022 19:08:44 +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 2AEJ8iPk084429 for ; Mon, 14 Nov 2022 19:08:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AEJ8i9U084428 for bugs@FreeBSD.org; Mon, 14 Nov 2022 19:08:44 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 267768] Simple OpenMP example with thread sanitizer (-fsanitize=thread) Date: Mon, 14 Nov 2022 19:08:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: yuri@freebsd.org 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 attachments.mimetype attachments.created 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: 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267768 Bug ID: 267768 Summary: Simple OpenMP example with thread sanitizer (-fsanitize=3Dthread) Product: Base System Version: 13.1-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: yuri@freebsd.org Attachment #238078 text/plain mime type: Created attachment 238078 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D238078&action= =3Dedit openmp.cpp The attached code crashes when compiler like this: > c++ openmp.cpp -fsanitize=3Dthread -g -fopenmp The executable SEDVs. But in debugger it prints this: (gdb) r Starting program: /usr/home/yuri/Downloads/a.out=20 Warning: please export TSAN_OPTIONS=3D'ignore_noninstrumented_modules=3D1' = to avoid false positive reports from the OpenMP runtime! [New LWP 464093 of process 56986] [New LWP 464094 of process 56986] [New LWP 464095 of process 56986] [New LWP 464096 of process 56986] [Detaching after fork from child process 56987] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D WARNING: ThreadSanitizer: data race (pid=3D56986) Atomic read of size 1 at 0x7b6800001740 by main thread: #0 pthread_mutex_lock /disk-samsung/freebsd-src/contrib/llvm-project/compiler-rt/lib/sanitizer_co= mmon/sanitizer_common_interceptors.inc:4324:3 (a.out+0x27a256) #1 __kmp_lock_suspend_mx /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/z_Linux_u= til.cpp:1381:16 (libomp.so+0xcd206) #2 void __kmp_resume_template >(int, kmp_flag_64*) /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/z_Linux_u= til.cpp:1594:3 (libomp.so+0xcd206) Previous write of size 1 at 0x7b6800001740 by thread T2: #0 _pthread_mutex_init /disk-samsung/freebsd-src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsa= n_interceptors_posix.cpp:1316:3 (a.out+0x2655eb) #1 __kmp_suspend_initialize_thread /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/z_Linux_u= til.cpp:1348:14 (libomp.so+0xcbc27) Location is heap block of size 1504 at 0x7b6800001200 allocated by main thread: #0 malloc /disk-samsung/freebsd-src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsa= n_interceptors_posix.cpp:667:5 (a.out+0x262e8e) #1 ___kmp_allocate_align(unsigned long, unsigned long) /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/kmp_alloc= .cpp:1882:25 (libomp.so+0x54d3c) #2 ___kmp_allocate /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/kmp_alloc= .cpp:1934:9 (libomp.so+0x54d3c) Thread T2 (tid=3D464095, running) created by main thread at: #0 pthread_create /disk-samsung/freebsd-src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsa= n_interceptors_posix.cpp:1022:3 (a.out+0x264435) #1 __kmp_create_worker /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/z_Linux_u= til.cpp:803:7 (libomp.so+0xca8d8) SUMMARY: ThreadSanitizer: data race /disk-samsung/freebsd-src/contrib/llvm-project/openmp/runtime/src/z_Linux_u= til.cpp:1381:16 in __kmp_lock_suspend_mx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [LWP 464095 of process 56986 exited] [LWP 464094 of process 56986 exited] [LWP 464096 of process 56986 exited] ThreadSanitizer: reported 1 warnings [LWP 464093 of process 56986 exited] [Inferior 1 (process 56986) exited with code 0102] --=20 You are receiving this mail because: You are the assignee for the bug.=