r/cpp • • May 19 '20

Visual Studio 2019 version 16.7 Preview 1 released, including 64bit AddressSanitizer

https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-preview#16.7.0-pre.1.0
117 Upvotes

22 comments sorted by

12

u/kalmoc May 20 '20

8

u/markopolo82 embedded/iot/audio May 20 '20

Seeing that bug makes me wonder how often people have run into the issue unknowingly and then done the workaround (add a constructor) thinking they made a mistake...

Is it only when a nested character array is initialized or any nested aggregate initialization?

4

u/kalmoc May 20 '20

My guess it is some interaction with the nested char array otherwise many more people would have hit that bug.

1

u/AdventurousMention0 May 21 '20

Me. Absolutely. Just checked my code and I do that in a number of places. I even had a comment “why?”

Well... now I know 🤪

1

u/jcelerier ossia score May 23 '20

oh boy, now I understand some of the random crashes I had. Don't regret migrating to clang on windows at all <_<

2

u/kalmoc May 21 '20

Does anybody know why they developed ASAN for 32 bit first?

3

u/marcodev May 20 '20 edited May 21 '20

Chrono library is totally broken and still not fixed. wait_for/wait_until methods are still based on system clock.

6

u/Daniela-E Living on C++ trunk, WG21 |🇩🇪 NB May 20 '20

There is no such thing as sleep_for or sleep_until in std::chrono. At least my copy of VS2019.6 implements this_thread::sleep_for in terms of chrono::steady_clock, and this_thread::sleep_until in terms of the underlying clock type of the supplied chrono::time_point. This is in full conformance to the C++ standard: 32.2.4 thread.req.timing

2

u/marcodev May 21 '20

I'm talking about all related methods for condition_variable, timed_mutex, future and so on.

1

u/kalmoc May 21 '20

That would be wait_for/until then. IIRC, they can't fix that before the next ABI break.

1

u/marcodev May 21 '20

Fixed my comments. Sure, we are waiting since ages for a fix. Totally crap for me.

2

u/kalmoc May 21 '20 edited May 21 '20

I'm just trying to give you an estimate when you can expect a fix: Certainly not in VS2019 (again IIRC). Yet another example, why we need regular ABI breaks.

2

u/STL MSVC STL Dev May 21 '20

Yeah, we really wish we could break ABI here - and for the other bugs in our repo tagged vNext.

2

u/kalmoc May 21 '20

Is vNext corresponding to the next version of visual studio or just an STL-internal name for the next ABI breaking release whenever that will be?

2

u/STL MSVC STL Dev May 21 '20

The latter.

1

u/tacco85 May 20 '20

I am really looking forward to x64 ASan. Sadly on this preview I get an immediate crash when running a 64bit program compiled with ASan.

Call stack points to the ASan library.

1

u/marian_l MS C++ Group Product Mgr May 29 '20

Sorry for the delay following up on this. Can you open a Developer Community ticket for this such that the engineering team can investigate and report back? Thx!

1

u/mcgov__ Windows Security Dev Jun 11 '20

64bit ASan will throw a bunch of first-chance exceptions during the course of program execution. This is due to the way the ASan runtime maps memory on-demand and is something that was inherited from the llvm-project upstream. If you run into any second chance AV exceptions ASan will catch and report on them, so you can safely ignore those first-chance AV exceptions while debugging.

There is also an issue with the way 64bit ASan initializes it's globals information currently. If you encounter it you can workaround the issue by setting ASAN_OPTIONS=report_globals=0 (this will miss over/underflows on global variables though).

1

u/[deleted] May 20 '20

[removed] — view removed comment

1

u/tacco85 May 20 '20

Sry I don't follow. Could you explain which settings worked for you?