Announcement

Collapse
No announcement yet.

.NET 7 application was terminated?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • .NET 7 application was terminated?

    On Windows Server 2022,in windows event with the error:

    Code:
    CoreCLR Version: 7.0.22.51805
    .NET Version: 7.0.0
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.ArgumentNullException: Value cannot be null.
    at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
    at VRay.VRayRenderer.cleanUp()
    at VRay.VRayRenderer.Finalize()


  • #2
    Hello
    Could you send us the AppSDK build that you use?
    - e.g. the filename of your install package with the build date - appsdk-win_qt5-release-vray_v5.20.20-20220131

    I guess you have modified also your .csproj file?
    <TargetFramework>net7.0</TargetFramework>

    Could you also send us a short example from your Program.cs, which reproduces the issue, e.g.:
    Code:
    try
    {
        using (VRayRenderer renderer = new VRayRenderer())
        {
            // ...
        }
    }
    catch (VRayException ex)
    {
        Console.WriteLine("VRayException: " + ex.Message);
    }
    ​​​

    Comment


    • #3
      app sdk: appsdk-win_qt5-nightly-vray_v5.20.24-20221013
      it's hard to reproduce the issue..

      Comment


      • #4
        Are you sure you don't call VRayRenderer.Dispose() more than once? using calls it automatically once.

        We will change the code so that calling .Dispose() multiple times (and even from different threads) won't crash but at the moment it will.

        Another thing to check is if you don't call .Dispose() at all. We rely on the garbage collector in that case, but we might have a bug in that code path that would be hard to reproduce.

        Comment


        • #5
          I do call
          Code:
          [I]VRayRenderer.Dispose()[/I]​
          twice in some conditions, I just want to release
          Code:
          [I]VRayRenderer[/I]
          in advance. I can't call it twice?​

          Comment


          • #6
            Currently it will crash if called twice. We will fix it right away in the nightly builds.

            Comment


            • #7
              Does appsdk-win_qt5-nightly-vray_v5.20.24-20221130.zip fix the bug?

              @stanislav.kirilov

              Comment


              • #8
                No but I can pick it now and tomorrow it will.

                But we tried to reproduce the bug with and without the fix and we couldn't. After inspecting the code again, I think I was mistaken that calling VRayRenderer.Dispose() twice would crash without the fix so it might be something else...

                Whatever, I'll pick the fix and include it in 5.20 today.

                Comment


                • #9
                  Nightlies here should contain he fix:
                  https://nightlies.chaos.com/main#/vr.../5.20/20221203
                  Please, write here if they fix the crash. Thanks.

                  Comment


                  • #10
                    I think I know what exactly happened: some of your VRayRenderer instances were not constructed for whatever reason (e.g. a thrown "cannot obtain license" exception in the constructor). But their destructors/finalizers got called anyway. Our code inside the finalizers tried to access a member that had not been initialized. The result was ArgumentNullException as expected. My change should have fixed that bug as well even though I found it later.

                    Comment

                    Working...
                    X