runtime: FreeBSD tests crash with HRESULT: 0x8007FF02 from #106724
Description
From #106724 forward tests on FreeBSD now all creash with HRESULT: 0x8007FF02
These do not show up in /var/log/messages on either the jail or the host. dmesg also free of errors from this. Nothing SIGXXXX.
Builds otherwise complete without issue.
Reproduction Steps
As initially discovered:
./build.sh -ci -c Release -subset Clr+Mono+Host.Native+Host.Tools+Host.Pkg+Libs+Libs.Tests+Packs --test
Double checked with (requires https://github.com/dotnet/runtime/pull/106302):
src/tests/build.sh Release /p:LibrariesConfiguration=Release -rebuild -runtests
Expected behavior
Tests to run either pass/fail
Actual behavior
“exit code 137 means SIGKILL Killed either due to out of memory/resources (see /var/log/messages) or by explicit kill.”
or
“Failed to create CoreCLR, HRESULT: 0x8007FF02”
Regression?
Yes
Known Workarounds
None?
Configuration
FreeBSD-x64 both 13.3 and 14.1 System has about ~200G of free RAM during this. Jails run without resource quotas.
Other information
Public log for both FreeBSD 13.3 and 14.1: https://dev.azure.com/IFailAt/freebsd-dotnet-runtime-nightly/_build/results?buildId=1625&view=results BinLog are published to artifacts
commit listed is 6df7807617cff3e4b4eba7bb33c8ad00c2b1cf1c (after PR listed)
git bisect log
git bisect start
# status: waiting for both good and bad commits
# good: [21fe57174af159f7bcb39f591cd9fbb96a36bfcb] COMObject invoke through reflection (#106677)
git bisect good 21fe57174af159f7bcb39f591cd9fbb96a36bfcb
# status: waiting for bad commit, 1 good commit known
# bad: [6df7807617cff3e4b4eba7bb33c8ad00c2b1cf1c] Add missing .alt_entry to CoreCLR *_FakeProlog methods (#106744)
git bisect bad 6df7807617cff3e4b4eba7bb33c8ad00c2b1cf1c
# good: [a3cbf8c2534040faa4664e45c19a0ba877bb5c5c] Grab back some performance in `RuntimeTypeHandle::GetElementType` (#106730)
git bisect good a3cbf8c2534040faa4664e45c19a0ba877bb5c5c
# good: [4e8892ea65fe85593b1853907d965fb49d324ce9] JIT: Add Non-Faulting behaviour for Sve.LoadVector*NonFaulting*() (#106648)
git bisect good 4e8892ea65fe85593b1853907d965fb49d324ce9
# good: [cfa0cc5b0282c29597f10b6c2fdceab159e0be81] Inject IJW Copy Constructor calls in the JIT instead of in the IL stubs (#106424)
git bisect good cfa0cc5b0282c29597f10b6c2fdceab159e0be81
# good: [cfa8da560f674d035a26e9b3b07067933d46e44c] Avoid signed overflow in DBG_FlushInstructionCache (#105918)
git bisect good cfa8da560f674d035a26e9b3b07067933d46e44c
# bad: [92e41b6b2cf7aea845fcfc9a439dc4e191c07428] Add callback-based Encode to AsnWriter
git bisect bad 92e41b6b2cf7aea845fcfc9a439dc4e191c07428
# bad: [27ee590d1f96dc590f8ad85e76b7b8a6ad000b2d] pal init: InitializeFlushProcessWriteBuffers() before first thread to improve start time (#106724)
git bisect bad 27ee590d1f96dc590f8ad85e76b7b8a6ad000b2d
# first bad commit: [27ee590d1f96dc590f8ad85e76b7b8a6ad000b2d] pal init: InitializeFlushProcessWriteBuffers() before first thread to improve start time (#106724)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (12 by maintainers)
Commits related to this issue
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPageSize() is c... — committed to harisokanovic/dotnet_runtime by deleted user 2 years ago
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPageSize() is c... — committed to harisokanovic/dotnet_runtime by deleted user 2 years ago
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() (#107100) A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPage... — committed to dotnet/runtime by harisokanovic 2 years ago
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPageSize() is c... — committed to dotnet/runtime by deleted user 2 years ago
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() (#107114) A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPage... — committed to dotnet/runtime by github-actions[bot] 2 years ago
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() (#107100) A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPage... — committed to jtschuster/runtime by harisokanovic 2 years ago
- pal init: Move InitializeFlushProcessWriteBuffers() after VIRTUALInitialize() (#107100) A fixup of commit 27ee590d that's broken on platforms which don't support membarrier() syscall: GetVirtualPage... — committed to mikelle-rogers/runtime by harisokanovic 2 years ago
@jkotas Looks good on my end!
I don’t have an ARM64 hardware setup to test on but @sec might have some insight on FreeBSD-ARM64 with .NET.
Under FreeBSD-x64, I have not noticed any consistent errors*
Not sure what to do about the
MEMBARRIER_CMD_QUERYissue either. There is no manpage for eithermembarrier(2)orrseq(2)on FreeBSD and source/differential might be a pain to dig through. If reliability is a concern then it sounds like disabling the fallback path might be for the best.*I have noticed an inconsistent error when restore is run during the initial build of runtime. I will open an issue about this when I can better reproduce it.
It is going to be the call here:
https://github.com/dotnet/runtime/blob/8d24ba37861831302a2ddf994d64626ce7e2b58a/src/coreclr/pal/src/thread/process.cpp#L2597
The problem is that value returned by
GetVirtualPageSizeis not initialized yet now that this method is called earlier. We need to initialize it earlier.A related problem is why
MEMBARRIER_CMD_QUERYdoes not kick on FreeBSD. I believe thatMEMBARRIERsyscall should be implemented on FreeBSD: https://www.freebsd.org/status/report-2021-10-2021-12/membarrier-rseq/, but it is not working for some reason. We end up using the fallback path that has a bug.These are unrelated.