Skip to content

Crossgen2 parallelism triggered race #616

@janvorli

Description

@janvorli

I am hitting an assert at this stack trace in the crossgen2 process:

Assert failure(PID 90600 [0x000161e8], Thread: 98584 [0x18118]): cbTotal == SIZE
CLRJITILC! CQuickMemoryBase<512,128>::ReSizeNoThrow + 0x169 (0x00007ff8`37627fb9)
CLRJITILC! CQuickArrayBase<unsigned short>::ReSizeNoThrow + 0x62 (0x00007ff8`375d6ac2)
CLRJITILC! InitLogging + 0x187 (0x00007ff8`375db4b7)
CLRJITILC! InitializeLogging + 0x36 (0x00007ff8`375dbee6)
CLRJITILC! GcInfoEncoder::GcInfoEncoder + 0xA3 (0x00007ff8`3766e433)
CLRJITILC! CodeGen::genCreateAndStoreGCInfoX64 + 0x11A (0x00007ff8`3752855a)
CLRJITILC! CodeGen::genCreateAndStoreGCInfo + 0x44 (0x00007ff8`37528424)
CLRJITILC! CodeGen::genGenerateCode + 0xC39 (0x00007ff8`3724ee79)
CLRJITILC! Compiler::compCompile + 0xFB5 (0x00007ff8`37275de5)
CLRJITILC! Compiler::compCompileHelper + 0xDB1 (0x00007ff8`37279151)
    File: F:\git\runtime\src\coreclr\src\inc\corhlprpriv.cpp Line: 68
    Image: f:\git\runtime\artifacts\tests\coreclr\Windows_NT.x64.Debug\Tests\Core_Root\crossgen2\crossgen2.exe

The assert can only happen when there is a race. Clearly, the logging initialization is not multi-threading safe (in our case, the failing call to ReSizeNoThrow is szLogFileName.ReSizeNoThrow(MAX_LONGPATH), the szLogFileName is a static variable) and with the new parallelization of crossgen2, we are hitting it from multiple threads at once.

Metadata

Metadata

Labels

area-VM-coreclruntriagedNew issue has not been triaged by the area owner

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions