Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many scary "Your mono runtime and class libraries are out of sync" mono warnings when building for device #10598

Closed
rolfbjarne opened this issue Sep 13, 2018 · 3 comments

Comments

@rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Sep 13, 2018

From @chamons on August 9, 2018 21:42

Steps to Reproduce

  1. Install Alpha Channel
  2. New Single View iOS App
  3. Build for generic device and review output.
    /Applications/Xcode94.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -framework UIKit -framework Foundation -weak_framework CFNetwork -Xlinker -rpath -Xlinker @executable_path /Users/donblas/Projects/HelloIOS/obj/iPhone/Debug/mtouch-cache/arm64/Xamarin.iOS.dll.o /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.dylib /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.dylib -lz -liconv -gdwarf-2 -std=c99 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.11/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode94.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -Qunused-arguments -miphoneos-version-min=11.4 -arch arm64 -shared -read_only_relocs suppress -install_name @rpath/libXamarin.iOS.dll.dylib -fapplication-extension -o /Users/donblas/Projects/HelloIOS/obj/iPhone/Debug/mtouch-cache/arm64/libXamarin.iOS.dll.dylib -DDEBUG
    Mono Ahead of Time compiler - compiling assembly /Users/donblas/Projects/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/mscorlib.dll
    AOTID 3585DBA3-DF9F-C621-1525-BBCEFD2C8102
    cant resolve internal call to "System.Runtime.Remoting.Proxies.RealProxy::InternalGetProxyType" (tested without signature also)
    
    Your mono runtime and class libraries are out of sync.
    The out of sync library is: /Users/donblas/Projects/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/mscorlib.dll
    
    When you update one from git you need to update, compile and install
    the other too.
    Do not report this as a bug unless you're sure you have updated correctly:
    you probably have a broken mono install.
    If you see other errors or faults after this message they are probably related
    and you need to fix your mono install first.
    cant resolve internal call to "System.Runtime.Remoting.Proxies.RealProxy::InternalGetProxyType" (tested without signature also)

Expected Behavior

No scary mono mismatch warnings

Actual Behavior

Lots of scary warnings in build log

Environment

https://gist.github.com/chamons/f84a3b354fe3e74b48ba7a79e17ff7c1

$ ls -la /Library/Frameworks/Mono.framework/Versions/
total 0
drwxr-xr-x   5 root  admin  160 Aug  9 16:20 .
drwxr-xr-x   9 root  admin  288 Aug  9 16:20 ..
drwxr-xr-x  11 root  admin  352 Aug  9 16:20 5.12.0
drwxr-xr-x  11 root  admin  352 Aug  9 09:05 5.14.0
lrwxr-xr-x   1 root  admin   50 Aug  9 16:20 Current -> /Library/Frameworks/Mono.framework/Versions/5.12.0

Build Logs

https://gist.github.com/chamons/c64cd8f21a9a317faed7cce18ac5f5f5

Example Project (If Possible)

HelloIOS.zip

Copied from original issue: xamarin/xamarin-macios#4608

@rolfbjarne

This comment has been minimized.

Copy link
Member Author

@rolfbjarne rolfbjarne commented Sep 13, 2018

From @chamons on August 9, 2018 21:48

This does not happen with current stable.

@rolfbjarne

This comment has been minimized.

Copy link
Member Author

@rolfbjarne rolfbjarne commented Sep 13, 2018

This happens with the mono-2018-06 branch as well, I get the following icall failures:

  • cant resolve internal call to "Foundation.NSObject::xamarin_release_managed_ref" (tested without signature also)
  • cant resolve internal call to "Foundation.NSObject::xamarin_create_managed_ref" (tested without signature also)
Entire output
$ MONO_PATH=/Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build /work/maccore/2018-06/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=float32  --aot=mtriple=arm64-ios,data-outfile=/Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/arm64/Xamarin.iOS.aotdata.arm64,static,asmonly,direct-icalls,full,dwarfdebug,no-direct-calls,outfile=/Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/arm64/Xamarin.iOS.dll.s "/Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll"
Mono Ahead of Time compiler - compiling assembly /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll
AOTID AE98D055-971C-98EB-B36A-36A6D5716442
cant resolve internal call to "Foundation.NSObject::xamarin_release_managed_ref" (tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
cant resolve internal call to "Foundation.NSObject::xamarin_release_managed_ref" (tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
cant resolve internal call to "Foundation.NSObject::xamarin_create_managed_ref" (tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
cant resolve internal call to "Foundation.NSObject::xamarin_create_managed_ref" (tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
cant resolve internal call to "Foundation.NSObject::xamarin_release_managed_ref" (tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
cant resolve internal call to "Foundation.NSObject::xamarin_create_managed_ref" (tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: /Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/3-Build/Xamarin.iOS.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
Code: 115024(58%) Info: 3308(1%) Ex Info: 60150(30%) Unwind Info: 2416(1%) Class Info: 4652(2%) PLT: 553(0%) GOT Info: 7240(3%) Offsets: 3100(1%) GOT: 7080
Compiled: 610/610 (100%), No GOT slots: 301 (49%), Direct calls: 91 (17%)
Output file: '/Users/rolf/Downloads/HelloIOS/obj/iPhone/Debug/mtouch-cache/arm64/Xamarin.iOS.dll.s'.
Linking symbol: '_mono_aot_module_Xamarin_iOS_info'.
JIT time: 36 ms, Generation time: 26 ms, Assembly+Link time: 0 ms.

We have a few internal calls: https://github.com/xamarin/xamarin-macios/blob/ab50c94add3492f7217197471f681ffa2ed19c1f/src/Foundation/NSObject2.cs#L156-L163

We tell the Mono runtime about these at startup: https://github.com/xamarin/xamarin-macios/blob/ab50c94add3492f7217197471f681ffa2ed19c1f/runtime/runtime.m#L1347-L1348 and https://github.com/xamarin/xamarin-macios/blob/ab50c94add3492f7217197471f681ffa2ed19c1f/runtime/runtime.m#L886.

The problem occurs when running the AOT compiler: it tries to look up the calls, but fails (because our startup code is obviously not executed when AOT-compiling), thus printing these warnings.

I'm moving mono, since this looks like something that needs to be fixed there.

@marek-safar

This comment has been minimized.

Copy link
Member

@marek-safar marek-safar commented Sep 21, 2018

@vargaz should AOT compile not print a warning about calls registered via mono_add_internal_call ?

vargaz added a commit to vargaz/mono that referenced this issue Sep 23, 2018
vargaz added a commit to vargaz/mono that referenced this issue Sep 23, 2018
vargaz added a commit to vargaz/mono that referenced this issue Sep 23, 2018
vargaz added a commit to vargaz/mono that referenced this issue Sep 24, 2018
…ookup_internal_call_full () to icall-internals.h

since its not a public api function.

Fixes mono#10598.
luhenry added a commit that referenced this issue Sep 25, 2018
…ookup_internal_call_full () to icall-internals.h (#10760)

since its not a public api function.

Fixes #10598.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.