Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Debug.Assert crash the host (dnx.exe has stopped working) #2778

Closed
per-samuelsson opened this issue Sep 22, 2015 · 15 comments
Closed

Debug.Assert crash the host (dnx.exe has stopped working) #2778

per-samuelsson opened this issue Sep 22, 2015 · 15 comments
Assignees
Milestone

Comments

@per-samuelsson
Copy link

Yo,

Chasing a deadline, so I haven't done any real investigation, but on my env, Debug.Assert(false) produce the following:

image

Env:

Active Version           Runtime Architecture OperatingSystem Alias  
------ -------           ------- ------------ --------------- -----  
       1.0.0-beta8-15120 coreclr x64          win                    
  *    1.0.0-beta8-15618 coreclr x64          win             default

Project.json

{
    "version": "0.1.0",
    "dependencies": {
        "Microsoft.Dnx.Compilation.CSharp.Abstractions": "1.0.0-*"
    },
    "commands": {
        "run": "app1"
    },
    "frameworks": {
        "dnxcore50": {
            "dependencies": {
                "System.Runtime": "4.0.21-beta-*",
                "System.Threading.Tasks": "4.0.10-beta-*",
                "System.Console": "4.0.0-beta-*"
            }
        }
    }
}

Program.cs:

// Stripped down to very minimum...
public class Program {
  public int Main(string[] args) {
    Debug.Assert(false);
  }
}

Let me know if u can not repro it on your end, and I'll try allocate some time to assist if you want that.

@per-samuelsson
Copy link
Author

Oh, and I don't have VS 2015 installed, all work done from CLI and the standard tools.

@muratg muratg added the bug label Sep 23, 2015
@muratg muratg added this to the 1.0.0-rc1 milestone Sep 23, 2015
@muratg
Copy link
Contributor

muratg commented Sep 23, 2015

After updating your repro code but I was able to repro this on: * 1.0.0-beta8-15618 coreclr x64 win

project.json

{
    "version": "0.1.0",
    "dependencies": {
        "Microsoft.Dnx.Compilation.CSharp.Abstractions": "1.0.0-*"
    },
    "frameworks": {
        "dnxcore50": {
            "dependencies": {
                "System.Runtime": "4.0.21-beta-*",
                "System.Threading.Tasks": "4.0.10-beta-*",
                "System.Console": "4.0.0-beta-*",
        "System.Diagnostics.Debug": "4.0.0-beta-*"
            }
        }
    }
}

program.cs

// Stripped down to very minimum...
using System.Diagnostics;

public class Program {
  public int Main(string[] args) {
    Debug.Assert(false);
    return 0;
  }
}

@per-samuelsson
Copy link
Author

Sorry my Program.cs was a bit sloppy, a bit of pseudo-code-ish. Yours is spot on.

I don't have the System.Diagnostics.Debug": "4.0.0-beta-* reference in my project.json though. The posted project.json is authentic. But never mind I guess, "good" that you've been able to repro it.

Let me know if I can be of any help.

@muratg
Copy link
Contributor

muratg commented Sep 23, 2015

If you didn't have a reference to System.Diagnostic.Debug where did your Debug class come from?

@muratg
Copy link
Contributor

muratg commented Sep 23, 2015

This runs fine with CLR by the way. Fails on both X64 and X86 CoreCLRs.

@per-samuelsson
Copy link
Author

If you didn't have a reference to System.Diagnostic.Debug where did your Debug class come from?

Beats me - I just have no idea. But since you asked, I had to double-check my project.json, and here's the exact copy:

{
    "version": "0.1.0",
    "dependencies": {
        "Starcounter" : "0.1.0",
        "Microsoft.Dnx.Compilation.CSharp.Abstractions": "1.0.0-*"
    },
    "commands": {
        "run": "app1"
    },
    "frameworks": {
        "dnxcore50": {
            "dependencies": {
                "System.Runtime": "4.0.21-beta-*",
                "System.Threading.Tasks": "4.0.10-beta-*",
                "System.Console": "4.0.0-beta-*"
            }
        }
    }
}

Maybe some transitive dependency thing going on? But then again, I was under the impression that I really must specify all the bits I was to use.

Some way I can see how it was made available? project.json.lock maybe?

@muratg
Copy link
Contributor

muratg commented Sep 24, 2015

Yeah, project.lock.json should have that information.

@muratg
Copy link
Contributor

muratg commented Sep 24, 2015

BTW, thanks to transitive dependencies, you don't need to specify all the assemblies that you use. :)

@per-samuelsson
Copy link
Author

What about dnu list --details? That give any clues?

Microsoft .NET Development Utility CoreCLR-x64-1.0.0-beta8-15618

Listing dependencies for app1 (C:\Users\Per\Git\Starcounter\dnxweave\src\app1\project.json)

[Target framework DNXCore,Version=v5.0 (dnxcore50)]

Package references:
  Microsoft.CodeAnalysis.Analyzers 1.1.0-beta1-20150812-01
    by Package: Microsoft.CodeAnalysis.Common 1.1.0-beta1-20150812-01

  Microsoft.CodeAnalysis.Common 1.1.0-beta1-20150812-01
    by Package: Microsoft.CodeAnalysis.CSharp 1.1.0-beta1-20150812-01

  Microsoft.CodeAnalysis.CSharp 1.1.0-beta1-20150812-01
    by Package: Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-beta7-15532

  Microsoft.Dnx.Compilation.Abstractions 1.0.0-beta7-15532
    by Package: Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-beta7-15532

* Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-beta7-15532
    by Project: app1 0.1.0, Starcounter 0.1.0

  Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532
    by Package: Microsoft.Dnx.Compilation.Abstractions 1.0.0-beta7-15532

  System.Collections 4.0.11-beta-23225
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532, System.IO.FileSystem 4.0.1-beta-23225, System.Linq 4.0.1-beta-23225

  System.Collections.Immutable 1.1.36
    by Package: Microsoft.CodeAnalysis.Common 1.1.0-beta1-20150812-01, System.Reflection.Metadata 1.1.0-alpha-00009

  System.ComponentModel 4.0.1-beta-23225
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532

  System.Console 4.0.0-beta-23225
    by Project: app1 0.1.0, Starcounter 0.1.0

  System.Diagnostics.Debug 4.0.10
    by Package: System.Linq 4.0.1-beta-23225

  System.Globalization 4.0.0
    by Package: System.Resources.ResourceManager 4.0.0

  System.IO 4.0.11-beta-23225
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532, System.Console 4.0.0-beta-23225, System.IO.FileSystem 4.0.1-beta-23225, System.Reflection 4.1.0-beta-23225

  System.IO.FileSystem 4.0.1-beta-23225
    by Package: Microsoft.Dnx.Compilation.Abstractions 1.0.0-beta7-15532

  System.IO.FileSystem.Primitives 4.0.0
    by Package: System.Console 4.0.0-beta-23225, System.IO.FileSystem 4.0.1-beta-23225

  System.Linq 4.0.1-beta-23225
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532

  System.Private.Uri 4.0.1-beta-23225
    by Package: System.Runtime 4.0.21-beta-23225

  System.Reflection 4.1.0-beta-23225
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532, System.Resources.ResourceManager 4.0.0, System.Runtime.InteropServices 4.0.20

  System.Reflection.Metadata 1.1.0-alpha-00009
    by Package: Microsoft.CodeAnalysis.Common 1.1.0-beta1-20150812-01

  System.Reflection.Primitives 4.0.0
    by Package: System.Reflection 4.1.0-beta-23225, System.Runtime.InteropServices 4.0.20

  System.Resources.ResourceManager 4.0.0
    by Package: System.Console 4.0.0-beta-23225, System.IO.FileSystem 4.0.1-beta-23225, System.Linq 4.0.1-beta-23225

  System.Runtime 4.0.21-beta-23225
    by Package: Microsoft.Dnx.Compilation.CSharp.Abstractions 1.0.0-beta7-15532, Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532, System.Collections 4.0.11-beta-23225, System.ComponentModel 4.0.1-beta-23225, System.Console 4.0.0-beta-23225, System.Diagnostics.Debug 4.0.10, System.Globalization 4.0.0, System.IO 4.0.11-beta-23225, System.IO.FileSystem 4.0.1-beta-23225, System.IO.FileSystem.Primitives 4.0.0, System.Linq 4.0.1-beta-23225, System.Reflection 4.1.0-beta-23225, System.Reflection.Primitives 4.0.0, System.Resources.ResourceManager 4.0.0, System.Runtime.Extensions 4.0.11-beta-23225, System.Runtime.Handles 4.0.0, System.Runtime.InteropServices 4.0.20, System.Text.Encoding 4.0.10, System.Text.Encoding.Extensions 4.0.10, System.Threading 4.0.10, System.Threading.Overlapped 4.0.0, System.Threading.Tasks 4.0.10-beta-23109
    by Project: app1 0.1.0, Starcounter 0.1.0

  System.Runtime.Extensions 4.0.11-beta-23225
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532, System.IO.FileSystem 4.0.1-beta-23225, System.Linq 4.0.1-beta-23225

  System.Runtime.Handles 4.0.0
    by Package: System.IO.FileSystem 4.0.1-beta-23225, System.Runtime.InteropServices 4.0.20, System.Threading.Overlapped 4.0.0

  System.Runtime.InteropServices 4.0.20
    by Package: System.Console 4.0.0-beta-23225, System.IO.FileSystem 4.0.1-beta-23225

  System.Text.Encoding 4.0.10
    by Package: System.Console 4.0.0-beta-23225, System.IO 4.0.11-beta-23225, System.IO.FileSystem 4.0.1-beta-23225, System.Text.Encoding.Extensions 4.0.10

  System.Text.Encoding.Extensions 4.0.10
    by Package: System.Console 4.0.0-beta-23225, System.IO.FileSystem 4.0.1-beta-23225

  System.Threading 4.0.10
    by Package: System.Console 4.0.0-beta-23225, System.IO.FileSystem 4.0.1-beta-23225

  System.Threading.Overlapped 4.0.0
    by Package: System.IO.FileSystem 4.0.1-beta-23225

  System.Threading.Tasks 4.0.10-beta-23109
    by Package: Microsoft.Dnx.Runtime.Abstractions 1.0.0-beta7-15532, System.Console 4.0.0-beta-23225, System.IO 4.0.11-beta-23225, System.IO.FileSystem 4.0.1-beta-23225, System.Threading 4.0.10
    by Project: app1 0.1.0, Starcounter 0.1.0


Project references:
* Starcounter 0.1.0
    by Project: app1 0.1.0

@muratg
Copy link
Contributor

muratg commented Sep 24, 2015

Yup, System.Linq seems to bring it in. :)

@per-samuelsson
Copy link
Author

BTW, thanks to transitive dependencies, you don't need to specify all the assemblies that you use. :)

Ah, so it works like that by design? Yeah, now I remember, thats one of the changes in package management > DNX. So then this dependency "subissue" is demystified and resolved, right? 👍

@muratg
Copy link
Contributor

muratg commented Sep 24, 2015

Correct :) That whole chain is brought in by Microsoft.Dnx.Compilation.CSharp.Abstractions dependency in your project.json.

@cesarblum
Copy link
Contributor

This is by design - Debug.Assert() calls Environment.FailFast(), which will cause this dialog to show up. I think the source of confusion here is that the dialog says "dnx.exe" instead of @per-samuelsson's assembly name, however that is also expected since the actual process running the code is dnx.exe.

@moozzyk
Copy link
Contributor

moozzyk commented Oct 7, 2015

@CesarBS Should Debug.Assert call Environment.FailFast() though? I am pretty sure that on full Clr Debug.Asserts won't crash the process...

@cesarblum
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants