1

I'm trying to make sense out of some stacktraces of a game I'm working on. These are generated on Mac with Mono.

at Microsoft.Xna.Framework.Game.Run () [0x0002c] in <9fdab2ac823a429cb7b8525426626ccc>:0

This tells me the method name (Microsoft.Xna.Framework.Game.Run) and the ILOffset (0x0002c), but I have no idea what 9fdab2ac823a429cb7b8525426626ccc is. It's not the metadata token, it's some sort of GUID.

Could any explain to me what this number is? It's my objective to combine these pieces of information together, then together with the original PDB/MDB files restructure a proper stacktrace.

As a workaround I made my own stacktrace method which also outputs the metadata token, but I would much rather work with the native stacktraces as thrown by Mono.

Lennard Fonteijn
  • 2,561
  • 2
  • 24
  • 39

1 Answers1

2

I have no idea what 9fdab2ac823a429cb7b8525426626ccc

The hash element (in between the <>) is the module version ID (MVID of the assembly module the method belongs to.

These are produced so a native crash (from an AOT'd application) can be symbolized via Mono's symbol directory that is produced during the compile/AOT of the application via

mono --aot=msym-dir=<msym dir> .....

or using mono-symbolicate after the compile phase (you need all the original build artifacts):

mono-symbolicate store-symbols myExeWithDebugPDBsDirectory/msym-dir myExeWithDebugPDBsDirectory

This produces the dir (myEXEwithDebugPDBsDirectory/msym-dir) that contains:

The symbol directory contains subfolder named as a MVID or AOTID

  • MVID subfolders contain .dll/.exe and .mdb files.
  • AOTID subfolder contain .msym files.

You can then later use mono-symbolicate to symbolize your crash (using the msym-dir from the matching application) to produce a "normal" managed code looking exception/stacktrace.

Note: You can also turn those Mono "compact" sequence points off by setting an env. var. before your run your exe:

MONO_DEBUG=no-compact-seq-points mono yourApp.exe

re: Why do my stack traces only include line numbers if the debugger is attached?

SushiHangover
  • 73,120
  • 10
  • 106
  • 165
  • That is quite a bit of obscure information to find (I've tried tons of combinations on Google to find something useful). Thank you so much! I just grabbed the mono-symbolicate of their github, compiled it, and two commands later on my game output-folder (containing only .exe/.dll/.pdb files), I could reverse my stacktraces immediately! If I had known this, this would have saved me a few hours of rolling my own solution, but this is much more elegant. Again thanks :) – Lennard Fonteijn May 09 '18 at 08:12
  • A lot of that information is from the notes of an older Xamarin release, it is a shame they do not have it in a more public document (other then the "hidden" readme within the mono repo and some older release notes from Xamarin) as it really does come in handy – SushiHangover May 09 '18 at 10:40