[PATCH] D145214: [TSAN] add support for riscv64

2023-09-28 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added inline comments. This revision is now accepted and ready to land. Comment at: compiler-rt/lib/tsan/rtl/CMakeLists.txt:5 append_list_if(COMPILER_RT_HAS_MSSE4_2_FLAG -msse4.2 TSAN_RTL_CFLAGS) -append_list_if(SANITIZER_LIMIT_FRAME_SIZE

[PATCH] D143664: [SanitizerBinaryMetadata] Support ignore list

2023-02-09 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added inline comments. This revision is now accepted and ready to land. Comment at: clang/test/Driver/fsanitize-metadata-ignorelist.c:6 +// RUN: %clang -target aarch64-linux-gnu -fexperimental-sanitize-metadata=all -fexperimental-sanitize-

[PATCH] D143482: [SanitizerBinaryMetadata] Optimize used space for features and UAR stack args

2023-02-08 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added a comment. This revision is now accepted and ready to land. Nice! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143482/new/ https://reviews.llvm.org/D143482

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. FTR 2 breakage fixes merged: https://github.com/llvm/llvm-project/commit/2a05bd212e3e8aaed818ee23464f4d1fe0b0596d https://github.com/llvm/llvm-project/commit/08742e72a34e835e6fc3c696eabe6045c78d6289 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. In D136078#3970792 , @thakis wrote: > This seems to break tests: http://45.33.8.238/linux/93224/step_12.txt > > Can you take a look? Sent a fix: https://reviews.llvm.org/D139325 Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Fix for: -- Supported architectures for crt: aarch64 CMake Error at compiler-rt/cmake/config-ix.cmake:244 (message): Unsupported architecture: x86_64 Call Stack (most recent call first): compiler-rt/cmake/config-ix.cmake:280 (get_target_flags_for_arch) c

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. In D136078#3970792 , @thakis wrote: > This seems to break tests: http://45.33.8.238/linux/93224/step_12.txt > > Can you take a look? Looking. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGdbe8c2c316c4: Use-after-return sanitizer binary metadata (authored by dvyukov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. PTAL Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 480051. dvyukov added a comment. Herald added a project: Sanitizers. Herald added a subscriber: Sanitizers. Moved tests to compiler-rt and rebased to HEAD. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/ne

[PATCH] D138489: [tsan] Add tsan support for loongarch64

2022-12-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added inline comments. Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:1526 + + /* if ($a0 != 0) + * return $a0; Please use C-style one-line comments // Repository: rG LLVM Github Monorepo

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-01 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Re this failure: project/clang/test/Instrumentation/SanitizerBinaryMetadata/covered.cpp -- Exit Code: 2 Command Output (stderr): -- covered.cpp.tmp: /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Instrumentation/SanitizerBinaryMetadata/common.h:22: T consume(

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-12-01 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. @melver Re this failure: TEST 'Clang :: Instrumentation/SanitizerBinaryMetadata/uar.cpp' FAILED Script: -- : 'RUN: at line 4'; /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/clang --driver-mode=g++

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd3c851d3fc8b: Use-after-return sanitizer binary metadata (authored by dvyukov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 478912. dvyukov added a comment. restrict tests to linux Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/clang/Basic/CodeGenOptions.def clang

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. PTAL moved *.cpp tests to clang/test/ updated tests that hardcode pipeline passes fixed metadata update This did not work, it also changed all shared instances: const auto *NewMD = MDB.createPCSections( {{Section.getString(), {Features, IRB.getInt32(Size)}}});

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 478887. dvyukov added a comment. Herald added subscribers: kosarev, pcwang-thead, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, nio

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. In D136078#3959643 , @dvyukov wrote: > FTR ./llvm/test/CodeGen/AMDGPU/llc-pipeline.ll also failed as it hardcodes > all passes: > https://lab.llvm.org/buildbot/#/builders/123/builds/14397 Also these: LLVM :: CodeGen/X86/O0-pi

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. FTR ./llvm/test/CodeGen/AMDGPU/llc-pipeline.ll also failed as it hardcodes all passes: https://lab.llvm.org/buildbot/#/builders/123/builds/14397 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llv

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Kazu, thanks for taking care of the revert. I've fixed the assert and tested with -DLLVM_ENABLE_ASSERTIONS=On. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 ___

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe6aea4a5db09: Use-after-return sanitizer binary metadata (authored by dvyukov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 478826. dvyukov added a comment. fixed the debug build Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/clang/Basic/CodeGenOptions.def clang/i

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Dmitry Vyukov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa1255dc467f7: Use-after-return sanitizer binary metadata (authored by dvyukov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov marked an inline comment as done. dvyukov added inline comments. Comment at: llvm/test/Instrumentation/SanitizerBinaryMetadata/uar.cpp:19 +void non_empty_function() { + // Completely empty functions don't get uar metadata. + volatile int x; melver wrote

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 478609. dvyukov marked 2 inline comments as done. dvyukov added a comment. addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/c

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov marked an inline comment as done. dvyukov added a comment. PTAL Comment at: llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp:254 + if (F.isVarArg()) +PerInstrFeatureMask &= ~kSanitizerBinaryMetadataUAR; + if (PerInstrFeatureMask & kSanitizerBinaryMe

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-29 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 478569. dvyukov marked 4 inline comments as done. dvyukov added a comment. addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/c

[PATCH] D136078: Use-after-return sanitizer binary metadata

2022-11-28 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added inline comments. Comment at: llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp:79 + }; + MD->replaceOperandWith(1, MDNode::get(F.getContext(), NewAuxMDs)); + return false; Should this be a new method on MDBuilder? Repository: rG LLVM Github Monore

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-11-28 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. PTAL I've named everything consistently as "SanitizeBinaryMetadata", fixed interning of metadata, and added a test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 __

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-11-28 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 478168. dvyukov marked 3 inline comments as done. dvyukov added a comment. rebase and adressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-19 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 468876. dvyukov added a comment. take args alignment into account Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/clang/Basic/CodeGenOptions.de

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-19 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Unrelated, but looking at the metadata format more closely, I think this can benefit from LEB128-like varlen encoding. Function size is small. Features are very small. Stack args size is small. Function start (if we encode it from the end of the previous one) is very smal

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-19 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Marco, does this look reasonable? Any high-level comments? There are lots of plumbing to add a new flag and integrate a new pass, so you can look only at: llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp llvm/lib/CodeGen/SanitizerMetadata.cpp As far as I

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-19 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 468816. dvyukov added a comment. WIP Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/clang/Basic/CodeGenOptions.def clang/include/clang/Basic

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-19 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 468815. dvyukov added a comment. WIP Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D136078 Files: clang/include/clang/Basic/CodeGenOptions.def clang/include/clang/Basic

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-18 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov updated this revision to Diff 468562. dvyukov added a comment. Herald added subscribers: llvm-commits, Enna1, hiraditya. Herald added a project: LLVM. WIP Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136078/new/ https://reviews.llvm.org/D1

[PATCH] D136078: [RFC] Use-after-return binary metadata.

2022-10-17 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov created this revision. Herald added a subscriber: ormris. Herald added a project: All. dvyukov requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D136078 Files:

[PATCH] D108029: [clang][Codegen] Introduce the no_sanitizer_instrumentation attribute

2021-08-13 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:524 +bool CodeGenFunction::ShouldSkipSanitizerInstrumentation() { + if (!CurFuncDecl) +return false; When is CurFuncDecl nullptr? Maybe we should

[PATCH] D105629: [TSan] Add SystemZ support

2021-07-08 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Some solid work here. I only have a question re mmap handling. Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:781 + // TSAN. Act as if we ran out of memory. + internal_munmap(res, sz); + errno = errno_ENOMEM; --

[PATCH] D92846: [KernelAddressSanitizer] Fix globals exclusion for indirect aliases

2020-12-09 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added a comment. This revision is now accepted and ready to land. The code looks reasonable to me. I see it only affects kernel, so assuming you booted kernel, we should be fine. I can rubber-stamp it, but if you want more meaningful review, please wait for

[PATCH] D90130: Add mips64 support in lib/tsan/go/buildgo.sh

2020-10-26 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov closed this revision. dvyukov added a comment. Landed in https://github.com/llvm/llvm-project/commit/5cad535ccfebf9b41a57cf2788d8de7a765f7f35 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90130/new/ https://reviews.llvm.org/D90130 ___

[PATCH] D90130: Add mips64 support in lib/tsan/go/buildgo.sh

2020-10-26 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov accepted this revision. dvyukov added a comment. This revision is now accepted and ready to land. Looks good to me. Do you want me to merge this change? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90130/new/ https://reviews.llvm.org/D9013

[PATCH] D90130: Add mips64 support in lib/tsan/go/buildgo.sh

2020-10-26 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. This now looks like a patch for some other change :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90130/new/ https://reviews.llvm.org/D90130 ___ cfe-commits mailing list cfe-com

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-24 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Re more checks. I guess we can borrow some from the existing checkers: https://www.kernel.org/doc/html/v4.12/dev-tools/sparse.html https://bottest.wiki.kernel.org/coccicheck https://lwn.net/Articles/752408/ https://lwn.net/Articles/691882/ They do some checks very well. B

[PATCH] D59963: [clang-tidy] Add a module for the Linux kernel.

2019-06-24 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. I assume you tried to run it on the kernel. Please post the current output somewhere. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59963/new/ https://reviews.llvm.org/D59963

[PATCH] D56157: [sanitizer_common] Implement popen, popenve, pclose interceptors

2019-01-02 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added inline comments. Comment at: lib/tsan/rtl/tsan_interceptors.cc:2259 +#define COMMON_INTERCEPTOR_PIPE_OPEN(ctx, file) \ + if (file) { \ krytarowski wrote: > dvyukov wrote: > > An alternative would be to pass NULL

[PATCH] D56157: [sanitizer_common] Implement popen, popenve, pclose interceptors

2018-12-30 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. This needs some tests, at least to exercise interceptors code once. Comment at: lib/esan/esan_interceptors.cpp:90 } while (false) +#define COMMON_INTERCEPTOR_PIPE_OPEN(ctx, file) \ + do {

[PATCH] D50549: [libcxx] [test] Repair thread unsafety in thread tests

2018-08-13 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added inline comments. Comment at: test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp:73 assert(!t0.joinable()); while (!done) {} assert(G::op_run); BillyONeal wrote: > dvyukov wrote: > > Bi

[PATCH] D50549: [libcxx] [test] Repair thread unsafety in thread tests

2018-08-13 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added inline comments. Comment at: test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp:73 assert(!t0.joinable()); while (!done) {} assert(G::op_run); BillyONeal wrote: > BillyONeal wrote: > >

[PATCH] D50549: [libcxx] [test] Repair thread unsafety in thread tests

2018-08-13 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added inline comments. Comment at: test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp:73 assert(!t0.joinable()); while (!done) {} assert(G::op_run); BillyONeal wrote: > BillyONeal wrote: > >

[PATCH] D50549: [libcxx] [test] Repair thread unsafety in thread tests

2018-08-13 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added inline comments. Comment at: test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp:73 assert(!t0.joinable()); while (!done) {} assert(G::op_run); I don't immediately see how the race on n

[PATCH] D28304: [compiler-rt] [cmake] Disable appending -msse* flags implicitly

2017-01-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. > I don't see a big issue enabling it for x86-64 but for 32-bit systems you're > ruling out quite a lot of hardware. Tsan does not support 32-bits. https://reviews.llvm.org/D28304 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D28304: [compiler-rt] [cmake] Disable appending -msse* flags implicitly

2017-01-05 Thread Dmitry Vyukov via Phabricator via cfe-commits
dvyukov added a comment. Yes, for tsan runtime detection does not make lots of sense -- we only have few SSE instructions on inlined fast path. The SSE code provides quite substantial speedup. User -march flag won't help as runtime is prebuilt. SCUDO is sse4.2, but tsan is sse3. Do you actually