I originally hit this bug when testing my Crossgen2 perf optimization
change involving only registering composite code range once but I
managed to disprove the bug was caused by this change. Indeed, it
was caused by my earlier change improving component assembly caching.
In my overzealous attempt to make sure the assembly gets always
registered I added a new method NativeImage::AddComponentAssemblyToCache
that registered the assembly which had triggered the native image load
in the first place. This was incorrect, by that point the assembly
wasn't yet fully initialized and putting it in the cache made it
visible to other threads that subsequently crashed trying to access
the assembly before it was fully loaded.
Furthermore it was unnecessary, once the assembly gets loaded, it
gets stored in the cache via the call to
SetNativeMetadataAssemblyRefInCache from ZapSig::DecodeModuleFromIndex.
Before the fix I was able to repro the bug locally typically after
about 500 iterations of the thread14 unit test, with the fix I was
unable to repro after 4500 iterations.
Thanks
Tomas
Fixes: https://github.com/dotnet/runtime/issues/66954
Probably also fixes: https://github.com/dotnet/runtime/issues/66210
Fixes#66715
We are seeing exceptions thrown at shutdown turn into hangs because the debugger
lock suspends threads at that point. We are mitigating that problem by disabling the
jit attach setup work and allowing WatsonLastChance to continue.
Some library tests fail to AOT on helix by getting oomkill'ed. Since the
build machine have more resources than helix, we can AOT these specific
library tests there, and send the built output to helix to run.
Specifically:
- `System.Text.Json.SourceGeneration.Roslyn3.11.Tests`
- `System.Text.Json.SourceGeneration.Roslyn4.0.Tests`
- `System.Text.Json.Tests`
- `Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests`
This adds two new jobs to `runtime-wasm`, and for rolling builds - `LibraryTests_HighResource_AOT` for linux, and windows.
Fixes#65356Fixes#65411Fixes#61524Fixes#66647
- It's commonly used with zero args; we can use Type.EmptyTypes rather than new Type[0]
- It calls GetConstructors, which internally uses ListBuilder and then resizes if the created array isn't filled, but since we don't need the correctly sized array, we can just use the ListBuilder and avoid the resize
- It creates a List and then ToArray's it, but if none of the constructors are filtered out, it's better to just use the array we built up directly.
job.yml uses name instead of displayName to set the job's name. But perf jobs don't set that. Without this, pre-defined variables like System.PhaseName get value Job1.
This will help with differentiating builds in kusto.
* Infra for regeneration of third-party-notices file
* Update eng/regenerate-third-party-notices.proj
Co-authored-by: Davis Goodin <[email protected]>
* Addressing PR comments
* Updated copyright in all .cs files
* Update dotnet/liner repo name
* Add dotnet/emsdk to the list
Co-authored-by: Davis Goodin <[email protected]>
This is a somewhat annoying aspect hitting less than 10% of the
JIT/Methodical subtree: as the new merged wrapper logic is based
on simple assembly names, we cannot merge multiple test projects
that produce a test assembly with the same name otherwise such
assemblies stomp over each other when getting copied to the merged
wrapper folder. I have added a new option to ILTransform to include
the directory name in the project names in these cases. We can
remove some of this in the future when selectively merging actual
test source code (compiling multiple tests into a single asssembly).
Thanks
Tomas
* Fix error reporting for objects with unsupported property types
* refactor dictionary tests to use xunit theories
* lift test class to abstracted test harness
* Disable multimodule test
Can't use issues.targets because this is a compile failure and compilation runs during test build, not execution.
* Update MultiModule.csproj
I was trying to repro #66191 and assumed determinism is the root cause. I used `CoreRT_DeterminismSeed` to perturb the dependency node evaluation and it found differences.
Now, I don't think the differences really matter. We already seem to be deterministic in the multithreaded compilation (the outputs are always the same no matter how many times I try).
`CoreRT_DeterminismSeed` perturbs the order in which node dependencies are evaluated and that exposes more ordering issues than we practically have.
In normal multithreaded compilation we grab nodes in different order from the `NodeFactory` as part of method compilation, but the order in which those nodes are evaluated is still fixed. This means the nodes we grabbed are still getting marked in a deterministic order and we get stable ordering even without an explicit sort in this spot.
But maybe as part of https://github.com/dotnet/runtimelab/issues/1631 we should enable `CoreRT_Determinism` in our testing and for that we need this extra sorting.
When we emit a bitmap lookup for character classes containing only ASCII characters, we currently bound the check by 128, e.g.
```C#
if (ch < 128 && lookupTable[...])
```
but we can easily lower that 128 to instead be the actual exclusive upper bound based on the char set. Doing so means we don't need to hit the lookup table for a larger set of characters.
(We could also actually shrink the size of the lookup table itself, but doing so would only save a few bytes, and it didn't seem worth the complexity right now. We could also add a lower range check, but that's also additional checks to execute whereas this one is just improving an existing check that's also required for correctness.)
The XML deserializer tracks for each property whether it's already been seen in the input being deserialized, and to do that the reader allocates a bool[] array. We can instead stackalloc that for a reasonable number of properties.
This works around ABI breaking change made between OpenSSL 1.1 and 3.0 where argument type and return type was changed from unsigned long to uint64_t, which caused issues on arm32 architectures with OpenSSL 3.0 installed.
Co-authored-by: Jeremy Barton <[email protected]>
Co-authored-by: Tomas Weinfurt <[email protected]>
Historically, the asymmetric algorithm base classes have had the hashing routines as abstract (or virtual+throw).
Now the base classes provide an implementation for these methods, reducing the amount of redundant effort on the part of derived types.
The crypto test suites were originally disabled as they would run out of memory on both emulators and devices somewhat frequently.
This change enables them again, with the difference being that xunit will run tests on a single thread.
Addresses #62547
When cmake configuration fails due to missing dependency or manually terminated in the middle (Ctrl+C) for some reason, re-running the build command fails with these messages:
```
CMake command line is unchanged. Reusing previous cache instead of regenerating.
Unable to find generated build files for "native libraries component" project!
```
The workaround is to delete artifacts directory and rerun the build command, which is wasteful (as it repreforms all the previous steps including rebuilding the previous subsets). cmake has its own up-to-date caching mechanism which works well on Unix (it has some issues on Windows/MSBuild), so deleting the custom sentinel-based cache on Unix makes it more robust and saves some time. The one in `gen-buildsys.cmd` for Windows is kept intact.
* Add Expiry timestamp on SafeFreeCredentials handle
* Recalculate expiration timestamp based on CertificateContext
* Fix case when user provides CertificateContext