C++ AMP crashes often with recent Windows/Visual Studio version RRS feed

  • Question

  • Hi,

    I developed some code using C++ AMP in 2012, and it was in production in 2013. Last modifications were done in 2016. It was installed by several hundreds of customer, and the code was running fine.

    Since 2017, unit tests of this code, launched on the TFS build machine, started to have some errors. Being a virtual machine, it use Warp as render. At that time, I tried on my machine (GTX 660), but even with a 1000 iterations, I wasn't able to reproduce the issue. Therefore, I didn't look more at it, as I thought that it was specific to the virtual machine/Warp rendering.

    Now, at least one unit test fails on most builds, making hard to have a successful build. I then tried again locally, on several machines, and I discovered that the problem also happens, regardless of the render driver, often just after a few iterations.

    It is reproducible with:

    • Nvidia GTX 1060
    • Nvidia GTX 760
    • Intel UHD Graphics 630
    • direct3d\warp
    • direct3d\ref

    Again, it worked fine in the past, and the code wasn't modified since. Only Windows SDK and Visual Studio (now 2017) versions were updated. And the crashes are totally random, it can happen on the first call (like in the unit tests), or after 50 calls.

    Even with native debugging enabled (the code is called from a C# program), I only see that something is corrupted:

    Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x3d3fad73, on thread 0x8a70. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

    If it was only limited to the C++ AMP code, it wouldn't be a big issue, but as it is it makes the whole application crash.

    As anyone an idea of what is happening? Or what changed in Windows or Visual Studio (C++ redistribuable) which could explain the issue?


    Thursday, April 18, 2019 8:34 AM