Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e24179e
[release/8.0-staging] [browser] Use whole assembly name when looking …
maraf Jan 19, 2024
5e9e29f
[release/8.0][browser] BrowserWebSocket.ReceiveAsync after server ini…
pavelsavara Jan 23, 2024
fe443a9
[release/8.0][mono][debugger] Debugger improvements on .net8 (#97160)
thaystg Jan 24, 2024
d7a4118
[release/8.0-staging] Add additionalSize for the DisableOptData (#97479)
github-actions[bot] Jan 26, 2024
1901707
[release/8.0-staging] Bump to new Ubuntu 22.04 queue for PPC64 (#97555)
github-actions[bot] Jan 26, 2024
b54886b
[release/8.0-staging] Fix compilation error with generic type attribu…
github-actions[bot] Jan 31, 2024
e6d8079
Remove use of NewHolder as field. (#97843)
github-actions[bot] Feb 6, 2024
b0025c7
[release/8.0-staging] Update dependencies from dotnet/runtime-assets …
dotnet-maestro[bot] Feb 7, 2024
d8042d4
Update dependencies from https://github.com/dotnet/hotreload-utils bu…
dotnet-maestro[bot] Feb 7, 2024
c2415d7
[release/8.0] Fix STJ SG regression in handling of property names tha…
eiriktsarpalis Feb 8, 2024
2663ba6
Update SystemDataSqlClientVersion from 4.8.5 -> 4.8.6 for component g…
github-actions[bot] Feb 8, 2024
d62ff0b
Disable jiterpreter_do_jit_call to address issues with disabling Wasm…
kg Feb 8, 2024
53c1d13
Fixes exception while debugging on Chrome as IDE (#97871)
github-actions[bot] Feb 9, 2024
ea2b2e8
Backport #97418 (#97568)
thaystg Feb 9, 2024
279fe23
Update dependencies from https://github.com/dotnet/runtime-assets bui…
dotnet-maestro[bot] Feb 9, 2024
eded9a5
[release/8.0-staging] Ensure that the Create(Dot(...)) optimization d…
github-actions[bot] Feb 9, 2024
a143568
Don't clean up thread list on shutdown (#97188)
github-actions[bot] Feb 9, 2024
2767a15
[mono][interp] Fix inlining of ldarga (#97650)
BrzVlad Feb 9, 2024
ef1b0d6
[release/8.0-staging] [mono][jit] Fix passing of byref arguments in m…
vargaz Feb 9, 2024
4b040aa
Stop trying to format HOST_RUNTIME_CONTRACT property with locale sett…
elinor-fung Feb 9, 2024
6cd0edd
Backport of Handle open types to appear in interface maps (#97733) to…
davidwrighton Feb 9, 2024
c804f58
[release/8.0-staging] Move a lock to protect m_pDynamicStaticsInfo (#…
github-actions[bot] Feb 9, 2024
f4075f3
Ensure that constant folding for SIMD shifts on xarch follow the corr…
tannergooding Feb 10, 2024
d45a576
[release/8.0-staging] Ensure that the various `Max*Number` and `Min*N…
github-actions[bot] Feb 10, 2024
ff4e048
Define installer-owned directories (#98241)
github-actions[bot] Feb 11, 2024
2190e9b
Fix Windows implementation of NegotiateAuthenticationPal.GetMIC (#98031)
filipnavara Feb 12, 2024
dedae5e
[release/8.0-staging] Fix constant folding for arm64 MultiplyByScalar…
jakobbotsch Feb 12, 2024
bb540a8
[NativeAOT][8.0] Use ld_classic in ILC build and in build integration…
VSadov Feb 12, 2024
ba68cf1
Fix side effect of only not sending assembly_load while invoking meth…
github-actions[bot] Feb 12, 2024
6dec8dd
Fix polluted CompareState when comparing element types in a signature…
elinor-fung Feb 12, 2024
9598872
[release/8.0-staging] Update dependencies from dotnet/emsdk (#97405)
dotnet-maestro[bot] Feb 12, 2024
11ae42b
[release/8.0-staging] Fix regex lazy loop handling of backtracking st…
github-actions[bot] Feb 12, 2024
b7fda9f
Add ca-certificates to Mariner 2.0 deps (#98267)
github-actions[bot] Feb 12, 2024
00c95a6
[release/8.0-staging] Ensure that Vector512 uses the same patterns as…
github-actions[bot] Feb 12, 2024
c192fba
[release/8.0-staging] Implement faster RSA key check
github-actions[bot] Feb 12, 2024
11a4ff1
[release/8.0-staging] ServiceKey comparisons use Equals for matching …
github-actions[bot] Feb 12, 2024
ec1636f
Merge branch 'release/8.0' into release/8.0-staging
carlossanlop Feb 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[release/8.0-staging] Move a lock to protect m_pDynamicStaticsInfo (#…
…97352)

* Move a lock to protect m_pDynamicStaticsInfo

* apply feedback

* cast to LONG

* Fix access to m_pDynamicStaticsInfo (#97353)

- Remove race condition where it is possible that an updated dynamic statics info pointer is published without ensuring that the data is also considered written.
- Use VolatileLoadWithoutBarrier at the read site (where locks are not taken) to ensure that there are no difficult to examine reads of this pointer.

---------

Co-authored-by: Hyungju Lee <[email protected]>
Co-authored-by: David Wrighton <[email protected]>
  • Loading branch information
3 people authored Feb 9, 2024
commit c804f58a6e594202c711a25281c80249e16079c2
30 changes: 13 additions & 17 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,29 +1550,25 @@ DWORD Module::AllocateDynamicEntry(MethodTable *pMT)
}
CONTRACTL_END;

DWORD newId = InterlockedExchangeAdd((LONG*)&m_cDynamicEntries, 1);
CrstHolder ch(&m_Crst);
DWORD newId = (LONG)m_cDynamicEntries++;

if (newId >= VolatileLoad(&m_maxDynamicEntries))
if (newId >= m_maxDynamicEntries)
{
CrstHolder ch(&m_Crst);

if (newId >= m_maxDynamicEntries)
SIZE_T maxDynamicEntries = max(16, m_maxDynamicEntries);
while (maxDynamicEntries <= newId)
{
SIZE_T maxDynamicEntries = max(16, m_maxDynamicEntries);
while (maxDynamicEntries <= newId)
{
maxDynamicEntries *= 2;
}
maxDynamicEntries *= 2;
}

DynamicStaticsInfo* pNewDynamicStaticsInfo = (DynamicStaticsInfo*)
(void*)GetLoaderAllocator()->GetHighFrequencyHeap()->AllocMem(S_SIZE_T(sizeof(DynamicStaticsInfo)) * S_SIZE_T(maxDynamicEntries));
DynamicStaticsInfo* pNewDynamicStaticsInfo = (DynamicStaticsInfo*)
(void*)GetLoaderAllocator()->GetHighFrequencyHeap()->AllocMem(S_SIZE_T(sizeof(DynamicStaticsInfo)) * S_SIZE_T(maxDynamicEntries));

if (m_pDynamicStaticsInfo)
memcpy(pNewDynamicStaticsInfo, m_pDynamicStaticsInfo, sizeof(DynamicStaticsInfo) * m_maxDynamicEntries);
if (m_pDynamicStaticsInfo)
memcpy(pNewDynamicStaticsInfo, m_pDynamicStaticsInfo, sizeof(DynamicStaticsInfo) * m_maxDynamicEntries);

m_pDynamicStaticsInfo = pNewDynamicStaticsInfo;
VolatileStore(&m_maxDynamicEntries, maxDynamicEntries);
}
VolatileStore(&m_pDynamicStaticsInfo, pNewDynamicStaticsInfo);
m_maxDynamicEntries = maxDynamicEntries;
}

m_pDynamicStaticsInfo[newId].pEnclosingMT = pMT;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/ceeload.inl
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ inline MethodTable* Module::GetDynamicClassMT(DWORD dynamicClassID)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(m_cDynamicEntries > dynamicClassID);
return m_pDynamicStaticsInfo[dynamicClassID].pEnclosingMT;
return VolatileLoadWithoutBarrier(&m_pDynamicStaticsInfo)[dynamicClassID].pEnclosingMT;
}

#ifdef FEATURE_CODE_VERSIONING
Expand Down