[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-20 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @aganea You can find my current changes on my D115103 branch . I am using the currently failing `use_stacks.cpp` test. Something like this should make debugging of this issue possible: > cd

[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-20 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment. @clemenswasser We hit this once in a while, when Microsoft update their libraries. But I'm surprised about the CC at the beginning. How can this issue be reproduced? Can you show a disassembly dump from the VS debugger, around the address of the function that fails?

[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-18 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. I am currently unable to progress as all of my interceptors are not working. The interceptors are failing, because the `GetInstructionSize` function fails. For example, the `CreateThread` Win32 function starts on my Windows 11 installation with `4c 8b dc mov

[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-01 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. Wow, this fixed a lot of tests, down to only 17 lsan standalone tests failing :) (26 already passing) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 ___ cfe-commits

[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-01 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @aganea Thank you very much! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-01 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment. In D115103#4097460 , @clemenswasser wrote: > Do you have a suggestion how I could fix this on MSVC @clemenswasser The bug is there for years, I'm surprised it hasn't been fixed yet. MSVC doesn't support different types with

[PATCH] D115103: Leak Sanitizer port to Windows

2023-02-01 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @vitalybuka There seems to be a bug in MSVCs bit-field implementation, which causes the `disable.c` test to fail. This reproducer (assert) passes with gcc and fails with MSVC (`m.tag` is `0x`): cpp #include #include enum ChunkTag {

[PATCH] D115103: Leak Sanitizer port to Windows

2022-12-07 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. You probably can try to finish pure lsan, and then get back to lsan+asan. So if you continue to work please send smaller and ready pieces for review? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103

[PATCH] D115103: Leak Sanitizer port to Windows

2022-12-07 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 481042. clemenswasser added a comment. @vitalybuka I've been working on this on-off for the past months and have gotten the tests in the following state: Unsupported: 41 Passed : 19 Failed : 48 There is still the bug with the tracer

[PATCH] D115103: Leak Sanitizer port to Windows

2022-12-07 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka requested changes to this revision. vitalybuka added a comment. This revision now requires changes to proceed. Herald added a subscriber: Enna1. Is this still relevant? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103

[PATCH] D115103: Leak Sanitizer port to Windows

2022-04-23 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 424702. clemenswasser added a comment. I have now split the lsan TestCases chages into https://reviews.llvm.org/D124322 and managed to get the lsan+asan TestCases nearly to work. The current problem is, that during the start of the `RunThread` in

[PATCH] D115103: Leak Sanitizer port to Windows

2022-04-10 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 421796. clemenswasser added a comment. I always forget to change the line endings, sorry :( CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp

[PATCH] D115103: Leak Sanitizer port to Windows

2022-04-10 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 421795. clemenswasser added a comment. Since I am currently unable to intercept the ExitProcess/TerminateProcess in the ucrt (`exit_or_terminate_process` in `Windows Kits\10\Source\10.0.22000.0\ucrt\startup\exit.cpp:143`) I inserted a call to `Die` in

[PATCH] D115103: Leak Sanitizer port to Windows

2022-04-10 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 421791. clemenswasser added a comment. The CI seems to fail because of the parent revision? Retry CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp

[PATCH] D115103: Leak Sanitizer port to Windows

2022-04-10 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 421790. clemenswasser added a comment. I was wrong, the Problem was, that I didn't change the exit code, when a leak gets detected. I now intercept ExitProcess and change the exit code in there, with this there are already 12 Tests passing on Windows.

[PATCH] D115103: Leak Sanitizer port to Windows

2022-04-09 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 421758. clemenswasser added a comment. Hi, today I found some more time to play/progress with this patch. I'm generally optimistic that most of the basic lsan stuff should already be working on Windows. However without some help of you, I'm unable to

[PATCH] D115103: Leak Sanitizer port to Windows

2022-01-13 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 399689. clemenswasser edited the summary of this revision. clemenswasser added a comment. Updated the Tests. The Problem with Lsan+Asan still exists. I have just disabled them for now. I hope anyone can help me with getting the tests to run correctly?

[PATCH] D115103: Leak Sanitizer port to Windows

2022-01-07 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. All the lsan tests, when run in lsan+asan mode, Deadlock in `StopTheWord` when creating the tracer thread... F21505206: image.png -> `check-lsan` gets stuck, due to all the deadlocking tests :( Could it be caused by asan

[PATCH] D115103: Leak Sanitizer port to Windows

2022-01-07 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @aganea Thanks for your help. I already did everything you wrote (I am however using the coreutils provided by Git). `check-asan` works on my new computer. I still don't know why it didn't work on my older one... I will try to get the lsan tests working (and

[PATCH] D115103: Leak Sanitizer port to Windows

2022-01-06 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment. It does work indeed. I am running under a "x64 Native Tools Command Prompt for VS 2019" prompt with MSVC 16.11.8. D:\git\llvm-project>mkdir release && cd release D:\git\llvm-project\release>cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lld;llvm;compiler-rt"

[PATCH] D115103: Leak Sanitizer port to Windows

2022-01-06 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a subscriber: aganea. rnk added a comment. See a recent change rG7cd109b92c72855937273a6c8ab19016fbe27d33 by @aganea, who presumably was able to run the ASan tests for it. CHANGES SINCE LAST ACTION

[PATCH] D115103: Leak Sanitizer port to Windows

2022-01-06 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. In D115103#3209468 , @vitalybuka wrote: > In D115103#3209326 , @clemenswasser > wrote: > >> @vitalybuka >> No `check-asan` **doesn't work** for me. It just hangs forever and does >>

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-24 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D115103#3209326 , @clemenswasser wrote: > @vitalybuka > No `check-asan` **doesn't work** for me. It just hangs forever and does > absolutely nothing. No output, nothing showing up in Task Manager with high > CPU usage or

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-24 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @vitalybuka No `check-asan` **doesn't work** for me. It just hangs forever and does absolutely nothing. No output, nothing showing up in Task Manager with high CPU usage or anything. However `check-clang` **does work**. Is there some documentation on running

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-23 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D115103#3207867 , @clemenswasser wrote: > @vitalybuka I have now removed all `LSAN_BASE` occurrences. > However the invocations of the compiled test executables don't seem to work > either. > This doesn't work: > `// RUN:

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-23 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @vitalybuka I have now removed all `LSAN_BASE` occurrences. However the invocations of the compiled test executables don't seem to work either. This doesn't work: `// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck %s

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D115103#3207210 , @clemenswasser wrote: > The problem is, that `LSAN_BASE` is not always `use_stacks=0:use_registers=0`. Off-cause , I am asking to replace with correct value each test. > Also there are many test cases,

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-22 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. The problem is, that `LSAN_BASE` is not always `use_stacks=0:use_registers=0`. Also there are many test cases, where `LSAN_BASE` gets used multiple times. Removing it would result in bad repetition. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D115103#3207150 , @clemenswasser wrote: > @vitalybuka could you or someone else help me get the lsan tests running on > Windows? > For example lets look at > `compiler-rt\test\lsan\TestCases\leak_check_at_exit.cpp` (and

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-22 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added a comment. @vitalybuka could you or someone else help me get the lsan tests running on Windows? For example lets look at `compiler-rt\test\lsan\TestCases\leak_check_at_exit.cpp` (and basically all other tests, this serves as an easy example) I imagine that the following

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-17 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 395219. clemenswasser added a comment. Simplify Architecture checks CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp compiler-rt/cmake/config-ix.cmake

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-16 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/lsan/lsan_allocator.h:52-53 -#if defined(__mips64) || defined(__aarch64__) || defined(__i386__) || \ -defined(__arm__) || SANITIZER_RISCV64 || defined(__hexagon__) +#if defined(__mips64) || defined(__aarch64__)

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-12 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 393750. clemenswasser added a comment. Herald added subscribers: luke957, s.egerton, simoncook. Implement ProcessGlobalRegions Fix Interceptors for Windows CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D115103#3176852 , @clemenswasser wrote: > Split this patch up into multiple smaller ones: > > - D115186 > - D115204 > - D115262

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 392446. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp compiler-rt/cmake/config-ix.cmake compiler-rt/lib/lsan/CMakeLists.txt

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 392444. clemenswasser added a comment. Split this patch up into multiple smaller ones: - D115186 - D115204 - D115262 CHANGES SINCE LAST ACTION

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: compiler-rt/lib/lsan/lsan.h:20 +#elif SANITIZER_WINDOWS +# include "lsan_win.h" #endif MyDeveloperDay wrote: > clemenswasser wrote: > > vitalybuka wrote: > > > clemenswasser wrote: > > > > MyDeveloperDay wrote:

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser added inline comments. Comment at: compiler-rt/lib/lsan/lsan.h:20 +#elif SANITIZER_WINDOWS +# include "lsan_win.h" #endif MyDeveloperDay wrote: > clang-format? Yes, this is caused by clang-format. What should I do about it?

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. oh! gosh I'm sorry I didn't realize that `lsan` has this non standard LLVM style .clang-format, my apologies! D100238: [sanitizer] Set IndentPPDirectives: AfterHash in .clang-format kind of surprised TBH, doesn't feel the

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a subscriber: kuhnel. MyDeveloperDay added inline comments. Comment at: compiler-rt/lib/lsan/lsan_common.h:48 +#elif SANITIZER_NETBSD || SANITIZER_FUCHSIA || SANITIZER_WINDOWS +# define CAN_SANITIZE_LEAKS 1 #else vitalybuka wrote: >

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: compiler-rt/lib/lsan/lsan.h:20 +#elif SANITIZER_WINDOWS +# include "lsan_win.h" #endif vitalybuka wrote: > MyDeveloperDay wrote: > > clang-format? > @clemenswasser Can you please a separate tiny patch which

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-06 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a reviewer: rnk. vitalybuka added a subscriber: rnk. vitalybuka added a comment. LGTM in general, but it can be cut into smaller patches. + @rnk for Windows suff Comment at: compiler-rt/lib/lsan/lsan.h:20 +#elif SANITIZER_WINDOWS +# include "lsan_win.h"

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-06 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 392017. clemenswasser added a comment. Remove wrong interceptors CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp compiler-rt/cmake/config-ix.cmake

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-06 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. You need to add some reviewers to this revision. check out the CODE_OWNERS.txt or what I sometimes do is to `git log` one of the files you are changing and see who is a major contributor. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-06 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: compiler-rt/lib/lsan/lsan.h:20 +#elif SANITIZER_WINDOWS +# include "lsan_win.h" #endif clang-format? Comment at: compiler-rt/lib/lsan/lsan_common.h:48 +#elif SANITIZER_NETBSD ||

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-04 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 391875. clemenswasser added a comment. Use LF line endings CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp compiler-rt/cmake/config-ix.cmake

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-04 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 391873. clemenswasser added a comment. Apply clang-format CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp compiler-rt/cmake/config-ix.cmake

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-04 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 391872. clemenswasser added a comment. Move `__lsan_init` call inside of `SANITIZER_WINDOWS` ifdef CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-04 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser updated this revision to Diff 391870. clemenswasser added a comment. Changed to core.autocrlf=false CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115103/new/ https://reviews.llvm.org/D115103 Files: clang/lib/Driver/ToolChains/MSVC.cpp

[PATCH] D115103: Leak Sanitizer port to Windows

2021-12-04 Thread Clemens Wasser via Phabricator via cfe-commits
clemenswasser created this revision. clemenswasser added a project: Sanitizers. Herald added subscribers: abrachet, phosek, krytarowski, mgorny. clemenswasser requested review of this revision. Herald added a project: clang. Herald added subscribers: Sanitizers, cfe-commits. This was done by me