You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NativeAOT] App Store Connect warning ITMS-90999: Invalid executable #94655
I read about the NativeAOT experimental feature here and wanted to give it a try right away.
The app can be downloaded via TestFlight and is significantly smaller than before (with the Mono AOT) - awesome! I also don't see any functional issues
Steps to Reproduce
Add <PublishAot>true</PublishAot> to .csproj
dotnet publish
Upload resulting .ipa to App Store Connect
Expected Behavior
No warning/error
Actual Behavior
Email from Apple:
We identified one or more issues with a recent delivery for your app, "MyApp" 1.0.0 (1.0.0). Your delivery was successful, but you may wish to correct the following issues in your next delivery:
ITMS-90999: Invalid executable - The executable in “MyApp.iOS.app” contains multiple segments with the executable permission bit set when it should only contain one.
After you’ve corrected the issues, you can upload a new binary to App Store Connect.
From @filipnavara on Mon, 06 Nov 2023 12:20:13 GMT
@filipnavara any reason we can't put the __thunks section in the __TEXT segment?
The reason is that the __THUNKS (TEXT) and __THUNKS_DATA (DATA) have to be next to each other. The sections are mapped multiple times to support marshalled delegates. The executable code references the data by relative offset and the data part is modified at runtime.
Fixed number of the marshalled delegates fits into the pre-generated code/data table, and then it gets mapped again at a different memory location. The second mapping needs to a) use the same relative offsets between the code and the data, b) still needs the code part to have valid code signature.
If Apple started blocking that we have a problem. I don't know on any method to ensure an executable layout that would allow the remapping.
From @filipnavara on Sun, 12 Nov 2023 16:25:01 GMT
The vm_remap trick in Mono is actually quite cool. I think it can be improved with the VM_FLAGS_OVERWRITE flag to avoid the retry loop and it may be quite reliable way to map the trampoline pages without having them as consecutive blocks in the executable file.
changed the title [-][NativeAOT] App Store Connect error ITMS-90999: Invalid executable [/-][+][NativeAOT] App Store Connect warning ITMS-90999: Invalid executable [/+]on Nov 13, 2023
Activity
rolfbjarne commentedon Nov 13, 2023
From @rolfbjarne on Mon, 06 Nov 2023 09:46:15 GMT
I've never seen that ITMS message before, and according to Google not many other people has either (https://developer.apple.com/forums/thread/740085 is the only other hit).
Would you be able to attach/provide the .ipa you uploaded?
rolfbjarne commentedon Nov 13, 2023
From @tipa on Mon, 06 Nov 2023 10:41:02 GMT
I sent you the .ipa file in a private message. Has Store submission of a NativeAot .ipa been tested by Microsoft?
rolfbjarne commentedon Nov 13, 2023
From @rolfbjarne on Mon, 06 Nov 2023 10:50:23 GMT
Thanks!
Yes, but we might have missed warnings.
rolfbjarne commentedon Nov 13, 2023
From @rolfbjarne on Mon, 06 Nov 2023 10:55:12 GMT
I wonder if this is the reason:
This is an executable segment, but the
__TEXTsegment is also executable.@filipnavara any reason we can't put the
__thunkssection in the__TEXTsegment?rolfbjarne commentedon Nov 13, 2023
From @filipnavara on Mon, 06 Nov 2023 12:20:13 GMT
The reason is that the
__THUNKS(TEXT) and__THUNKS_DATA(DATA) have to be next to each other. The sections are mapped multiple times to support marshalled delegates. The executable code references the data by relative offset and the data part is modified at runtime.Fixed number of the marshalled delegates fits into the pre-generated code/data table, and then it gets mapped again at a different memory location. The second mapping needs to a) use the same relative offsets between the code and the data, b) still needs the code part to have valid code signature.
If Apple started blocking that we have a problem. I don't know on any method to ensure an executable layout that would allow the remapping.
rolfbjarne commentedon Nov 13, 2023
From @rolfbjarne on Mon, 06 Nov 2023 12:25:15 GMT
Isn't this what Mono has been doing for years (with no app store warnings)?
rolfbjarne commentedon Nov 13, 2023
From @filipnavara on Mon, 06 Nov 2023 12:35:05 GMT
I frankly have no idea. I think Mono may have some fixed limit... @lambdageek, any pointers how marshalled delegates are implemented on Mono/iOS?
rolfbjarne commentedon Nov 13, 2023
From @rolfbjarne on Mon, 06 Nov 2023 14:49:14 GMT
This looks related:
runtime/src/mono/mono/mini/aot-compiler.c
Lines 2065 to 2081 in 6066de1
runtime/src/mono/mono/mini/aot-runtime.c
Lines 5743 to 5764 in 6066de1
rolfbjarne commentedon Nov 13, 2023
From @charlesroddie on Thu, 09 Nov 2023 18:41:11 GMT
Also got this on uploading to testflight. Something new between dotnet8-rc1 and latest dotnet8.
rolfbjarne commentedon Nov 13, 2023
From @filipnavara on Sun, 12 Nov 2023 16:25:01 GMT
The
vm_remaptrick in Mono is actually quite cool. I think it can be improved with theVM_FLAGS_OVERWRITEflag to avoid the retry loop and it may be quite reliable way to map the trampoline pages without having them as consecutive blocks in the executable file./cc @ivanpovazan
[-][NativeAOT] App Store Connect error ITMS-90999: Invalid executable [/-][+][NativeAOT] App Store Connect warning ITMS-90999: Invalid executable [/+]jkotas commentedon Nov 13, 2023
Related to #82317 . cc @filipnavara
filipnavara commentedon Nov 13, 2023
We already discussed how to fix it. Ivan or I will probably take a stab at it.
neon-sunset commentedon Nov 13, 2023
Is there a chance if a fix becomes available, it gets backported to 8.0.xxx?
ivanpovazan commentedon Nov 22, 2023
We will consider it once we have the fix in place and will update the issue accordingly. Thank you for understanding.