[Apple][Android][CoreCLR] Don't pass the program path as managed args[0]; quarantine newly running runtime tests - #134767
Conversation
NSProcessInfo.arguments includes the executable path as element 0, and the CoreCLR Apple host passed the whole array to coreclr_execute_assembly, whose argv becomes Main's args. The merged runtime-test runner treats args[0] as the test to run, so every runtime test on iOS, tvOS and maccatalyst was reported as skipped. Fixes #134766 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
discovered this while wondering why the tests from #134765 weren't also red on apple mobile previously |
|
Tagging subscribers to 'os-maccatalyst': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
|
Tagging subscribers to 'os-tvos': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
monodroid-coreclr.c prepended the bundle path to the arguments it passed to coreclr_execute_assembly, whose argv becomes Main's args. The merged runtime-test runner treats args[0] as the test to run, so every Android CoreCLR runtime test was reported as skipped. The Mono host keeps argv[0] because mono_jit_exec expects the program name there. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The test hangs on maccatalyst CoreCLR: a GC suspension never completes because the runtime can't suspend a tight R2R loop, which also blocks the test's own timeout timer. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
Same GC suspension hang as b425314: a flip thread in a tight R2R loop can't be suspended. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
F# tests load FSharp.Core from CORE_ROOT on other platforms, but Apple and Android merged runners bundle only their own publish output, so F# tests failed with FileNotFoundException. Resolve FSharp.Core from the test_dependencies_fs restore (the same source CORE_ROOT uses; CORE_ROOT itself is laid out after the managed test build) and add it to runners that reference an .fsproj. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
With FSharp.Core bundled, the test now runs and hits a fatal stack overflow: tail calls between R2R and interpreted code grow the stack. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The tests expect the JIT to reject invalid IL. Without a JIT (Apple mobile), crossgen2 skips the method and the interpreter runs it without an exception. The existing InterpreterActive skip only covers DOTNET_Interpreter/InterpMode and wasm; gate on Utilities.IsCoreClrInterpreter, which also covers the no-JIT case. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Should we fix that? (Alternatively, deprecate this flag and use IsCoreClrInterpreter / IsNotCoreClrInterpreter instead.) |
The test loads its own assembly from Assembly.Location, which is empty for assemblies bundled in an Android app. It is already skipped on the other bundled platforms (Browser, Wasi, iOS, tvOS, MacCatalyst) for the same reason. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
InterpreterActive was true for every wasm run, including ReadyToRun, and never true on Apple mobile, which has no JIT. Define it as DOTNET_Interpreter/InterpMode, or no JIT without ReadyToRun, and set TEST_READY_TO_RUN_MODE=1 in Apple mobile runtime-test apps when they are ReadyToRun-compiled so the runtime can tell. Tests this now runs on wasm ReadyToRun: GetGeneration fails there (#134803, quarantined), and ManagedPointers.Validate_GeneratedILStubs_NullByRef hits the interpreter even with ReadyToRun, so it now requires a JIT via Utilities.IsNotCoreClrInterpreter. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Yeah it should be fixed. Fixing it properly will change the subsets that are running on wasm so it expands the scope of testing required for this pr to wasm as well but I don't expect much in the way of actual problems. |
The test loads its own assembly from Assembly.Location, so require Utilities.HasAssemblyFiles rather than listing every configuration that bundles assemblies. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…reterMode Its meaning (an interpreter test mode) now differs from Utilities.IsCoreClrInterpreter and the library-test PlatformDetection.IsCoreClrInterpreter (no JIT, so some code may be interpreted). Give it a distinct name and document both. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Done in c4e410a and c210851. The The mode's predicate is renamed to On wasm R2R this started running two tests:
Note This comment was generated with GitHub Copilot. |
The property's meaning is unchanged; only its call to the renamed CoreClrConfigurationDetection.IsInterpreterMode differs from main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…st apps Mirror tests.browser.targets so both library and runtime-test Apple apps report PlatformDetection.IsReadyToRunCompiled. AssemblyTests.GetEntryAssembly now reached its desktop single-file R2R branch on Apple, so exclude Apple mobile from it; it keeps expecting AppleTestRunner. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… instead Revert the InterpreterActive redefinition and the IsInterpreterMode rename. CoreClrConfigurationDetection.IsCoreClrInterpreter keeps meaning 'some code may be interpreted'; its WebAssembly special case becomes a general no-JIT check, which also covers Apple mobile. HndIndex and ManagedPointers go back to their existing InterpreterActive skips. GetGeneration only needs its own code to be compiled, so it gets a local condition (not interpreted, or ReadyToRun) and a permanent WebAssembly skip because stack roots there are reported as pinned (#134803). It keeps running on Apple mobile ReadyToRun. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
LGTM |
The CoreCLR Apple host (
runtime-coreclr.m) built managed arguments fromNSProcessInfo.arguments, whose element 0 is the executable path. It passed the whole array tocoreclr_execute_assembly, whoseargvbecomesMain'sargs. corerun and the dotnet host pass only the arguments after the program name, and the Mono Apple host is unaffected becausemono_jit_exectreatsargv[0]as the program name.The merged runtime-test runner passes
args[0]toAppleEntryPointas the single method to run. So on every CoreCLR Apple runtime-test lane (iOS, iOS simulator, tvOS, maccatalyst), all tests were filtered out and reported as skipped with "No Known Skip Reason", while xharness reported success. See #134766.This change passes
argi - 1, managed_argv + 1in the Apple host. The Android CoreCLR host (monodroid-coreclr.c) had the same bug: it prepended the bundle path tomanaged_argv. The fix drops it. The Mono hosts are unchanged, becausemono_jit_execexpects the program name inargv[0].Bundling FSharp.Core in mobile test apps
F# tests load FSharp.Core from
CORE_ROOTeverywhere else, including wasm, which runs throughcorerun. Apple and Android merged runners bundle only their own publish output, so F# tests failed withFileNotFoundException. Merged runners that reference an.fsprojnow resolve FSharp.Core from thetest_dependencies_fsrestore and bundle it. That's the same sourceCORE_ROOTuses, andCORE_ROOTitself isn't laid out until after the managed test build.Interpreter and ReadyToRun detection on Apple
CoreClrConfigurationDetection.IsCoreClrInterpreter(behindRuntimeTestModes.InterpreterActive) keeps meaning "some code may be interpreted". Its WebAssembly special case becomes a general no-JIT check. The result on wasm is unchanged, and it now also covers Apple mobile, which has no JIT.TEST_READY_TO_RUN_MODE=1intests.ioslike.targets, mirroringtests.browser.targets.PlatformDetection.IsReadyToRunCompiledis therefore true there.AssemblyTests.GetEntryAssembly's single-file R2R branch now excludes Apple mobile, so it keeps expectingAppleTestRunner.Validation (local, CoreCLR)
Both full Pri0 suites were run locally, all 82 work items each: maccatalyst-arm64 Release, and android-arm64 Release on the emulator.
Runtime_90219, now skipped), 372 skipped in the 77-group run; the other 5 groups pass as well. No hangsSelected work items:
JIT/Regression_o_3(maccatalyst)JIT/Regression_2(maccatalyst)Runtime_87393passes with FSharp.Core bundled)GC(maccatalyst R2R)GetGenerationSystem.Reflection.Tests(library, maccatalyst R2R)System.Buffers.Tests(library runner, maccatalyst)JIT/JIT_rJIT/Regression_2JIT/Directed/Directed_domutual_recursion)JIT/Regression/Regression_5Test_HndIndex_10_*pass (JIT present)JIT/Regression_o_3Newly running tests: quarantines and skips
These lanes had not run any runtime tests, so turning them on surfaces failures. Quarantines are scoped to CoreCLR on Apple mobile (
IsAppleMobileANDIsCoreCLR) unless noted:b425314(Regression_d),b426654(Regression_1)ActiveIssue#134770JIT/Directed/tailcall/mutual_recursion(Directed_do)ActiveIssue#134775Test_HndIndex_10_Plain,Test_HndIndex_10_Reordered(Regression_5)SkipOnCoreClr(InterpreterActive)now applies on AppleGC/API/GC/GetGeneration(GC)Runtime_90219(Regression_o_3)Assembly.Location, which is empty in an app bundleConditionalFact(Utilities.HasAssemblyFiles)replaces the platform listCI should catch device-only failures (iOS, tvOS).
Resolves #134766
Note
This PR description was generated with GitHub Copilot.