Bug 41233 - Exception.StackTrace crashes VM (assertion at metadata.c:1016)
Summary: Exception.StackTrace crashes VM (assertion at metadata.c:1016)
Status: RESOLVED DUPLICATE of bug 36257
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 4.2.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-05-21 11:39 UTC by Jon Skeet
Modified: 2016-05-21 12:02 UTC (History)
3 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Jon Skeet 2016-05-21 11:39:37 UTC
Using `dotnet` Preview1 (002702). I'm not sure what that means in terms of the version of Mono used - I can't reproduce it with just mcs/mono.

Version information:

$ dotnet --info
.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  15.10
 OS Platform: Linux
 RID:         ubuntu.15.10-x64


  "buildOptions": {
    "emitEntryPoint": true
  "dependencies": {
  "frameworks": {
    "net451": {}


using System;
class Program
    static void Main()
	    throw new Exception();
	catch(System.Exception e)

Restore with `dotnet restore` (fine) and run with `dotnet run`:

* Assertion at metadata.c:1016, condition `idx < t->rows' not met
* Assertion at metadata.c:1016, condition `idx < t->rows' not met
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Diagnostics.StackTrace.get_trace (System.Exception,int,bool) <IL 0x0000f, 0xffffffff>
  at System.Diagnostics.StackTrace..ctor (System.Exception,int,bool) <0x00044>
  at System.Exception.get_StackTrace () <0x00054
Comment 1 Alexander Köplinger [MSFT] 2016-05-21 12:02:36 UTC
This is a problem with the portable pdb code in Mono 4.2, the issue was fixed in the upcoming Mono 4.4 (available in the beta channel).

You can work around the issue in dotnet CLI by using "dotnet run --configuration=Release" because then the CLI doesn't pass --debug to Mono and it skips parsing debug information.

*** This bug has been marked as a duplicate of bug 36257 ***

Note You need to log in before you can comment on or make changes to this bug.