-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
area-VM-reflection-monoReflection issues specific to MonoVMReflection issues specific to MonoVMin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
One of the types from the test below is crashing the mono runtime in #71324 (most likely typeof(void)
)
Specific commit affected
39b0578
Relevant code:
[Theory]
[InlineData(typeof(void))]
[InlineData(typeof(Dictionary<,>))]
[InlineData(typeof(List<>))]
[InlineData(typeof(Nullable<>))]
[InlineData(typeof(int*))]
[InlineData(typeof(RefStruct))]
public static void CreateJsonTypeInfoWithInappropriateTypeThrows(Type type)
{
Assert.Throws<ArgumentException>(() => JsonTypeInfo.CreateJsonTypeInfo(type, new JsonSerializerOptions()));
}
// JsonTypeInfo.CreateJsonTypeInfo:
if (IsInvalidForSerialization(type)) // it seems it passed the check in the repro
{
ThrowHelper.ThrowArgumentException_CannotSerializeInvalidType(nameof(type), type, null, null);
}
s_createJsonTypeInfo ??= typeof(JsonTypeInfo).GetMethod(nameof(CreateJsonTypeInfo), new Type[] { typeof(JsonSerializerOptions) })!;
return (JsonTypeInfo)s_createJsonTypeInfo.MakeGenericMethod(type)
.Invoke(null, new object[] { options })!;
Metadata
Metadata
Assignees
Labels
area-VM-reflection-monoReflection issues specific to MonoVMReflection issues specific to MonoVMin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ghost commentedon Jun 27, 2022
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.
Issue Details
One of the types from the test below is crashing the mono runtime in #71324 (most likely
typeof(void)
)Specific commit affected
39b0578
Relevant code:
cc: @steveisok @fanyang-mono
area-System.Text.Json
,untriaged
,Mono
[-]Invalid generic argument for MakeGenericMethod is crashing the runtime[/-][+]Invalid type for MakeGenericMethod is crashing the runtime[/+]add check for typeof(void) - possibly workaround dotnet#71339
krwq commentedon Jun 27, 2022
typeof(void)
is definitely the culprit for the failures, others might too.Here is the full log
Argument tests for CreateJsonTypeInfo and CreateJsonPropertyInfo (#71324
eiriktsarpalis commentedon Jun 27, 2022
It seems like it might be possible to isolate this in a standalone reproduction that doesn't use json components?
ghost commentedon Jun 27, 2022
Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.
Issue Details
One of the types from the test below is crashing the mono runtime in #71324 (most likely
typeof(void)
)Specific commit affected
39b0578
Relevant code:
cc: @steveisok @fanyang-mono
area-System.Reflection
,Mono
krwq commentedon Jun 28, 2022
MakeGenericMethod
+typeof(void)
19 remaining items