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

Assertion at..., condition '<disabled>' not met. #42628

Closed
CincySteve opened this issue Sep 16, 2020 · 47 comments
Closed

Assertion at..., condition '<disabled>' not met. #42628

CincySteve opened this issue Sep 16, 2020 · 47 comments
Assignees
Labels
area-Meta blocked Issue/PR is blocked on something - see comments blocking-release linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@CincySteve
Copy link

I just published to Azure a Blazor Wasm SPA I am developing with VS Community 2019. The app starts up successfully in Chrome via the VS debugger, but the published version triggers the exception below (also in Chrome). The exception message, _ gives me no clue as to the problem_. This looks similar to this previous issue dotnet/aspnetcore#16818 that has been fixed. I published 2-3 months ago a much simpler early version of the app, which functionally did what's described below, and it worked at that time.

Curiously, after I first published a few minutes ago, my console log messages indicated the app got through almost all of my main layout's OnInitializedAsync code, including a JSRuntime.InvokeAsync to my JavaScipt initialization code that opens an IndexedDB and returns its Index of keys. But when I tried re-publishing and got the same exception, none of my initialization code ran according to the console log. I can post my OnInitializedAsync code, but since the exception is now happening before any of this code executes, I'm not sure it will be helpful. Any idea what's going on?

Thanks. Steve

App Startup Exception

@mkArtakMSFT
Copy link
Member

Thanks for contacting us.
Can you try out .NET 5.0 RC1 SDK and see whether you will meet the same error or not?

@dantronik-bugreporting
Copy link

I am getting the same error with .NET 5.0 RC1. Here's the error message:
2020-09-17 10_16_30-Entwicklerwerkzeuge - IKON_2_0 - http___192 168 1 53_84_

@modulardev2
Copy link

modulardev2 commented Sep 17, 2020

Yep, same issue here. Only in the published version, everything works fine locally. Using RC1, worked fine with Preview 8.

@Bob-HL
Copy link

Bob-HL commented Sep 17, 2020

Same issue here with RC1

@modulardev2
Copy link

After messing with this for awhile today, I was able to fix it on my end using the following workaround, and I hope it can help someone else.

The culprit was the HttpClient.GetStringAsync method. I replaced for example:

await HttpClient.GetStringAsync(page)

with

await (await HttpClient.GetAsync(page)).Content.ReadAsStringAsync();

@Bob-HL
Copy link

Bob-HL commented Sep 18, 2020

After messing with this for awhile today, I was able to fix it on my end using the following workaround, and I hope it can help someone else.

The culprit was the HttpClient.GetStringAsync method. I replaced for example:

await HttpClient.GetStringAsync(page)

with

await (await HttpClient.GetAsync(page)).Content.ReadAsStringAsync();

It works. You saved my day. Thanks.

@ghost
Copy link

ghost commented Sep 22, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@dantronik-bugreporting
Copy link

dantronik-bugreporting commented Sep 22, 2020

@mkArtakMSFT Can auto-close on this issue be prevented? It's a valid issue and the original reporter not responding does not mean that no one else of us will.

Okay, seems like that already did it.

@CincySteve
Copy link
Author

CincySteve commented Sep 22, 2020

Sorry for being so slow to get back in. I installed .Net 5.0 RC1. I verified that I am using VS 16.8, but am not sure if there is some other verification required to confirm other 5.0 RC1 things installed. Anyway, assuming I have done what was necessary, after I re-published, the app still fails to start-up because of the same exception, while still running successfully under the debugger in VS.

I don't have the situation lertoo mentioned.

@CincySteve
Copy link
Author

CincySteve commented Sep 22, 2020

Ugh. I just started to run into this exception in the VS debugger, in both v16.7.4 and v16.8.0 Preview 3.0 (.Net 5.0 RC1). That means I am dead in the water until I can either find the cause or a workaround. I could sure use some help.

@CincySteve
Copy link
Author

CincySteve commented Sep 23, 2020

I have a couple other small Blazor apps that are not running into this exception. So there is something about my one app that's triggering it.

I have tried, without success:

  1. Shutting down VS (both the v16.7 and v16.8 versions) and restarting.
  2. Rebooting my computer.
  3. Removing all the markup from my Layout that's invoked by App.razor
  4. Removing all the startup logic in my javascript.
  5. Removing all the code in my Layout's OnInitializedAsync and OnAfterRender overrides.
  6. Doing 3-5 together (i.e. the app would do nothing)
  7. Removing both the Found and NotFound component references in App.razor

@mkArtakMSFT
Copy link
Member

Thanks for sharing details, everyone.
Can somebody please share a minimalistic repro project so we can root cause and address this? Thanks!

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Sep 23, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Diagnostics untriaged New issue has not been triaged by the area owner labels Sep 23, 2020
@ghost
Copy link

ghost commented Sep 23, 2020

Tagging subscribers to this area: @tommcdon, @krwq
See info in area-owners.md if you want to be subscribed.

@mkArtakMSFT
Copy link
Member

@eerhardt this seems to be caused by Linker

@ghost
Copy link

ghost commented Sep 23, 2020

Tagging subscribers to this area: @BrzVlad
See info in area-owners.md if you want to be subscribed.

@tommcdon tommcdon added arch-wasm WebAssembly architecture and removed area-System.Diagnostics labels Sep 23, 2020
@eerhardt
Copy link
Member

Looks like this assert is failing:

g_assert (new_val >= 0);

cc @lewing

@lewing
Copy link
Member

lewing commented Sep 23, 2020

@CincySteve do you have a test case we can use to reproduce this?

@lewing
Copy link
Member

lewing commented Sep 23, 2020

Does this still fail if you add

    <PublishTrimmed>false</PublishTrimmed> 

To your project file? The two biggest differences between release and debug are linked assemblies and interpreter optimizations and disabling linking is eliminates one of them. @BrzVlad have you had a chance to look at this?

@CincySteve
Copy link
Author

Unfortunately, the only app I have that experiences the problem is a fairly big one: 40+ components, 40+ significant c# classes, etc.

@CincySteve
Copy link
Author

@lewing I'm afraid I don't know what adding PublishTrimmed to my "project file" means. I tried to add it in several places, but it was not a recognizable component. Which specific project file do you mean?

@lewing
Copy link
Member

lewing commented Sep 24, 2020

@CincySteve in the blazor wasm specific csproj inside a property group.

@lewing
Copy link
Member

lewing commented Sep 24, 2020

@lertoo @modulardev2 if either of you have a reproduction you can share it would be very helpful.

@BrzVlad
Copy link
Member

BrzVlad commented Sep 24, 2020

@CincySteve While there is always the chance that something goes unexpectedly wrong somewhere, based on the stacktrace that you provided this is not a bug but rather a current limitation of the interpreter. The interpreter will fail to compile methods that are extremely large (it requires more than 32kb of local space) and this is the first situation where I hear of this happening. Fixing this is quite a bit of effort, so it wouldn't make it to 5.0. If you are over on the DotNetEvolution discord server, we can discuss it there in private and I can guide you to find which method fails to compile and confirm if this limitation is actually hit.

@lewing lewing removed the arch-wasm WebAssembly architecture label Sep 25, 2020
@lewing
Copy link
Member

lewing commented Sep 25, 2020

@SamMonoRT mono/linker doesn't have the labels, I'm not sure how it is usually handled?

This is blocking on dotnet/linker#1507

@lewing lewing added the linkable-framework Issues associated with delivering a linker friendly framework label Sep 25, 2020
@eerhardt eerhardt added the blocked Issue/PR is blocked on something - see comments label Sep 25, 2020
@SamMonoRT
Copy link
Member

@eerhardt - Leaving this open as a Blocked issue - Not an interpreter issue, update area label to area-Meta

@CincySteve
Copy link
Author

After a lot of digging and help from @BrzVlad , I have found that he was correct in diagnosing my problem (not necessarily the others) as a method that is too large. I load some data lists in Program.cs via calls to static class methods, one of which is very large. These classes are generated by a custom utility I wrote using external data sources. I'm not sure why this started to fail only recently (this code has been running for at least 2 months, which is why I didn't think about it). And of course, the Assertion exception is a mysterious symptom. Anyway, thanks once again to @BrzVlad.

vargaz added a commit to vargaz/mono that referenced this issue Sep 27, 2020
monojenkins pushed a commit to monojenkins/runtime that referenced this issue Sep 27, 2020
vargaz added a commit to mono/mono that referenced this issue Sep 28, 2020
vargaz added a commit that referenced this issue Sep 28, 2020
…rying to transform a method with too many locals. (#42797)

#42628.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
@eerhardt
Copy link
Member

Update - the underlying linker issue has been fixed and is being backported to 5.0. Once that is merged we should be able to close this issue.

@Anipik
Copy link
Contributor

Anipik commented Sep 28, 2020

@eerhardt is there any work required on the runtime side for this issue for rc2 or GA ?

@eerhardt
Copy link
Member

I don't believe so. To fix this we will need:

  1. The above linker change to be ported to the 5.0 branch.
  2. The new 5.0 linker to be merged into the dotnet/sdk 5.0 branch.

@marek-safar
Copy link
Contributor

The changes were backported to 5.0 GA branch and merged to dotnet/sdk

Thoorium added a commit to Thoorium/LiveDocs that referenced this issue Oct 13, 2020
@truthz03
Copy link

truthz03 commented Oct 14, 2020

Hi, I have updated to RC2 today but the error still is present.

The problem seems to be this line from a Nuget Package I'm using:
await Http.GetJsonAsync(ApiUrl + SearchTermParam(SearchTerm));

Is this Bug not fixed unit now?

The strange thing is that if I ran my application with VisualStudio and Debugging everything is working.
If I make a dotnet pusblish with "--configuration Debug" and create a docker container from the output to deploy it on my server this error occures.

@lewing
Copy link
Member

lewing commented Oct 14, 2020

@truthz03 RC2 was frozen before the fix went in. The fix will be part of 5.0 final.

@truthz03
Copy link

Ok. Thanks. Than I will wait for it

Thoorium added a commit to Thoorium/LiveDocs that referenced this issue Oct 21, 2020
* Word document (docx) conversion to html.
Update to .Net 5 Preview 8.

* Searchable word document.

* Update to .NET 5 RC1.

* Convert Word documents using WordLib.

* Rewrite Word document URLs

* Update to Net 5.0 RC2

* Fix to bypass an issue with publishing blazor applications.
See dotnet/runtime#42628 for more information.

* Update WordLib to 1.0.0-preview2.

* Update to WordLib 1.0.0-preview3.
Word multi-document message.
@joer33304
Copy link

This issue is NOT fixed. I upgrade to the latest 5 net 5 sdk. Works locally, error appears when deploying to azure on windows hosted app service.

@joer33304
Copy link

Just for others coming here, "false " works for me to get rid of the exception

@lewing
Copy link
Member

lewing commented Dec 7, 2020

@joer33304 can you please open a new issue with the details of the problem you are encountering?

@ghost ghost locked as resolved and limited conversation to collaborators Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta blocked Issue/PR is blocked on something - see comments blocking-release linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

No branches or pull requests