5.1.9-preview: Process is terminating due to StackOverflowException

avatar's Avatar


03 May, 2018 07:36 PM

One issue fixed, another one rises, alas. I feel like I should apologize to you guys, given the amount of work I seem to be creating for you. Anyway: now that I've got a workaround for http://support.sharpcrafters.com/discussions/problems/5041-cannot-b... , attempting to build the project gives me this error:

0>Touching "C:\Users\avatar\Source\Repos\gk-netcore\GateKeeper\obj\Debug\netcoreapp2.0\GateKeeper.csproj.CopyComplete".
0>Executing "dotnet" C:\ProgramData\PostSharp\5.1.9\bin.Release\postsharp-netstandard20.dll obj\Debug\netcoreapp2.0\Before-PostSharp\GateKeeper.dll C:\Users\avatar\Source\Repos\gk-netcore\GateKeeper\obj\Debug\netcoreapp2.0\PostSharp\postsharp.config /config C:\ProgramData\PostSharp\5.1.9\bin.Release\postsharp-netstandard20.dll.config /NoLogo /InstallVsx /cancel:Local\postsharp-cancel-09bb6c1d-b901-4a96-87fc-86c16d2133a7
0>C:\Users\avatar\.nuget\packages\postsharp\5.1.9-preview\build\PostSharp.targets(340,5): Error: 
0>C:\Users\avatar\.nuget\packages\postsharp\5.1.9-preview\build\PostSharp.targets(340,5): Error: Process is terminating due to StackOverflowException.
0>The process dotnet exited with code -1073741571.

I'm trying to put a repro project together, but I've little idea where to even start with this one.


  1. Support Staff 1 Posted by PostSharp Techn... on 04 May, 2018 09:45 AM

    PostSharp Technologies's Avatar


    as long as the work is cause by our bugs, you don't need to apologize. We thank you for using our latest bits and helping us increasing the quality of our product.

    In this case, we'd need to see the stack trace of the point where the stack overflow happens. Doesn't it appear when you build your project using dotnet build -v:d or msbuild GateKeeper.csproj /v:d?

    If not, please try to obtain the stack trace this way:
    - Start the build using dotnet build -p:PostSharpAttachDebugger=True -v:d - Wait for PostSharp to hang telling Waiting for debugger to be attached. - Attach Visual Studio 2017 to the dotnet process. PID of the process is shown in the output. - Now you may see the stack trace in the debugger.

    If this doesn't work, we'd probably need the repro project.

    Best regards,

  2. 2 Posted by avatar on 05 May, 2018 06:53 PM

    avatar's Avatar

    Actually, I've found the problem while attempting to reproduce it, and it's at my end. An assembly compiled for .NET Core 2.1 (preview) had somehow crept into the build, and once that was removed and everything was running against .NET Core 2.0, everything works fine. Oops.

    I'm guessing you don't want to be bothered with 2.1 yet (and if I'm wrong, reproing this is easy: add an aspect into an otherwise empty .NET Core 2.1 project and it reliably occurs), so we might as well go ahead and close this now.



  3. 3 Posted by avatar on 06 May, 2018 04:42 PM

    avatar's Avatar

    ...correction: I've managed to reproduce it with a .NET Core 2.0 assembly, specifically the Microsoft.Windows.Compatibility package. Referencing the RegistryKey type from it reliably causes the issue.

    Repro project attached below.


  4. Support Staff 4 Posted by PostSharp Techn... on 09 May, 2018 09:43 AM

    PostSharp Technologies's Avatar


    I have managed to reproduce the issue. We will be working on a fix.

    I wasn't able to find a workaround.

    (internal #16049)

    Best regards,

  5. Support Staff 5 Posted by PostSharp Techn... on 15 May, 2018 09:02 AM

    PostSharp Technologies's Avatar


    the bug #16049 has been fixed in the current preview release of PostSharp 6.0.10.
    Should you need further help with this issue, don't hesitate to re-open this discussion.

    Best regards,

  6. PostSharp Technologies closed this discussion on 15 May, 2018 09:02 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac