Bug 53158 - Application built with wrong libmono-sgen.dylib when profiling tvOS app
Summary: Application built with wrong libmono-sgen.dylib when profiling tvOS app
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.3.1 (15.1)
Hardware: PC Mac OS
: Highest normal
Target Milestone: 15.1
Assignee: Emanuel
URL:
Depends on:
Blocks:
 
Reported: 2017-03-08 17:19 UTC by Rodrigo Moya
Modified: 2017-03-22 12:41 UTC (History)
5 users (show)

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


Attachments
Logs (11.66 KB, application/x-zip-compressed)
2017-03-22 12:41 UTC, Swati Gangrade
Details


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 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:
Status:
VERIFIED FIXED

Description Rodrigo Moya 2017-03-08 17:19:11 UTC
With 15.1 Alpha 2 update, it's impossible to profile tvOS application, as it seems the included libmono-sgen.dylib is wrong or truncated:

Application crashes as soon as started:

Launched com.companyname.TVApp1 with pid 5517: 2017-03-08 16:52:20Z
Xamarin.Messaging.Client.MessagingClient: Verbose: 0: Sending Message XamarinProfiler.Core.Messaging.StatusChangedMessage to topic xp/1.3.3.3/status-changed: 2017-03-08 16:52:21Z
Xamarin.Messaging.Client.MessagingClient: Verbose: 0: Sending Message 
Xamarin.Messaging.Profiler.Agent.RunManager: Information: 0: [2017-03-08 17:52:21.4111] Output received: Xamarin.Hosting: Simulated process has exited.: 2017-03-08 16:52:21Z

and looking at the crash report:

Process:               TVApp1 [5831]
Path:                  /Users/USER/Library/Developer/CoreSimulator/Devices/54DD29D5-B989-47E2-8D4F-BBF8F8BB92BE/data/Containers/Bundle/Application/F8ED20ED-6336-46A8-A3D0-37CA3142FF2C/TVApp1.app/TVApp1
Identifier:            TVApp1
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [5774]
Responsible:           TVApp1 [5831]
User ID:               501

Date/Time:             2017-03-08 18:03:23.178 +0100
OS Version:            Mac OS X 10.12.3 (16D32)
Report Version:        12
Anonymous UUID:        3B9D435F-4E1F-3630-0963-B61C1584BD56

Sleep/Wake UUID:       B27D7CDE-1644-4254-BB0D-C5F479EBA38B

Time Awake Since Boot: 360000 seconds
Time Since Wake:       13000 seconds

System Integrity Protection: disabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/usr/lib
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk
DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/System/Library/Frameworks
DYLD_SHARED_REGION=avoid

Dyld Error Message:
  Library not loaded: @rpath/libmonosgen-2.0.dylib
  Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/54DD29D5-B989-47E2-8D4F-BBF8F8BB92BE/data/Containers/Bundle/Application/F8ED20ED-6336-46A8-A3D0-37CA3142FF2C/TVApp1.app/TVApp1
  Reason: no suitable image found.  Did find:
        /Users/rodrigo/Library/Developer/CoreSimulator/Devices/54DD29D5-B989-47E2-8D4F-BBF8F8BB92BE/data/Containers/Bundle/Application/F8ED20ED-6336-46A8-A3D0-37CA3142FF2C/TVApp1.app/libmonosgen-2.0.dylib: file too short

Same app profiled on Mac via XS works, so I guess something's wrong on the build/ssh copy steps in VS when building the app?
Comment 1 Rodrigo Moya 2017-03-08 17:22:05 UTC
BTW, running apps results in the same error
Comment 2 Emanuel 2017-03-10 14:31:57 UTC
Open PRs:
- d15-1 branch: https://github.com/xamarin/XamarinVS/pull/7060
- master branch: https://github.com/xamarin/XamarinVS/pull/7061
Comment 3 Saurabh Paunikar 2017-03-21 10:24:51 UTC
Hi Rodrigo,

Can you please help me to reproduce this issue.
Comment 4 Swati Gangrade 2017-03-22 12:41:33 UTC
Created attachment 20668 [details]
Logs

Bug is retested and verified in below build configuration :
1. Xamarin Studio Enterprise-Version 6.3 (build 853)
2. Xamarin.Profiler-Version: 1.4.0
3. Xamarin.iOS- Version: 10.8.0.27 (Visual Studio Enterprise Trial)
4. Xamarin.Android-Version: 7.2.0.6 (Visual Studio Enterprise Trial)
5. Xamarin.Mac-Version: 3.2.0.27 (Visual Studio Enterprise Trial)
6. Operating System-Mac OS X 10.12.2

Actual result- For tvOSApp profiling is working properly