Bug 59479 - MVID and AOTID do not refer to the same library in stack trace frame
Summary: MVID and AOTID do not refer to the same library in stack trace frame
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: 5.2
Hardware: PC Mac OS
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Manuel de la Peña [MSFT]
Depends on:
Reported: 2017-09-14 03:10 UTC by Alexey Karimov
Modified: 2018-02-08 13:28 UTC (History)
7 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Alexey Karimov 2017-09-14 03:10:57 UTC
I am trying to implement symbolication (to get proper files and line numbers) for crashes of my app, built with Release configuration. mono-symbolicate fails with IL offset not found exceptions. I took its sources and stepped through the whole flow and found out that constructs of "<mvid#aotid>:0" contain UUIDs referencing different libs. Here is the callstack:

  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult ) <0x4b3894 + 0x00190> in <ab923e97c6834d69a08044ea18cafb2a#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult , System.Func`2[T,TResult] , System.Action`1[T] , System.Threading.Tasks.Task`1[TResult] , System.Boolean ) <0x24c218 + 0x00077> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x2840a0 + 0x00028> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task ) <0x286bec + 0x000bf> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task ) <0x286b50 + 0x00087> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task ) <0x286af8 + 0x00043> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x286ea4 + 0x00023> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at XamarinTestApp93.DetailViewController+<BtnNetworkCrash_TouchUpInside>d__64.MoveNext () <0xe1690 + 0x002d3> in <2b4f1755cae8456b833d971e6e70d9b9#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x2840a0 + 0x00028> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object ) <0x286594 + 0x00053> in <75fdc35757ef4b00a24457129d1dc3e2#c8940283130890ed583b99dcf159c9d1>:0 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () <0x3d2edc + 0x0002f> in <9621238dbba548d9bf78e86c49c09cee#c8940283130890ed583b99dcf159c9d1>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () <0x3c73e0 + 0x0002f> in <9621238dbba548d9bf78e86c49c09cee#c8940283130890ed583b99dcf159c9d1>:0 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] , System.IntPtr , System.IntPtr ) <0x3d1f54 + 0x00033> in <9621238dbba548d9bf78e86c49c09cee#c8940283130890ed583b99dcf159c9d1>:0 
  at UIKit.UIApplication.Main (System.String[] , System.String , System.String ) <0x3d1e7c + 0x000cb> in <9621238dbba548d9bf78e86c49c09cee#c8940283130890ed583b99dcf159c9d1>:0 
  at XamarinTestApp93.Application.Main (System.String[] args) <0xdf450 + 0x0002f> in <2b4f1755cae8456b833d971e6e70d9b9#c8940283130890ed583b99dcf159c9d1>:0 

The first frame has this:
mvid: ab923e97c6834d69a08044ea18cafb2a
aotid: c8940283130890ed583b99dcf159c9d1

In fact, all the frames has c8940283130890ed583b99dcf159c9d1 as the aotid. And mono-symbolicate fails for all the frames except ones that are really came from XamarinTestApp93.
Comment 1 Alex Soto [MSFT] 2017-09-18 16:54:20 UTC
Manuel will handle it
Comment 2 Manuel de la Peña [MSFT] 2017-09-18 16:57:47 UTC

We have been working with this lately. Lets take a look. The first thing I need to know is your full environment, and which branch or package of Xamarin.iOS you are using. We have had issues with symbolication and do have a PR to fix those, BUT it has not been landed, so we could use that branch to ensure that we are doing the correct stuff. 

Can you please provide the steps you have used to get to that point, I could guess most of them, but it is a good idea to be in the same page. Also, can you upload the TestApp or can we create one for the both of us to use?

With the above, and the PR https://github.com/xamarin/xamarin-macios/pull/1663 we can start debugging the entire process and ensure it does accommodate your needs.
Comment 3 Alexey Karimov 2017-09-19 03:56:53 UTC
Hello, I am on macOS 10.12.6 and here is my Xamarin env:

Visual Studio Community 2017 for Mac
Version 7.1.3 (build 1)
Installation UUID: 031a9dee-1ced-4f23-b4e8-71e18a9bcbf9
	Mono (d15-3/14f2c81) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000224


.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Version: 2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Version: (Visual Studio Community)
Android SDK: /Users/akarimov/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Android Designer EPL code available here:

Apple Developer Tools
Xcode 8.3.3 (12175.1)
Build 8E3004b

Version: (Visual Studio Community)

Xamarin Inspector
Version: 1.3.0
Hash: 8c298a5
Branch: 1.3-release
Build date: Thu, 14 Sep 2017 21:21:26 GMT
Client compatibility: 1

Version: (Visual Studio Community)
Hash: 8a391069
Branch: d15-3
Build date: 2017-08-28 16:51:11-0400

Build Information
Release ID: 701030001
Git revision: ba94259b26824844f4d2c76c794738eb75b85726
Build date: 2017-08-25 16:28:43-04
Xamarin addins: ee499cfb63ae406b1e394bf6a159ad2953f7fab6
Build lane: monodevelop-lion-d15-3

Operating System
Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

Enabled user installed addins
NuGet Package Explorer 0.2
Comment 4 Alexey Karimov 2017-09-19 03:59:14 UTC
Don't have minimal test app right now. Will prepare it and upload with the steps to reproduce this issue.
Comment 5 Manuel de la Peña [MSFT] 2017-09-19 10:10:59 UTC
Thanks, with the min test app we will be in the same page and we can get this to work as you expect. I'll be waiting for it. Will also try to get a package with the fixes for you to test ASAP. Will post here a private comment with it.
Comment 7 Manuel de la Peña [MSFT] 2018-02-08 13:28:16 UTC
@Alexey I'm going to close the bug. Feel free if the issue continues.