-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[local gc] disable feature redhawk #17769
Conversation
|
Opened #17770 for numanodeinfo |
|
Opened #17771 for AnalyzeSurvivorsRequested and DACNotifyGcMarkEnd |
src/gc/env/gcenv.safeint.h
Outdated
| @@ -0,0 +1,810 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is overkill to include copy of this whole file for a single overflow check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the overflow check that this is for is pretty useless. You can just replace it by assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas We also use S_SIZE_T for init() (see gc.cpp:5059), although looking at the code I don't think it is currently protecting anything. It is written as S_SIZE_T safe_sniff_buf_size = S_SIZE_T(1 + n_heaps*n_sniff_buffers + 1);, which seems like any overflow would happen in the calculation before it is passed to the S_SIZE_T constructor.
I'm fine with getting rid of the file, I agree it's pretty heavyweight for how it's used. I was just being cautious because it's tricky to write overflow code so the compiler doesn't defeat it
| break; | ||
|
|
||
| #if defined(FEATURE_COMINTEROP) && !defined(FEATURE_REDHAWK) | ||
| #if defined(FEATURE_COMINTEROP) && !defined(FEATURE_REDHAWK) && !defined(BUILD_AS_STANDALONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COM interop is broken with standalone GC. Do you have a follow up bug to fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have pretty light test coverage for COM interop in the open sourced tests today, so you might not have noticed the breakage if you have just run CoreCLR open sourced tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only run the open source tests, and they all pass under local gc. But they also passed when it was compiled with FEATURE_REDHAWK so they don't test the corner cases of the gc.
src/gc/handletable.cpp
Outdated
| CONTRACTL_END; | ||
|
|
||
| #if defined( _DEBUG) && !defined(FEATURE_REDHAWK) | ||
| #if defined( _DEBUG) && !defined(FEATURE_REDHAWK) && !defined(BUILD_AS_STANDALONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to delete the inject faults from here, and move them to the EE side instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does anyone actually use this? I have not seen it myself
In reply to: 184080041 [](ancestors = 184080041)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been used for SQL testing 10+ years ago. It is not actively used for anything. I guess we can just delete it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I vote for deleting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it's deleted now
| #endif //TRACE_GC | ||
|
|
||
| #ifndef FEATURE_REDHAWK | ||
| #if !defined(FEATURE_REDHAWK) && !defined(BUILD_AS_STANDALONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to move this to somewhere in vm\gcenv.*.
| BOOL AnalyzeSurvivorsRequested(int condemnedGeneration) | ||
| { | ||
| #ifndef BUILD_AS_STANDALONE | ||
| // Is the list active? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the end-user visible debugger feature that is not going to work with standalone GC because of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just some events are written to debugger on a gc, the only thing I could find that uses it is
coreclr/src/ToolBox/SOS/Strike/strike.cpp
Lines 6880 to 6904 in 54bdc16
| STDMETHODIMP OnGcEvent(GcEvtArgs gcEvtArgs) | |
| { | |
| // by default don't stop on these notifications... | |
| m_dbgStatus = DEBUG_STATUS_GO_HANDLED; | |
| IXCLRDataProcess2* idp2 = NULL; | |
| if (SUCCEEDED(g_clrData->QueryInterface(IID_IXCLRDataProcess2, (void**) &idp2))) | |
| { | |
| if (gcEvtArgs.typ == GC_MARK_END) | |
| { | |
| // erase notification request | |
| GcEvtArgs gea = { GC_MARK_END, { 0 } }; | |
| idp2->SetGcNotification(gea); | |
| s_condemnedGen = bitidx(gcEvtArgs.condemnedGeneration); | |
| ExtOut("CLR notification: GC - Performing a gen %d collection. Determined surviving objects...\n", s_condemnedGen); | |
| // GC_MARK_END notification means: give the user a chance to examine the debuggee | |
| m_dbgStatus = DEBUG_STATUS_BREAK; | |
| } | |
| } | |
| return S_OK; | |
| } |
@noahfalk please correct me if I missed something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That OnGcEvent method is part of the implementation for !FindRoot
https://github.com/dotnet/coreclr/blob/master/src/ToolBox/SOS/Strike/sosdocs.txt#L1918
Without this event !FindRoot -gen won't ever break back into the debugger.
| // Let's create a new node | ||
| NewHolder<HandleTableMap> newMap; | ||
| newMap = new (nothrow) HandleTableMap; | ||
| HandleTableMap *newMap = new (nothrow) HandleTableMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you removed the holder? It is a pattern that we prefer to use wherever we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GC is not using holders anywhere else. I do not think it is worth pulling in the whole holder machinery into local GC just for the one use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. I have thought we already had it in.
|
@jkotas @Maoni0 Can you take a look? These were the outstanding issues:
Let me know if you have anything else you're concerned about. |
| bool virtual_alloc_commit_for_heap(void* addr, size_t size, int h_number) | ||
| { | ||
| #if defined(MULTIPLE_HEAPS) && !defined(FEATURE_REDHAWK) && !defined(FEATURE_PAL) | ||
| #if defined(MULTIPLE_HEAPS) && !defined(FEATURE_REDHAWK) && !defined(FEATURE_PAL) && !defined(BUILD_AS_STANDALONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to work for standalone GC though... numa is pretty common these days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #19417 to track it
Maoni0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
@dotnet-bot test Windows_NT x64 Release CoreFX Tests |
|
@dotnet-bot test Windows_NT x64 Checked CoreFX Tests |
The function was incorrectly rounding the dwCommit down instead of up to OS_PAGE_SIZE. It accidentally works for OSes where page size is 4096 bytes, because the dwCommit is 4096. But for ARM64 Linux distros where the page size is 64kB, this was committing zero bytes and so the runtime initialization was crashing a bit later when it tried to access the memory it was supposed to be commited. This problem was introduced in dotnet#17769.
The function was incorrectly rounding the dwCommit down instead of up to OS_PAGE_SIZE. It accidentally works for OSes where page size is 4096 bytes, because the dwCommit is 4096. But for ARM64 Linux distros where the page size is 64kB, this was committing zero bytes and so the runtime initialization was crashing a bit later when it tried to access the memory it was supposed to be commited. This problem was introduced in dotnet#17769.
The function was incorrectly rounding the dwCommit down instead of up to OS_PAGE_SIZE. It accidentally works for OSes where page size is 4096 bytes, because the dwCommit is 4096. But for ARM64 Linux distros where the page size is 64kB, this was committing zero bytes and so the runtime initialization was crashing a bit later when it tried to access the memory it was supposed to be commited. This problem was introduced in dotnet#17769.
The function was incorrectly rounding the dwCommit down instead of up to OS_PAGE_SIZE. It accidentally works for OSes where page size is 4096 bytes, because the dwCommit is 4096. But for ARM64 Linux distros where the page size is 64kB, this was committing zero bytes and so the runtime initialization was crashing a bit later when it tried to access the memory it was supposed to be commited. This problem was introduced in #17769.
The function was incorrectly rounding the dwCommit down instead of up to OS_PAGE_SIZE. It accidentally works for OSes where page size is 4096 bytes, because the dwCommit is 4096. But for ARM64 Linux distros where the page size is 64kB, this was committing zero bytes and so the runtime initialization was crashing a bit later when it tried to access the memory it was supposed to be commited. This problem was introduced in dotnet#17769.
Changes I intend to be permanent for local gc:
Changes I intend to be temporary and fixed in future issues