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
Installer test infrastructure around the install_location config file on macOS crashes test process with RC2 SDK #61131
area-Hostdisabled-testThe test is disabled in source code against the issuein-prThere is an active PR which will close this issue when it is mergedos-macosmacOS aka OSX
The installer test infrastructure creates a dummy install_location config file for some of the nethost testing. When using the RC2 SDK, the test process crashes while running the tests that use this infrastructure.
This is some System Integrity Protection sadness. I don't actually understand macOS / SIP to know exactly what is going on, why it would have started happening when the repo switched to 6.0 RC2, or how to address I - but here is what I see:
I didn't manage to get a core dump (maybe I need to do something extra beyond unlimited ulimit and having access to /cores, since SIP is enabled?), but based on some printf-ing, we are crashing in this call:
Only happens when a process that uses the binary that gets edited is previously launched. This is probably why we have a bunch of other tests that use TestOnlyProductBehavior/RegisteredInstallLocationOverride without issue. For example:
[Fact]publicvoidDummyTest(){// TestOnlyProductBehavior.Enable succeeds if we don't launch the nativehost process (which uses nethost)Console.WriteLine("Launching process");Command.Create(sharedState.NativeHostPath,GetHostFxrPath).Execute();Console.WriteLine("Enabling test behaviour");using(vartest=TestOnlyProductBehavior.Enable(sharedState.NethostPath)){Console.WriteLine("Enabled test behaviour");}}
I don't know the details either, but I do remember a discussion somewhere and the problem was that macOS cached some security related information about a file. This sounds similar.
What we could do is to change the infra in such a way that we always create a new copy of the runtime directories before we apply test-only behavior - this would guarantee that the executable is not used before it's modified as test-only.
Alternatively: We make copies of all the runtime files for each test class anyway (no test should use the original runtime files directly), we could stamp the produce as test-only as part of this copy and simply run everything in the test-only mode. It should not have any impact on the validity of test results.
area-Hostdisabled-testThe test is disabled in source code against the issuein-prThere is an active PR which will close this issue when it is mergedos-macosmacOS aka OSX
Activity
elinor-fung commentedon Jun 10, 2022
This is some System Integrity Protection sadness. I don't actually understand macOS / SIP to know exactly what is going on, why it would have started happening when the repo switched to 6.0 RC2, or how to address I - but here is what I see:
Crash report:
I didn't manage to get a core dump (maybe I need to do something extra beyond unlimited
ulimitand having access to/cores, since SIP is enabled?), but based on some printf-ing, we are crashing in this call:runtime/src/installer/managed/Microsoft.NET.HostModel/AppHost/BinaryUtils.cs
Line 31 in 08692dc
Only happens when modifying Release host bits. We explicitly run
codesignin that case. If I remove thecodesigncall, the crash stops happening.runtime/eng/native/functions.cmake
Line 398 in 933dbb1
Only happens when a process that uses the binary that gets edited is previously launched. This is probably why we have a bunch of other tests that use
TestOnlyProductBehavior/RegisteredInstallLocationOverridewithout issue. For example:vitek-karas commentedon Jun 13, 2022
I don't know the details either, but I do remember a discussion somewhere and the problem was that macOS cached some security related information about a file. This sounds similar.
What we could do is to change the infra in such a way that we always create a new copy of the runtime directories before we apply test-only behavior - this would guarantee that the executable is not used before it's modified as test-only.
Alternatively: We make copies of all the runtime files for each test class anyway (no test should use the original runtime files directly), we could stamp the produce as test-only as part of this copy and simply run everything in the test-only mode. It should not have any impact on the validity of test results.