-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Updating from 7.0.100 to 7.0.101 crashes msbuild on mac #30271
Comments
@agocke @jtschuster @LakshanF @MichalStrehovsky @tlakollo @vitek-karas @VSadov I'm not sure exactly where to route this, could someone look at this MacOS native crash during a build that seems to have been introduced in 7.0.101? |
MAUI goes to Mono. @steveisok |
During build time I believe it's still using desktop .NET w/ CoreCLR. The mono runtime becomes active when running the app. |
Ah, I misunderstood. I didn't realize that this was |
The crash dump is some sort of JSON, the interesting bit:
Looks like we were already running some code when macOS decided it's not going to let us finish. I don't know who's the unlucky person on the team who deals with this Apple stuff. Cc @mangod9 @janvorli? |
I'll take a look. |
I was trying to repro it on my mac, but the build seems to require Android SDK. Since I can only access the mac via SSH console, is there a way to install it from console? |
I see an msbuild crash om musl-arm as well That is in dotnet/runtime#79894 , not sure if related.
|
We track that in dotnet/runtime#76759. On Linux, it cannot be code signing related (if we're to trust the dump JSON). |
Any updates on this issue? I see dotnet/runtime#79894 was merged, does that help us? |
@janvorli Please let me know if you need help getting set up with anything mobile. This is a P0 issue for the maui team |
@steveisok I am stuck on the build failing due to requiring Android SDK. If you can share details on how to install it on macOS from the command line, it would be awesome. I don't have my macs connected to screens, I just SSH to them. |
@Redth @mattleibow Jan should install the maui workload here, right? If so, can you provide him with the right command? |
Ah no. We are trying to build maui. Step 4 will install the sdk and required workloads I to the Maui directory. A separate install of the sdk. |
@janvorli It may be easier to follow the issue steps since that'll bring down the android sdk. |
I've followed the steps and it didn't. It failed with a message that the Android SDK is missing. |
Let me run it again to be able to share the exact error message, I don't have the console where I've tried that last time open anymore. |
It won't bring down the android SDK. Do you have VS installed? That might be easier as you will need the Android SDK, OpenJDK and whatever else comes with VS. |
I don't have VS installed, as I don't have access to the GUI, only the command line. Or actually, I could wire it up, but it would be a bit of a hassle, so I was hoping I could avoid it. The error I am getting is that the step 5 is failing with: Before this error, I can also see the following warning: |
My bad. I thought it did. @janvorli this should help https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/libraries/testing-android.md#using-a-terminal |
Yeah, those errors are saying you don't have the Android SDK and Java SDK installed. |
One thing you can do is try building without Android, but maybe might hide the issue. In the root of the repo, there is a file: Rename that to https://gist.github.com/mattleibow/d03066db457a7b0ec8d11354fceac43d If that works, then it may be the Android projects or something. In that case you may have to download and extract the Android SDK from Google. @jonathanpeppers maybe there is a way to do this better? You have a script to get the Android pre-requisites? Also, this is probably going to have issues if you do not have Xcode installed as we need that to build iOS and Mac... |
Thanks for the pointers, I'll give it a try. |
@mattleibow if I disable the Android and Tizen as you have suggested, then step 5 passes, but step 6 fails with errors like Anyways, it seems that it is not worth the hassle trying to patch stuff and wasting your time, I'll bring my mac mini to my office tomorrow so that I can connect it to the monitor and install the VS. |
In the end, I was able to install the JDK using some instructions I've found online and Android SDK from the command line using modified instructions that @steveisok shared (I needed to modify the version to 33). The step 5 passed ok without any exclusions then. But the step 6 failed due to an outdated xcode installed on my mac. I wanted to update it, but it needs to get the OS updated first. But for some reason, the "Software update" dialog has been sitting for almost a day in "Checking for updates" phase. I have been trying various ways to fix that, but so far without success. I wonder though - does the issue repro on macOS arm64 too? Besides the mac mini I am trying this on, I also have M1 mini, so if arm64 had the same behavior, I could debug it there. That device is much more up to date. |
I was going to give it a try on my arm64 mac which is more up to date, but I've found that the |
Should be back. Just restored the branch |
@mattleibow thank you! |
@janvorli any updates on this one? |
@Redth I have resolved the issues with my x64 mac and managed to install the JDK and Android SDK there. Unfortunately, I was unable to make the step 5 of the build work yet (the iOS parts are failing). With the help of @mattleibow and other folks, I have found that I have some strange kind of Apple Developer Account (Organization) that doesn't let me create / get the provisioning profiles. The tabs / menus to do that are simply missing in my view of the App Store Connect web. I have contacted the account holder to help me figure out how to fix that, but he didn't get back to me yet. |
Any updates? Looks like net8 builds are fine, so looks to just be an issue with net7 things. |
I am still in the same state w.r.t. my Apple account. I have asked someone from our team yesterday to help investigate the issue using his Apple account that doesn't have the issues I do. I hope to get some news from him today. |
With @mattleibow's help, I was finally able to successfully run all the steps and repro the issue. And after some struggling, with instrumented libcoreclr.dylib, I was able to attach lldb to it at the time of crash. But the crash is really weird. The crashing thread sits at the first instruction of the Btw, here is the call stack at the time of the crash:
|
@mattleibow can you add a new MSBuild property to make this code path use a plain My memory is that MSBuild can sometimes get a different path for You might also want to pass in the same parallelization options we're using here (but this might not related to this bug): It looks like the existing code doesn't handle cancellation or limit the concurrency. |
I added some properties to control parallelization in the task: dotnet/maui#12954 Maybe the dotnet build ran out of CPU or something changed between our RTM and GA... |
I updated the PR and also added things to remove all the paralellism, and it still fails. I got this PR that is now using 102: dotnet/maui#12954 Still the same thing. Also interesting that this was working before GA and is still working on net8. So something happened the week of the GA build that broke it but is either not in net8 or different in net8. |
Managed to get numbers of SDK here, but
|
I have extracted the runtime commits for the above mentioned SDKs and ran a git bisect to try to find out the one causing the trouble. I have first used the older version of the SDK that is marked as green as a basis, implanting in the files from the build of runtime from each commit the bisect picked. To my surprise, the issue didn't repro with any of those. |
@janvorli @mattleibow I have some experience with coding and macOS, let me know how to get the binaries and I can quickly verify the possible signing issue and the exact entitlement that is missing. |
There are the few steps in the description with how to get a build. It uses a local copy of dotnet so does not affect things. |
@jonathanpeppers had a look at all this and discovered that adding the This should now be reproducible on main. |
Describe the bug
We were using 7.0.100-rtm.22519.39 to build maui, but when we updated to 7.0.101-servicing.22571.1 the mac builds crashed.
To Reproduce
dotnet build
crash on macos maui#12152dotnet tool restore
dotnet cake --target=dotnet
bin/dotnet/dotnet build Microsoft.Maui.BuildTasks.slnf /target:Build /property:configuration=Debug /maxcpucount:1 /binarylogger:Microsoft.Maui.BuildTasks-mac-Debug-Build-dotnet.binlog
bin/dotnet/dotnet build Microsoft.Maui-mac.slnf /target:Build /property:configuration=Debug /maxcpucount:1 /binarylogger:Microsoft.Maui-mac-Debug-Build-dotnet.binlog
I have also branches and devops builds:
dotnet build
crash on macos maui#12152Exceptions (if any)
Further technical details
The text was updated successfully, but these errors were encountered: