Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONO interpreter: NIY encountered in method MemoryPack.IMemoryPackable.Deserialize #328

Open
thedude61636 opened this issue Sep 1, 2024 · 1 comment

Comments

@thedude61636
Copy link

Greetings,
First off You have a great package and it's really fast.
However I'm getting an issue in blazor wasm with a certain object I have
Currently the object has 74 fields, as soon as I add four more it crashes on deserialization on the browser in release mode and only in release mode.

MONO interpreter: NIY encountered in method MemoryPack.IMemoryPackable<Shared.Models.Main.MainModel>.Deserialize
logging.ts:119  
Error: [MONO] * Assertion: should not be reached at /__w/1/s/src/mono/mono/mini/interp/interp.c:3850

these are the fields I have I've omitted the names

public double?
public double?
public double?
public double?
public double?
public double?
public double?
public int?
public int?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public long?
public byte?
public byte?
public byte?
public byte?
public DateTime?
public DateTime?
public DateTime?
public DateTime?
public DateTime?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?
public string?

I've noticed if i remove a string it stops crashing but if i remove a byte it still crashes.
the exact object i'm serializing and deserializing is DataResponse<List<MainModel>>
and this is the class for it

[MemoryPackable]
public partial class DataResponse<T>
{
    public DataResponse(T data)
    {
        Data = data;
    }

    public T Data { get; set; }
    public long? Result { get; set; }
    public string? ResultText { get; set; }
}

it was working fine until I added two strings and two longs if I remove any of them it works but if I remove a byte it still crashes
the some of the fields have attributes [Display] and [JsonIgnore] and a custom attribute called [Order] I don't think it matters but I thought I should mention anyway

@neuecc
Copy link
Member

neuecc commented Sep 10, 2024

There have been reports of similar exceptions in dotnet/runtime, and it seems that they are being fixed each time.
I think it would be better to report this as a bug in the mono interpreter too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants