From nobody Thu Nov 17 14:04:23 2022 X-Original-To: toolchain@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 4NChVb2hvZz4hLmL for ; Thu, 17 Nov 2022 14:04:23 +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 4NChVb0CNrz3KRT for ; Thu, 17 Nov 2022 14:04:23 +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=1668693863; 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=QgWW9L6y/pY+ynudLn1SGl9w9tYRe/sG84ynKJrHCwo=; b=P4dauTyOT5HuRsInZLX+N6APa76iuzmDbC9tuyNa25W3jWzutSvZETVIDMQGgkrk6+U3jd uLKJr55YqmAA7/ccs+V8cDjphQuYeW1N8Wm/ezEFZjYfIdHLNWbEmqu5w0mgUtabF4pjoH eXRoEgmpyS7Gzdj/seiynk67aFRe/K5F6P4tzVjv96L2DHu6kuu0WhtqNGIhJy0ooGx3J0 SJIbMhBEnJPmEBTgk5qpn4SGACOLV+4u2tMBNFcTEqZ70Xqpg8/Xb1AJSPIzAA+bDCKuwe wE1/TcguWgwvrkSAdPj7iy/ArEBUbVCOTEBjkAd1TBafB0NEBK9YXFkoYIixZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668693863; a=rsa-sha256; cv=none; b=I55T28Sig84E9AiQ86Zns13hG3sX0MpgB+i+g2svu0CGYtYFkiXvVMzVGoPrd9uBYFqueC B/lSql7J21e6W6gMwMerIOBAlK4e1Y9bACBGtc9dArNIgx7y+Gw46W40MVynWvxsHfT1aA GhaRb8ew/rfZlH0LwJy0ChkwmfUOAfvookZkht01ZeLbjrbVQV1KQ1GMS10ei1RVFRie3L MCKSHgKazLPl2ajYzE0Dws8XqQZuhFCtJPbQKFmCKX+02Wf8BKdVuOHRZvVAqXbTwFe36a 7oL437USu05per4QGoJ0dnhfeIfZbUk6BczCfP5AqutbHLQzrSMoSZv1lWjPpw== 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 4NChVZ6JNpzkpZ for ; Thu, 17 Nov 2022 14:04:22 +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 2AHE4MWT099851 for ; Thu, 17 Nov 2022 14:04:22 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AHE4MAO099850 for toolchain@FreeBSD.org; Thu, 17 Nov 2022 14:04:22 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: toolchain@FreeBSD.org Subject: [Bug 267768] Simple OpenMP example crashes with thread sanitizer (-fsanitize=thread) Date: Thu, 17 Nov 2022 14:04:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Maintenance of FreeBSD s integrated toolchain List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267768 Dimitry Andric changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emaste@freebsd.org --- Comment #1 from Dimitry Andric --- Yeah, it looks like the combination of openmp and ThreadSaniziter is not well-tested or supported, even. If you do: export TSAN_OPTIONS=3D'ignore_noninstrumented_modules=3D1' as it recommends, the debugging session seems to work with some suppressed warnings: (gdb) r Starting program: /home/dim/tmp/foo warning: Could not load shared library symbols for [vdso]. Do you need "set solib-search-path" or "set sysroot"? [New LWP 888651 of process 49234] [New LWP 888652 of process 49234] [New LWP 888653 of process 49234] [New LWP 888654 of process 49234] ThreadSanitizer: thread T2 finished with ignores enabled, created at: ThreadSanitizer: thread T1 finished with ignores enabled, created at: ThreadSanitizer: thread T3 finished with ignores enabled, created at: [Detaching after fork from child process 49235] #0 pthread_create /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_po= six.cpp:1022:3 (foo+0x265a15) #1 __kmp_create_worker /usr/src/contrib/llvm-project/openmp/runtime/src/z_Linux_util.cpp:803:7 (libomp.so+0xce0c8) One of the following ignores was not ended (in order of probability) [LWP 888652 of process 49234 exited] [LWP 886429 of process 49234 exited] [LWP 888651 of process 49234 exited] [LWP 888654 of process 49234 exited] [Inferior 1 (process 49234) exited with code 0102] And if you let it core dump outside a debugger, you can see that it's becua= se of ASLR: Core was generated by `./foo'. Program terminated with signal SIGSEGV, Segmentation fault. Address not mapped to object. #0 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00000000002845ad in __interceptor_strlcpy (dst=3D0x8206c6570 "", src=3D0x8206ca578 "/home/dim/tmp/foo", size=3D1024) at /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors.h:= 40 #2 0x0000000824a3eadd in _elf_aux_info (aux=3D, buf=3D0x820= 6c6570, buflen=3D1024) at /usr/src/lib/libc/gen/auxv.c:287 #3 0x000000000024e2a4 in __sanitizer::ReExec () at /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_li= nux_libcdep.cpp:909 #4 0x000000000024d0e2 in __sanitizer::CheckASLR () at /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_li= nux.cpp:2198 #5 0x00000000002b43df in __tsan::Initialize (thr=3Dthr@entry=3D0x8267071c0= ) at /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:646 #6 0x0000000000262e00 in __tsan::LazyInitialize (thr=3D0x8267071c0) at /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.h:637 #7 __tsan::ScopedInterceptor::ScopedInterceptor (this=3Dthis@entry=3D0x820= 6c6e38, thr=3Dthr@entry=3D0x8267071c0, fname=3D, pc=3D34975452123) at /usr/src/contrib/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_po= six.cpp:249 #8 0x0000000000284288 in __interceptor_readlink (path=3D0x8249eeaaa "/etc/malloc.conf", buf=3Dbuf@entry=3D0x8206c8990 "hEl!\b", bufsiz=3Dbufsiz@entry=3D1024) at /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_co= mmon_interceptors.inc:7353 #9 0x0000000824b30bdb in obtain_malloc_conf (which_source=3D2, buf=3D0x820= 6c8990 "hEl!\b") at jemalloc_jemalloc.c:984 #10 malloc_conf_init_helper (sc_data=3Dsc_data@entry=3D0x0, bin_shard_sizes=3Dbin_shard_sizes@entry=3D0x0, initial_call=3Dfalse, opts_cache=3Dopts_cache@entry=3D0x8206c8da0, buf=3Dbuf@entry=3D0x8206c8990 = "hEl!\b") at jemalloc_jemalloc.c:1042 #11 0x0000000824b307ed in malloc_conf_init (sc_data=3D0x8206c6fe0, bin_shard_sizes=3D0x8206c6f50) at jemalloc_jemalloc.c:1449 #12 malloc_init_hard_a0_locked () at jemalloc_jemalloc.c:1509 #13 0x0000000824b32aef in malloc_init_hard () at jemalloc_jemalloc.c:1754 #14 0x000037671ef0a02d in objlist_call_init (list=3Dlist@entry=3D0x8206c9dc= 8, lockstate=3Dlockstate@entry=3D0x8206c9bd8) at /usr/src/libexec/rtld-elf/rtl= d.c:3140 #15 0x000037671ef0862a in _rtld (sp=3D, exit_proc=3D0x8206c9= e40, objp=3D0x8206c9e48) at /usr/src/libexec/rtld-elf/rtld.c:981 #16 0x000037671ef05fd9 in rtld_start () at /usr/src/libexec/rtld-elf/amd64/rtld_start.S:39 #17 0x0000000000000000 in ?? () E.g. what happens here is that Ed's magic code that attempts to auto-restart the process without ASLR is causing some sort of issue. It might fare bette= r if ASLR is disabled globally, or just for the program itself. --=20 You are receiving this mail because: You are the assignee for the bug.=