-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 has a general limit of 64k for offsets and indexes #46622
Comments
Tagging subscribers to this area: @BrzVlad Issue DetailsWhen encountering a method with a large enough local space, the compiler will throw
|
@BrzVlad @javiercn I believe that I am currently running into this issue. The odd thing is that it doesn't occur when running locally on Chrome or Edge in Debug or Release mode, but occurs when the app is deployed. It also occurs locally and when deployed in Firefox. I'm currently looking for a workaround I can use and not to get this fixed in the runtime itself as I need a fix soon. My situation is that I'm running a Blazor WASM app with EntityFrameworkCore using this library. My migration is seeding information for U.S. counties for a lookup table, and therefore has thousands of insert statements like so: migrationBuilder.InsertData(
table: "CountyLookup",
columns: new[] { "CountyCode", "StateCode", "CountyName" },
values: new object[,]
{
{ 1, 1, "Autauga County" },
{ 3, 1, "Baldwin County" },
{ 5, 1, "Barbour County" }, I would prefer to keep this generated rather than manually providing an insert into script so that this data may be easily updated with future migrations (it's being built from another file). I've tried breaking it up into inserts of say 50 at a time rather than all at once, hoping that would reduce the amount of locals, but that didn't work.
|
What is the exact error that you are hitting ? Locals size too big ? |
If it would help at all, you can see it live here: snbicollector.com I'm happy to turn on verbose logging in the runtime if you could tell me how to do that. I can see in transform.c I could potentially get more info once that level of logging is enabled. |
Is there any chance I could get an isolated project for reproducing this ? |
Creating an isolated case is certainly a possibility, but would take some time to spin up. If you are potentially open to it, I'm fine with setting up a call and potentially sending over what I currently have to expedite the process. I could send you a meeting invite however you prefer (google meet, teams, etc), but I could send a teams invite to your gmail if that's good for you. If you'd prefer I send a different more open source repo for reproducibility, that would take some time and I'd have to focus on fixing my problem at hand first. |
Could you try adding in your wasm project |
@BrzVlad I kind of surprised myself and was able to set up a repo for reproducing the issue pretty quickly: https://github.com/Eddie-Hartman/LocalsSize |
I walked away from this for a while, but came back and tried to debug a bit more. I really don't understand the above. Adding that to my project file does not add additional logging. I also tried some other search results such as:
which didn't work either and: Please let me know how to proceed. |
The point of I can't run your sample because it fails with:
Could you share a folder publish of the sample ? |
Yeah when I added that it didn't seem to have any effect. It still failed. I emailed you an invite to a call if you'd like to join. I'm debugging the repo for reproducing the issue now to see if there is anything I can do to get that working for you. Weird that it runs just fine on my machine. |
Here is a zip of the publish: https://drive.google.com/file/d/1Hh2DiXgDGDOvpEPrvUJg2l5a7uCJW2h3/view?usp=sharing |
I was able to get a workaround working thanks to the devs in the discord in the webassembley channel. I had it broken up into different methods calls, but I needed to specifically do it like so: InsertCountyData1(migrationBuilder);
InsertCountyData2(migrationBuilder); Rather than having a method where I was passing the data in as arguments. Thanks to @vargaz @BrzVlad @lambdageek and @kg for your help! |
The culprit for the above scenario was indeed tiering, with untiered version not being able to properly compact the space for the locals. This scenario will be handled in the future by #94381. |
The interpreter instruction stream is an array of
ushort
. This data type is used to store most of the common data, from opcode, offsets, static data indexes etc. In some uncommon scenarios, for large methods, we can hit this limit.Unable to run method: locals size too big.
. Tests hitting this areJIT/jit64/opt/cse/HugeArray1
andJIT/Regression/JitBlue/GitHub_21990
ushort
(for exampleMINT_LDFLD
,MINT_STFLD
). Test hitting thisJIT/Regression/JitBlue/Runtime_34170
The text was updated successfully, but these errors were encountered: