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

Build failed in Release with exit code 139 #26369

Closed
AlexanderEgorov opened this issue Dec 3, 2024 · 8 comments · Fixed by #26387
Closed

Build failed in Release with exit code 139 #26369

AlexanderEgorov opened this issue Dec 3, 2024 · 8 comments · Fixed by #26387
Assignees
Milestone

Comments

@AlexanderEgorov
Copy link

Description

If XAML contains code that sets a property of the GridLength? type, the release build is failed.

  • Android: Error: Microsoft.Android.Sdk.Aot.targets(110,5): error : Precompiling failed for DXMauiApp.dll with exit code 139.
    *iOS: Error: Xamarin.Shared.Sdk.targets(1279,3): error : Failed to AOT compile DXMauiApp.dll, the AOT compiler exited with code 139.

Steps to Reproduce

  1. Download the reproduction repository
  2. Try to build the project in the Release configuration

Expected outcome: build successful
Actual outcome: error with exit code 139.

Link to public reproduction project repository

https://github.com/AlexanderEgorov/dotnet-maui-bug-build-release

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

@kevinxufei
Copy link

kevinxufei commented Dec 3, 2024

I can repro this issue at Android platform on the latest 17.13 Preview 1(9.0.0 & 9.0.10).

@mattleibow
Copy link
Member

Added a binlog msbuild.zip

@mattleibow
Copy link
Member

@jonathanpeppers @rolfbjarne thoughts?

@jonathanpeppers
Copy link
Member

mono-aot-cross just has an exit code with no error message:

[DXMauiApp.dll] Running: C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x64\9.0.0\Sdk\..\tools\mono-aot-cross.exe --response="C:\Users\maleib\AppData\Local\Temp\tmpklrmaw.tmp"
...
[DXMauiApp.dll] Exit code: -1073741819

@mattleibow do you still have DXMauiApp.dll on disk? We can run ilverify on it to see if it is valid.

But we can probably pass this to dotnet/runtime for them to take a look.

@jonathanpeppers jonathanpeppers transferred this issue from dotnet/maui Dec 4, 2024
@jonathanpeppers
Copy link
Member

After inspecting the IL, we think the Xaml compiler is doing something incorrect for a nullable GridLength?.

Moving back to MAUI.

@jonathanpeppers jonathanpeppers transferred this issue from dotnet/runtime Dec 4, 2024
Copy link

We've found some similar issues:

  • #26322 , similarity score: 100%

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@StephaneDelcroix StephaneDelcroix added this to the .NET 9 SR3 milestone Dec 4, 2024
@StephaneDelcroix
Copy link
Contributor

StephaneDelcroix commented Dec 5, 2024

IL generated by XAML NullableGridLength="30"

IL_001a: ldloc.0
IL_001b: ldsfld class [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableProperty Microsoft.Maui.Controls.Xaml.UnitTests.Maui26369::NullableGridLengthProperty /* 0A00076A */
IL_0020: ldc.r8 30
IL_0029: newobj instance void [Microsoft.Maui]Microsoft.Maui.GridLength::.ctor(float64) /* 0A000325 */
IL_002e: box valuetype [System.Runtime]System.Nullable`1<valuetype [Microsoft.Maui]Microsoft.Maui.GridLength> /* 1B0001C1 */
IL_0033: callvirt instance void [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableObject::SetValue(class [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableProperty, object) /* 0A0001E8 */

IL generated by C# SetValue(NullableGridLengthProperty, new GridLength(42));

IL_000f: ldarg.0
IL_0010: ldsfld class [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableProperty Microsoft.Maui.Controls.Xaml.UnitTests.Maui26369::NullableGridLengthProperty /* 040004D2 */
IL_0015: ldc.r8 42
IL_001e: newobj instance void [Microsoft.Maui]Microsoft.Maui.GridLength::.ctor(float64) /* 0A000325 */
IL_0023: box [Microsoft.Maui]Microsoft.Maui.GridLength /* 01000191 */
IL_0028: call instance void [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableObject::SetValue(class [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableProperty, object) /* 0A0001E8 */

@StephaneDelcroix
Copy link
Contributor

IL generated by XAMLC after the change

IL_001a: ldloc.0
IL_001b: ldsfld class [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableProperty Microsoft.Maui.Controls.Xaml.UnitTests.Maui26369::NullableGridLengthProperty /* 0A000769 */
IL_0020: ldc.r8 30
IL_0029: newobj instance void [Microsoft.Maui]Microsoft.Maui.GridLength::.ctor(float64) /* 0A000324 */
IL_002e: box [Microsoft.Maui]Microsoft.Maui.GridLength /* 01000191 */
IL_0033: callvirt instance void [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableObject::SetValue(class [Microsoft.Maui.Controls]Microsoft.Maui.Controls.BindableProperty, object) /* 0A0001E8 */

StephaneDelcroix added a commit that referenced this issue Dec 5, 2024
StephaneDelcroix added a commit that referenced this issue Dec 5, 2024
PureWeen pushed a commit that referenced this issue Dec 5, 2024
* [XC] SetValue on nullable BP types

- fixes #26369

* [XC] SetValue on nullable BP types

- fixes #26369
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants