Use of 'concurrency::parallel_for_each' with the Multi-threaded Debug (/MTd) run-time library causes unhandled exceptions on program exit
| Bugzilla Link | 34976 |
| Version | trunk |
| OS | Windows NT |
| Attachments | Example cpp file, Example Compilation Command Line, Example used for reproducible, Second example used for reproducible |
Extended Description
Use of 'parallel_for_each' when compiling with the Visual C++ Compiler uses the Windows Concurrency Library. We have found that when compiling with /MTd, the use of 'concurrency::parallel_for_each' can cause unhandled exceptions when the program is exiting.
This is problematic when debugging or testing.
This issue does not occur when compiling to release or DLL run-time libraries, and the issue has been raised with Microsoft. However in the meantime we suggest the removal of this MSVC specific functionality and use the generic implementation.
To reproduce this issue consistently:
- Create an an executable with calls to 'parallel_for_each'
- Run executable multiple times in parallel
- The exit codes will be as below: -1073741819 = C0000005 = Access Violation exception
See attached files for example
Due to a change in Microsoft's issue reporting system, the problem has been resubmitted:
https://developercommunity.visualstudio.com/content/problem/198027/use-of-concurrencyparallel-for-each-with-the-multi.html