[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59 - #4

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137
Open

[wasm] Bump chrome for testing - linux: 118.0.5993.117, windows: 119.0.6045.59#4
github-actions[bot] wants to merge 1 commit into
mainfrom
update-chrome-version-6680291137

Conversation

@github-actions

Copy link
Copy Markdown

No description provided.

maraf pushed a commit that referenced this pull request Sep 24, 2024
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
maraf pushed a commit that referenced this pull request Oct 9, 2024
* [NRBF] Don't use Unsafe.As when decoding DateTime(s) (dotnet#105749)
* Add NrbfDecoder Fuzzer (dotnet#107385)
* [NRBF] Fix bugs discovered by the fuzzer (dotnet#107368)
* bug #1: don't allow for values out of the SerializationRecordType enum range
* bug #2: throw SerializationException rather than KeyNotFoundException when the referenced record is missing or it points to a record of different type
* bug #3: throw SerializationException rather than FormatException when it's being thrown by BinaryReader (or sth else that we use)
* bug #4: document the fact that IOException can be thrown
* bug #5: throw SerializationException rather than OverflowException when parsing the decimal fails
* bug #6: 0 and 17 are illegal values for PrimitiveType enum
* bug #7: throw SerializationException when a surrogate character is read (so far an ArgumentException was thrown)
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/NrbfDecoder.cs
* [NRBF] throw SerializationException when a surrogate character is read (dotnet#107532)
(so far an ArgumentException was thrown)
* [NRBF] Fuzzing non-seekable stream input (dotnet#107605)
* [NRBF] More bug fixes (dotnet#107682)
- Don't use `Debug.Fail` not followed by an exception (it may cause problems for apps deployed in Debug)
- avoid Int32 overflow
- throw for unexpected enum values just in case parsing has not rejected them
- validate the number of chars read by BinaryReader.ReadChars
- pass serialization record id to ex message
- return false rather than throw EndOfStreamException when provided Stream has not enough data
- don't restore the position in finally - limit max SZ and MD array length to Array.MaxLength, stop using LinkedList<T> as List<T> will be able to hold all elements now
- remove internal enum values that were always illegal, but needed to be handled everywhere
- Fix DebuggerDisplay
* [NRBF] Comments and bug fixes from internal code review (dotnet#107735)
* copy comments and asserts from Levis internal code review
* apply Levis suggestion: don't store Array.MaxLength as a const, as it may change in the future
* add missing and fix some of the existing comments
* first bug fix: SerializationRecord.TypeNameMatches should throw ArgumentNullException for null Type argument
* second bug fix: SerializationRecord.TypeNameMatches should know the difference between SZArray and single-dimension, non-zero offset arrays (example: int[] and int[*])
* third bug fix: don't cast bytes to booleans
* fourth bug fix: don't cast bytes to DateTimes
* add one test case that I've forgot in previous PR
# Conflicts:
#	src/libraries/System.Formats.Nrbf/src/System/Formats/Nrbf/SerializationRecord.cs
* [NRBF] Address issues discovered by Threat Model (dotnet#106629)
* introduce ArrayRecord.FlattenedLength
* do not include invalid Type or Assembly names in the exception messages, as it's most likely corrupted/tampered/malicious data and could be used as a vector of attack.
* It is possible to have binary array records have an element type of array without being marked as jagged
---------
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
maraf pushed a commit that referenced this pull request May 14, 2026
…128163)
> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.
Fixesdotnet#128044.
## Problem
createdump SIGSEGVs on Linux when generating a Heap-type minidump for a
process running interpreted code. The crash reproduces locally with the
`InterpreterStack` DumpTests debuggee and matches the CI failure that
prompted `<DumpTypes>Full</DumpTypes>` to be added as a temporary
workaround.
The faulting backtrace is:
```
#0 Thread::IsAddressInStack threads.cpp:6741
#1 Thread::EnumMemoryRegionsWorker threads.cpp:6909 (calls IsAddressInStack(currentSP))
#2 Thread::EnumMemoryRegions threads.cpp
#3 ThreadStore::EnumMemoryRegions
#4 ClrDataAccess::EnumMemDumpAllThreadsStack
#5 ClrDataAccess::EnumMemoryRegionsWorkerHeap (HEAP2-only path)
```
## Root cause
`Thread::m_pInterpThreadContext` was declared as a raw
`InterpThreadContext *`. In non-DAC code that's a normal host pointer,
but in
DAC mode the field's value is a target-process address. When
`IsAddressInStack` (a DAC-callable helper) dereferenced
`m_pInterpThreadContext->pStackStart` it read from a target-process
address
as if it were a host address, which faults inside createdump.
## Fix
Change the field type to `PTR_InterpThreadContext` (DPTR), matching the
treatment of other Thread fields like `m_pFrame`. In non-DAC builds
`DPTR(T)` is just `T*`, so there is no overhead or behavior change. In
DAC
builds the read goes through `__DPtr<T>` and marshals correctly from the
target.
Also remove the `<DumpTypes>Full</DumpTypes>` workaround on the
`InterpreterStack` DumpTests debuggee so the Heap path that originally
failed is exercised again.
## Validation
Locally reproduced the original SIGSEGV on Linux x64 with the auto-dump
mechanism (`DOTNET_DbgMiniDumpType=2` + `DOTNET_Interpreter=MethodA`)
running the `InterpreterStack` debuggee. With this fix applied,
createdump
produces a complete Heap dump (~74 MB) instead of crashing.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maraf pushed a commit that referenced this pull request Jul 16, 2026
dotnet#127318)
## Summary
Adds support for applying `[JsonDerivedType(typeof(Derived<>))]` to a
generic base type. The polymorphic resolver and source generator each
unify the open derived type against the closed base and, when a single
closed derived type can be constructed, register it for serialization.
This is groundwork for the upcoming C# [closed hierarchies][closed]
language feature, which allows generic closed base classes. Today,
polymorphic serialization requires every derived type to be spelled out
as a fully closed generic instantiation — workable for non-generic
hierarchies, but impractical for generic ones where each combination of
the base's type arguments yields a distinct closed instantiation that
the author would otherwise have to enumerate by hand.
Tracking: part of the work for dotnet#125449.
[closed]:
https://github.com/dotnet/csharplang/blob/main/proposals/closed-hierarchies.md
## Patterns now admitted
Each example uses regular classes; for each pattern the derived
attribute is declared once with an open generic, and the closed forms
are resolved per serialized instantiation of the base. All of these
compile (source generator) and round-trip (reflection):
1. **Matching arity / identity binding** — derived passes the base's
type parameter through unchanged.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> { ... }
// Base<int> → Derived<int>
// Base<string> → Derived<string>
```
2. **Reordered parameters** — derived rebinds the base's parameters in a
different position.
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T1, T2> { ... }
public class Derived<U, V> : Base<V, U> { ... }
// Base<int, string> → Derived<string, int>
```
3. **Partial concretization in the derived's base spec** — derived fixes
some of the base's parameters to concrete types and leaves others open.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<string, int> → Derived<string>
// Base<bool, int> → Derived<bool>
```
4. **Wrapped / nested type arguments** — derived's type parameter shows
up inside a generic construction (or array) in the base spec.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<List<int>> → Derived<int>
[JsonDerivedType(typeof(ArrayDerived<>), "a")]
public class ArrayDerived<T> : Base<T[]> { ... }
// Base<int[]> → ArrayDerived<int>
```
5. **Interface bases** — same unification logic applies when the base is
a generic interface.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T> { ... }
// IBase<int> → Derived<int>
```
6. **Type parameters from enclosing types** — derived inherits part of
its type arguments from an outer generic class.
```csharp
[JsonDerivedType(typeof(Outer<>.Leaf<>), "leaf")]
public class Base<T> { ... }
public class Outer<T>
{
public class Leaf<U> : Base<(T, U)> { ... }
}
// Base<(int, string)> → Outer<int>.Leaf<string>
```
## Patterns still not supported (loud failure)
Each of these emits **SYSLIB1229** at source-generation time and throws
`InvalidOperationException` at reflection-resolver `Configure()` time.
The restrictions mirror the C# closed-hierarchies rules ("all of the
derived's type parameters must be used in the base class
specification"), with the additional requirement that the unification be
unambiguous.
1. **Ground-position mismatch** — derived constrains a base parameter to
a concrete type that the closed base doesn't agree with.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T1, T2> { ... }
public class Derived<T> : Base<T, int> { ... }
// Base<int, string> → ✗ (Derived requires T2 == int, but base has T2 ==
string)
```
2. **Wrapping not present on the closed base** — derived's base spec
wraps the parameter in a generic that the closed base doesn't carry.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<List<T>> { ... }
// Base<int> → ✗ (closed base T is `int`, not `List<...>`)
// Base<List<int>> → ✓ Derived<int> (admitted by pattern #4)
```
3. **Unbound derived type parameters** — derived declares more type
parameters than the base substitution can pin down (the
closed-hierarchies spec rejects this form directly).
```csharp
[JsonDerivedType(typeof(Derived<,>), "d")]
public class Base<T> { ... }
public class Derived<T, U> : Base<T> { ... }
// Base<int> → ✗ (U is unbound)
```
4. **Constraint violation under the resolved substitution** —
unification succeeds structurally but the closed derived type would
violate a `where` constraint.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base<T> { ... }
public class Derived<T> : Base<T> where T : struct { ... }
// Base<string> → ✗ (string does not satisfy `where T : struct`)
```
5. **Ambiguous match** — derived implements two distinct constructions
of the same generic base, so the closed base could correspond to either.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public interface IBase<T> { ... }
public class Derived<T> : IBase<T>, IBase<int> { ... }
// IBase<int> → ✗ (could be Derived<int> or Derived<T> for any T)
```
6. **Arity / shape mismatch** — derived's open form has no constructed
base in common with the closed base at all.
```csharp
[JsonDerivedType(typeof(Derived<>), "d")]
public class Base { ... } // non-generic
public class Derived<T> : Base { ... }
// Base → ✗ (closed base has no type arguments to bind T)
```
## Diagnostic
| ID | Severity | Message |
| ---------- | -------- |
---------------------------------------------------------------------------------------
|
| SYSLIB1229 | Warning | The open generic derived type `'{0}'` could not
be resolved against base `'{1}'`: `{2}` |
SYSLIB1229 is `#pragma`-suppressible, in which case the offending
derived entry is simply skipped from the generated metadata.
## Checklist
- [x] New tests in `JsonSourceGeneratorDiagnosticsTests` and
`PolymorphicTests.CustomTypeHierarchies` cover every supported and
unsupported pattern listed above.
- [x] Reflection resolver and source generator carry cross-referencing
comments on their two `TryResolveOpenGenericDerivedType` implementations
so the algorithms stay in sync.
- [x] SYSLIB1229 added to `docs/project/list-of-diagnostics.md`.
- [x] All reviewer feedback addressed.
- [x] All review threads resolved.
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants