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

iOS release build: "Could not AOT the assembly" -> "p - buf < buf_size not met" #7637

Closed
dalexsoto opened this Issue Mar 15, 2018 · 9 comments

Comments

Projects
None yet
6 participants
@dalexsoto
Member

dalexsoto commented Mar 15, 2018

From @Amenti on March 15, 2018 15:20

Steps to Reproduce

I can't provide the repository to reproduce this, sorry. It is a complex project though and I can reproduce it by building a release build with Visual Studio for Windows and Mac.

Expected Behavior

Proper AppStore release build for iOS.

Actual Behavior

Build is canceled with the error:

Could not AOT assembly ...

11>  * Assertion at /Users/builder/data/lanes/5808/1c6f300e/source/xamarin-macios/external/mono/mono/mini/aot-compiler.c:6320, condition `p - buf < buf_size' not met

I tried downgrading Visual Studio for Windows and also to build an older source code revision (which is available in the app store) but I can't build it anymore due to the error.

The debug build works fine and also runs in the simulator.

Environment

Windows

Microsoft Visual Studio Professional 2017 
Version 15.6.2
VisualStudio.15.Release/15.6.2+27428.2005
Microsoft .NET Framework
Version 4.7.02556

Installed Version: Professional

Visual F# Tools 10.1 for F# 4.1   00369-60000-00001-AA466
Microsoft Visual F# Tools 10.1 for F# 4.1

Application Insights Tools for Visual Studio Package   8.11.10212.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.40301.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

Azure App Service Tools v3.0.0   15.0.40215.0
Azure App Service Tools v3.0.0

C# Tools   2.7.0-beta3-62707-11. Commit Hash: 75dfc9b33ed624dff3985c7435c902c3c58c0e5c
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.9.11-pre (71eb098)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools   15.1.61801.210
Microsoft SQL Server Data Tools

TypeScript Tools   15.6.20202.3
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   2.7.0-beta3-62707-11. Commit Hash: 75dfc9b33ed624dff3985c7435c902c3c58c0e5c
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.27428.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   4.9.0.749 (9b0fce36d)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   4.10.58 (cee1369d0)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK   8.2.0.15 (HEAD/22d97e153)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   11.8.0.20 (1c6f300)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

MacOs

=== Visual Studio Professional 2017 for Mac ===Version 7.4 (build 1033)

Installation UUID: fb92161a-7228-408e-93c8-1c3578aa5a59

Runtime:

    Mono 5.8.0.129 (2017-10/835a98d8559) (64-bit)

    GTK+ 2.24.23 (Raleigh theme)    Package version: 508000129=== NuGet ===Version: 4.3.1.4445=== .NET Core ===Runtime: /usr/local/share/dotnet/dotnet

Runtime Versions:

    2.0.5

    2.0.0

    1.0.1

SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks

SDK Versions:

    2.1.4

    2.0.0

    1.0.0-preview2-003131

MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/msbuild/15.0/bin/Sdks=== Xamarin.Profiler ===Version: 1.6.1

Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler=== Xamarin.Android ===Version: 8.2.0.15 (Visual Studio Professional)

Android SDK: /Users/dannywernicke_privat/Library/Developer/Xamarin/android-sdk-macosx

    Supported Android versions:

        4.0.3 (API level 15)

        6.0   (API level 23)

        7.1   (API level 25)SDK Tools Version: 25.2.5

SDK Platform Tools Version: 25.0.3

SDK Build Tools Version: 23.0.2Java SDK: /usr

java version "1.7.0_71"

Java(TM) SE Runtime Environment (build 1.7.0_71-b14)

Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)Android Designer EPL code available here:

https://github.com/xamarin/AndroidDesigner.EPL=== Apple Developer Tools ===Xcode 8.3.3 (12175.1)

Build 8E3004b=== Xamarin.Mac ===Version: 4.2.0.20 (Visual Studio Professional)=== Xamarin.iOS ===Version: 11.8.0.20 (Visual Studio Professional)

Hash: 1c6f300e

Branch: d15-6

Build date: 2018-02-07 23:42:40-0500=== Xamarin Inspector ===Version: 1.4.0

Hash: b3f92f9

Branch: master

Build date: Fri, 19 Jan 2018 22:00:34 GMT

Client compatibility: 1=== Build Information ===Release ID: 704001033

Git revision: 053991068f3c88497d3e5cc52fe7fdf57c28b62f

Build date: 2018-02-28 05:02:28-05

Xamarin addins: cc3283953e0af0b8bfab1bdfdf847d9e403c4606

Build lane: monodevelop-lion-d15-6=== Operating System ===Mac OS X 10.13.3

Darwin 17.4.0 Darwin Kernel Version 17.4.0

   Sun Dec 17 09:19:54 PST 2017

   root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64=== Enabled user installed addins ===Internet of Things (IoT) development (Preview) 7.1

Build Logs

Buildlog

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

@dalexsoto dalexsoto added bug labels Mar 15, 2018

@dalexsoto

This comment has been minimized.

Member

dalexsoto commented Mar 15, 2018

From @rolfbjarne on March 15, 2018 16:15

@Amenti are you able to provide compiled assemblies? In particular I believe we'll be able to reproduce this if we can get the contents of the /Users/dannywernicke_privat/Library/Caches/Xamarin/mtbs/builds/TeacherStudio.XamarinForms.iOS/4242f4ff0d90da2fbec3ed128c40cbf4/obj/iPhone/AppStore/mtouch-cache directory, which only contain assemblies and other intermediate build files (but no source code).

@dalexsoto

This comment has been minimized.

Member

dalexsoto commented Mar 15, 2018

From @Amenti on March 15, 2018 16:33

Great, thanks a lot. 👍 I did send you an email with a link to the files.

@dalexsoto

This comment has been minimized.

Member

dalexsoto commented Mar 15, 2018

From @rolfbjarne on March 15, 2018 17:30

Private test case stored here: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/583998. To repro: download attached zip and execute build.sh.

@spouliot

This comment has been minimized.

Member

spouliot commented Mar 15, 2018

@vargaz from the description this seems to be a regression

@rolfbjarne

This comment has been minimized.

vargaz added a commit to vargaz/mono that referenced this issue Mar 15, 2018

@vargaz vargaz closed this in #7638 Mar 15, 2018

vargaz added a commit that referenced this issue Mar 15, 2018

monojenkins added a commit to monojenkins/mono that referenced this issue Mar 15, 2018

monojenkins added a commit to monojenkins/mono that referenced this issue Mar 15, 2018

marek-safar added a commit that referenced this issue Mar 16, 2018

marek-safar added a commit that referenced this issue Mar 16, 2018

@Amenti

This comment has been minimized.

Amenti commented Mar 17, 2018

Wow, you fixed that very fast. Thanks a lot. Is there any way to workaround this issue for me until this fix is released?

@lewurm

This comment has been minimized.

Member

lewurm commented Mar 18, 2018

@Amenti You asked for it... though, I don't recommend this for production. Use it at your own risk. I'm assuming you are using macOS.

We gonna binary patch the AOT compiler. First, let's make a backup:


$ export AOTC=/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/arm64-darwin-mono-sgen

$ sudo cp $AOTC{,.BACKUP}


Let’s look for the offset we need to patch:


$ objdump -disassemble $AOTC | grep '8d 8c 11 00 08 00 00'
1000918a6:	8d 8c 11 00 08 00 00 	leal	2048(%rcx,%rdx), %ecx


This instruction determines the value passed to malloc, which we wanna increase. Before that, let's 


verify the location in the actual binary (0x918a6 is potentially different in your case):

$ xxd -s 0x918a6 $AOTC | head -n 1
000918a6: 8d8c 1100 0800 0089 8d88 f4ff ff48 63f9  .............Hc.


And now let’s patch it and verify again:



$ echo "918a6: 8d8c 1100 1f 00 00" | xxd -r - $AOTC

$ xxd -s 0x918a6 $AOTC | head -n 1
000918a6: 8d8c 1100 1f00 0089 8d88 f4ff ff48 63f9  .............Hc.


we replaced 0x800 (2048) with 0x1f00 (7936). Dirty workaround, but that's sufficient for the repro that was provided.

@vargaz

This comment has been minimized.

Member

vargaz commented Mar 18, 2018

There is an async method named Import somewhere in EarlyNerds.TeacherStudio.ViewModels.SyncSettingsViewModel. Simplifying it, or moving parts of it to another method could probably work around the problem.

@Amenti

This comment has been minimized.

Amenti commented Mar 18, 2018

@vargaz @lewurm Thanks a lot for all your help! Reducing the mentioned method did help. 🥇

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Mar 22, 2018

jonpryor added a commit to jonpryor/xamarin-android that referenced this issue Mar 24, 2018

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Mar 24, 2018

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Apr 25, 2018

Bump to mono/2018-02/0c5a524e (#1289)
Bumps to Java.Interop/master/0afb2b0f
Bumps to llvm/master/a9cfb50e.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=11771
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=15051
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=19436
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=45901
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=56071
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59184
fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60065
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60225
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60298
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60359
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60568
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60756
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60848
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60862
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60900
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60904
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=60986
Fixes: https://github.com/mono/mono/issues/59400
Fixes: mono/mono#6169
Fixes: mono/mono#6187
Fixes: mono/mono#6192
Fixes: mono/mono#6255
Fixes: mono/mono#6264
Fixes: mono/mono#6266
Fixes: mono/mono#6281
Fixes: mono/mono#6283
Fixes: mono/mono#6320
Fixes: mono/mono#6339
Fixes: mono/mono#6343
Fixes: mono/mono#6349
Fixes: mono/mono#6379
Fixes: mono/mono#6383
Fixes: mono/mono#6401.
Fixes: mono/mono#6411
Fixes: mono/mono#6414
Fixes: mono/mono#6490
Fixes: mono/mono#6721
Fixes: mono/mono#6767
Fixes: mono/mono#6777
Fixes: mono/mono#6848
Fixes: mono/mono#6940
Fixes: mono/mono#6948
Fixes: mono/mono#6998
Fixes: mono/mono#7016
Fixes: mono/mono#7085
Fixes: mono/mono#7086
Fixes: mono/mono#7095
Fixes: mono/mono#7137
Fixes: mono/mono#7184
Fixes: mono/mono#7240
Fixes: mono/mono#7262
Fixes: mono/mono#7289
Fixes: mono/mono#7338
Fixes: mono/mono#7356
Fixes: mono/mono#7364
Fixes: mono/mono#7378
Fixes: mono/mono#7389
Fixes: mono/mono#7460
Fixes: mono/mono#7535
Fixes: mono/mono#7536
Fixes: mono/mono#7610
Fixes: mono/mono#7624
Fixes: mono/mono#7637
Fixes: mono/mono#7655
Fixes: mono/mono#7657
Fixes: mono/mono#7685
Fixes: mono/mono#7786
Fixes: mono/mono#7792
Fixes: mono/mono#7822
Fixes: mono/mono#7860
Fixes: mono/mono#8089
Fixes: mono/mono#8267
Fixes: mono/mono#8409
Fixes: xamarin/maccore#628
Fixes: xamarin/maccore#629
Fixes: xamarin/maccore#673
Fixes: xamarin/maccore#673
Fixes: #1561

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Aug 8, 2018

Bump to mono/mono:2018-04@f3a2216b (#1503)
Fixes: #1130
Fixes: #1561 (comment)
Fixes: #1845
Fixes: #1951

Context: https://bugzilla.xamarin.com/show_bug.cgi?id=10087
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=11771
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=12850
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18941
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=19436
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=25444
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=33208
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59184
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59400
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59779
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60065
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60843
Context: mono/mono#6174
Context: mono/mono#6178
Context: mono/mono#6180
Context: mono/mono#6181
Context: mono/mono#6186
Context: mono/mono#6187
Context: mono/mono#6211
Context: mono/mono#6266
Context: mono/mono#6579
Context: mono/mono#6666
Context: mono/mono#6752
Context: mono/mono#6801
Context: mono/mono#6812
Context: mono/mono#6848
Context: mono/mono#6940
Context: mono/mono#6948
Context: mono/mono#6998
Context: mono/mono#6999
Context: mono/mono#7016
Context: mono/mono#7085
Context: mono/mono#7086
Context: mono/mono#7095
Context: mono/mono#7134
Context: mono/mono#7137
Context: mono/mono#7145
Context: mono/mono#7184
Context: mono/mono#7240
Context: mono/mono#7262
Context: mono/mono#7289
Context: mono/mono#7338
Context: mono/mono#7356
Context: mono/mono#7364
Context: mono/mono#7378
Context: mono/mono#7389
Context: mono/mono#7449
Context: mono/mono#7460
Context: mono/mono#7535
Context: mono/mono#7536
Context: mono/mono#7537
Context: mono/mono#7565
Context: mono/mono#7588
Context: mono/mono#7596
Context: mono/mono#7610
Context: mono/mono#7613
Context: mono/mono#7620
Context: mono/mono#7624
Context: mono/mono#7637
Context: mono/mono#7655
Context: mono/mono#7657
Context: mono/mono#7661
Context: mono/mono#7685
Context: mono/mono#7696
Context: mono/mono#7729
Context: mono/mono#7786
Context: mono/mono#7792
Context: mono/mono#7805
Context: mono/mono#7822
Context: mono/mono#7828
Context: mono/mono#7860
Context: mono/mono#7864
Context: mono/mono#7903
Context: mono/mono#7920
Context: mono/mono#8089
Context: mono/mono#8143
Context: mono/mono#8267
Context: mono/mono#8311
Context: mono/mono#8340
Context: mono/mono#8409
Context: mono/mono#8417
Context: mono/mono#8430
Context: mono/mono#8698
Context: mono/mono#8701
Context: mono/mono#8712
Context: mono/mono#8721
Context: mono/mono#8726
Context: mono/mono#8866
Context: mono/mono#9023
Context: mono/mono#9031
Context: mono/mono#9033
Context: mono/mono#9044
Context: mono/mono#9179
Context: mono/mono#9318
Context: mono/mono#9318
Context: xamarin/maccore#628
Context: xamarin/maccore#629
Context: xamarin/maccore#673

jonpryor added a commit to xamarin/xamarin-android that referenced this issue Aug 13, 2018

Bump to mono/mono:2018-04@f3a2216b (#1503)
Fixes: #1130
Fixes: #1561 (comment)
Fixes: #1845
Fixes: #1951

Context: https://bugzilla.xamarin.com/show_bug.cgi?id=10087
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=11771
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=12850
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=18941
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=19436
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=25444
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=33208
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=58413
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59184
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59400
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=59779
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60065
Context: https://bugzilla.xamarin.com/show_bug.cgi?id=60843
Context: mono/mono#6174
Context: mono/mono#6178
Context: mono/mono#6180
Context: mono/mono#6181
Context: mono/mono#6186
Context: mono/mono#6187
Context: mono/mono#6211
Context: mono/mono#6266
Context: mono/mono#6579
Context: mono/mono#6666
Context: mono/mono#6752
Context: mono/mono#6801
Context: mono/mono#6812
Context: mono/mono#6848
Context: mono/mono#6940
Context: mono/mono#6948
Context: mono/mono#6998
Context: mono/mono#6999
Context: mono/mono#7016
Context: mono/mono#7085
Context: mono/mono#7086
Context: mono/mono#7095
Context: mono/mono#7134
Context: mono/mono#7137
Context: mono/mono#7145
Context: mono/mono#7184
Context: mono/mono#7240
Context: mono/mono#7262
Context: mono/mono#7289
Context: mono/mono#7338
Context: mono/mono#7356
Context: mono/mono#7364
Context: mono/mono#7378
Context: mono/mono#7389
Context: mono/mono#7449
Context: mono/mono#7460
Context: mono/mono#7535
Context: mono/mono#7536
Context: mono/mono#7537
Context: mono/mono#7565
Context: mono/mono#7588
Context: mono/mono#7596
Context: mono/mono#7610
Context: mono/mono#7613
Context: mono/mono#7620
Context: mono/mono#7624
Context: mono/mono#7637
Context: mono/mono#7655
Context: mono/mono#7657
Context: mono/mono#7661
Context: mono/mono#7685
Context: mono/mono#7696
Context: mono/mono#7729
Context: mono/mono#7786
Context: mono/mono#7792
Context: mono/mono#7805
Context: mono/mono#7822
Context: mono/mono#7828
Context: mono/mono#7860
Context: mono/mono#7864
Context: mono/mono#7903
Context: mono/mono#7920
Context: mono/mono#8089
Context: mono/mono#8143
Context: mono/mono#8267
Context: mono/mono#8311
Context: mono/mono#8340
Context: mono/mono#8409
Context: mono/mono#8417
Context: mono/mono#8430
Context: mono/mono#8698
Context: mono/mono#8701
Context: mono/mono#8712
Context: mono/mono#8721
Context: mono/mono#8726
Context: mono/mono#8866
Context: mono/mono#9023
Context: mono/mono#9031
Context: mono/mono#9033
Context: mono/mono#9044
Context: mono/mono#9179
Context: mono/mono#9318
Context: mono/mono#9318
Context: xamarin/maccore#628
Context: xamarin/maccore#629
Context: xamarin/maccore#673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment