Re-enable FEATURE_CORPROFILER for tvOS to match iOS/MacCatalyst#126715
Re-enable FEATURE_CORPROFILER for tvOS to match iOS/MacCatalyst#126715jkotas merged 1 commit intodotnet:mainfrom
Conversation
PR dotnet#126550 disabled FEATURE_CORPROFILER for tvOS but left iOS, MacCatalyst, and Android commented out (profiler still enabled). There is no reason to single out tvOS from its sibling Apple mobile platforms. They should be treated as a package deal. The uncommented 'AND NOT CLR_CMAKE_TARGET_TVOS' line removed profiler fields from the Thread struct on tvOS, making the hardcoded OFFSETOF__Thread__m_pInterpThreadContext in asmconstants.h wrong (0x2b8 vs actual 0x228), breaking all 3 tvOS legs in unified-build. Comment out the tvOS line to match iOS/MacCatalyst/Android, keeping the profiler enabled until all mobile platforms disable it together. Fixes internal unified-build tvOS failures on main (build 2946990). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR re-enables FEATURE_CORPROFILER for tvOS to keep feature-flag behavior consistent across Apple mobile platforms and to restore the expected Thread layout used by asmconstants.h static offset assertions.
Changes:
- Comment out the tvOS-specific
AND NOT CLR_CMAKE_TARGET_TVOSexclusion so tvOS matches the (currently enabled) iOS/MacCatalyst/Android behavior. - Adjust the CMake conditional formatting to accommodate the commented-out tvOS clause cleanly.
I had considered them distinct and I'd argue they should be since they are specifically different "targets". I removed tvOS because it isn't a mobile target. The real issue here is the defines aren't correct and likely missing places where tvOS should keep something alive but is relying on an iOS define. Given the general mess of how we define these I'm fine adding it back, but it does indicate there are missing defines somewhere. |
We've historically called it "mobile" as well since it's very similar to iOS. |
That is absolutely fine and I think including tvOS here makes sense. But the point is tvOS is clearly not a correctly defined target because it relies on something the iOS target is including. In fact, I'd almost prefer to have something that fails if someone defined tvOS and not iOS. tvOS needs something more and therefore should be explicitly coupled to iOS so this doesn't happen again. |
You've got a legit point. This has some history as mono used unix signals and tvOS's signal handlers don't give access to ucontext_t. Seeing that coreclr uses mach exceptions + interpreter ios & tvos are basically the same. |
|
there are more differences, e.g. tvOS can't use fork() etc, so it makes sense to have it as a separate target (albeit very similar to iOS). I was just trying to point out why we generally lumped them into the "mobile" category, compared to desktop. |
|
/ba-g infrastructure crash with no log (Agent failed with exception: Task agent exited with exit code -1073741502) |
fork() isn't enabled on any of them. There does not appear to be any real difference in the coreclr part of the build. |
Summary
PR #126550 disabled
FEATURE_CORPROFILERfor tvOS (AND NOT CLR_CMAKE_TARGET_TVOSuncommented) but left iOS, MacCatalyst, and Android commented out (profiler still enabled). There's no reason to single out tvOS from its sibling Apple mobile platforms — they should be treated as a package deal.Problem
The uncommented
AND NOT CLR_CMAKE_TARGET_TVOSline removed profiler fields from theThreadstruct on tvOS (m_pProfilerFilterContext,m_profilerCallbackState,m_dwProfilerEvacuationCounters— 144 bytes total), making the hardcodedOFFSETOF__Thread__m_pInterpThreadContextinasmconstants.hwrong (0x2b8 vs actual 0x228), breaking all 3 tvOS legs in unified-build.Fix
Comment out the tvOS line to match iOS/MacCatalyst/Android, keeping the profiler enabled on tvOS until all mobile platforms are ready to disable it together. This restores the original
Threadstruct layout and makesasmconstants.hcorrect again without needing offset changes.Build failure
Internal unified-build on
main(build 2946990) fails on 3/54 tvOS legs:Affected legs: tvOS_Shortstack_arm64, tvOSSimulator_Shortstack_x64, tvOSSimulator_Shortstack_arm64.
cc @AaronRobinsonMSFT @akoeplinger