From 3d639f216f279e03098a1a5ba93fe764c370c281 Mon Sep 17 00:00:00 2001 From: Peter Sollich Date: Fri, 21 Aug 2020 14:57:06 +0200 Subject: [PATCH 1/4] delete backport.yml so I can push to master --- .github/workflows/backport.yml | 26 ------------------------ .gitignore | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 79cde1d3ce293f..00000000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Backport PR to branch -on: - issue_comment: - types: [created] - -jobs: - backport: - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport to') - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Run backport - uses: ./eng/actions/backport - with: - auth_token: ${{ secrets.GITHUB_TOKEN }} - pr_description_template: | - Backport of #%source_pr_number% to %target_branch% - - /cc %cc_users% - - ## Customer Impact - - ## Testing - - ## Risk diff --git a/.gitignore b/.gitignore index 7596f954d9512a..0a77336126eb44 100644 --- a/.gitignore +++ b/.gitignore @@ -356,3 +356,40 @@ src/coreclr/src/System.Private.CoreLib/common # Mono Wasm-specific excludes src/mono/wasm/emsdk/ src/mono/wasm/.stamp-wasm-install-and-select* +/src/tests/readytorun/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/tests/readytorun/out/build/x64-Debug (Standard)/rules.ninja +/src/tests/readytorun/out/build/x64-Debug (Standard)/build.ninja +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/target-nativelibrary-Debug-db3cc60a4a30aa6ad4f9.json +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/index-2020-08-21T10-11-45-0169.json +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/codemodel-v2-54a6f181cd4cae4a23f1.json +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/cmakeFiles-v1-721ff5cc9aabe9506246.json +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/cache-v2-94dde366ed96f1844532.json +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS +/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1 +/src/tests/readytorun/out/build/x64-Debug (Standard) +/src/tests/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/tests/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json +/src/tests/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS +/src/tests/out/build/x64-Debug (Standard) +/src/tests +/src/mono/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/mono/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json +/src/mono/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS +/src/mono/out/build/x64-Debug (Standard) +/src/libraries/Native/Windows/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/libraries/Native/Windows/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json +/src/libraries/Native/Windows/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS +/src/libraries/Native/Windows/out/build/x64-Debug (Standard) +/src/libraries/Native/Unix/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/libraries/Native/Unix/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json +/src/libraries/Native/Unix/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS +/src/libraries/Native/Unix/out/build/x64-Debug (Standard) +/src/libraries/Native +/src/installer/corehost/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/installer/corehost/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json +/src/installer/corehost/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS +/src/installer/corehost/out/build/x64-Debug (Standard) +/src/coreclr/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt +/src/coreclr/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json From 0fc9aebbf6d85d57e79c7ef5814e4fd1fec35813 Mon Sep 17 00:00:00 2001 From: Peter Sollich Date: Thu, 27 Aug 2020 11:36:14 +0200 Subject: [PATCH 2/4] Undo unintended changes --- .github/workflows/backport.yml | 26 ++++++++++++++++++++++++ .gitignore | 37 ---------------------------------- 2 files changed, 26 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000000000..79cde1d3ce293f --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,26 @@ +name: Backport PR to branch +on: + issue_comment: + types: [created] + +jobs: + backport: + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport to') + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Run backport + uses: ./eng/actions/backport + with: + auth_token: ${{ secrets.GITHUB_TOKEN }} + pr_description_template: | + Backport of #%source_pr_number% to %target_branch% + + /cc %cc_users% + + ## Customer Impact + + ## Testing + + ## Risk diff --git a/.gitignore b/.gitignore index 0a77336126eb44..7596f954d9512a 100644 --- a/.gitignore +++ b/.gitignore @@ -356,40 +356,3 @@ src/coreclr/src/System.Private.CoreLib/common # Mono Wasm-specific excludes src/mono/wasm/emsdk/ src/mono/wasm/.stamp-wasm-install-and-select* -/src/tests/readytorun/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/tests/readytorun/out/build/x64-Debug (Standard)/rules.ninja -/src/tests/readytorun/out/build/x64-Debug (Standard)/build.ninja -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/target-nativelibrary-Debug-db3cc60a4a30aa6ad4f9.json -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/index-2020-08-21T10-11-45-0169.json -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/codemodel-v2-54a6f181cd4cae4a23f1.json -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/cmakeFiles-v1-721ff5cc9aabe9506246.json -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply/cache-v2-94dde366ed96f1844532.json -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/reply -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS -/src/tests/readytorun/out/build/x64-Debug (Standard)/.cmake/api/v1 -/src/tests/readytorun/out/build/x64-Debug (Standard) -/src/tests/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/tests/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json -/src/tests/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS -/src/tests/out/build/x64-Debug (Standard) -/src/tests -/src/mono/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/mono/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json -/src/mono/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS -/src/mono/out/build/x64-Debug (Standard) -/src/libraries/Native/Windows/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/libraries/Native/Windows/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json -/src/libraries/Native/Windows/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS -/src/libraries/Native/Windows/out/build/x64-Debug (Standard) -/src/libraries/Native/Unix/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/libraries/Native/Unix/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json -/src/libraries/Native/Unix/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS -/src/libraries/Native/Unix/out/build/x64-Debug (Standard) -/src/libraries/Native -/src/installer/corehost/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/installer/corehost/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json -/src/installer/corehost/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS -/src/installer/corehost/out/build/x64-Debug (Standard) -/src/coreclr/out/build/x64-Debug (Standard)/VSInheritEnvironments.txt -/src/coreclr/out/build/x64-Debug (Standard)/.cmake/api/v1/query/client-MicrosoftVS/query.json From 77dd41bc42ac827e2b66ef59da5c90283733f9a0 Mon Sep 17 00:00:00 2001 From: Peter Sollich Date: Thu, 12 Nov 2020 11:21:08 +0100 Subject: [PATCH 3/4] Fix inconsistency with concurrent allocation of large objects. Details: In gc_heap::allocate_uoh_object. we set the background mark bit if the new object is in a range that has mark bits committed. However, if the object is in a segment that is allocated during background_sweep, we won't actually sweep the segment, and so the background mark bits stays on, causing confusion in the next background GC - the object itself will survive, but we won't keep the objects that it points at, so we'll have heap corruption. --- src/coreclr/src/gc/gc.cpp | 17 +++++++++++++---- src/coreclr/src/gc/gcpriv.h | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index 38b6d8e97d56b1..6eb6142f27b7b4 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -34133,10 +34133,19 @@ CObjectHeader* gc_heap::allocate_uoh_object (size_t jsize, uint32_t flags, int g //mark the new block specially so we know it is a new object if ((result < current_highest_address) && (result >= current_lowest_address)) { - dprintf (3, ("Setting mark bit at address %Ix", - (size_t)(&mark_array [mark_word_of (result)]))); +#ifdef DOUBLY_LINKED_FL + heap_segment* seg = seg_mapping_table_segment_of (result); + // if bgc_allocated is 0 it means it was allocated during bgc sweep, + // and since sweep does not look at this seg we cannot set the mark array bit. + uint8_t* background_allocated = heap_segment_background_allocated(seg); + if (background_allocated != 0) +#endif //DOUBLY_LINKED_FL + { + dprintf(3, ("Setting mark bit at address %Ix", + (size_t)(&mark_array[mark_word_of(result)]))); - mark_array_set_marked (result); + mark_array_set_marked(result); + } } } } @@ -34515,7 +34524,7 @@ BOOL gc_heap::fgc_should_consider_object (uint8_t* o, no_bgc_mark_p = TRUE; } - dprintf (3, ("bgc mark %Ix: %s (bm: %s)", o, (no_bgc_mark_p ? "no" : "yes"), (background_object_marked (o, FALSE) ? "yes" : "no"))); + dprintf (3, ("bgc mark %Ix: %s (bm: %s)", o, (no_bgc_mark_p ? "no" : "yes"), ((no_bgc_mark_p || background_object_marked (o, FALSE)) ? "yes" : "no"))); return (no_bgc_mark_p ? TRUE : background_object_marked (o, FALSE)); } diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 23f5bc83633955..37e957c3bffa18 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -66,7 +66,7 @@ inline void FATAL_GC_ERROR() // We need the lower 3 bits in the MT to do our bookkeeping so doubly linked free list is only for 64-bit #ifdef HOST_64BIT // To be enabled. -// #define DOUBLY_LINKED_FL +#define DOUBLY_LINKED_FL #endif //HOST_64BIT #ifndef FEATURE_REDHAWK From c7d8eda7254fcf5107f5fcec8b37c99fa0f944b6 Mon Sep 17 00:00:00 2001 From: Peter Sollich Date: Thu, 12 Nov 2020 15:30:06 +0100 Subject: [PATCH 4/4] Remove out-of-date comment. --- src/coreclr/src/gc/gcpriv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 37e957c3bffa18..223db42108ed4d 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -65,7 +65,6 @@ inline void FATAL_GC_ERROR() // We need the lower 3 bits in the MT to do our bookkeeping so doubly linked free list is only for 64-bit #ifdef HOST_64BIT -// To be enabled. #define DOUBLY_LINKED_FL #endif //HOST_64BIT