Skip to content

Server-side blazor with rendering errors races and consumes all memory #13676

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

Closed
csharpfritz opened this issue Sep 4, 2019 · 6 comments
Closed
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.
Milestone

Comments

@csharpfritz
Copy link
Contributor

csharpfritz commented Sep 4, 2019

#12637 ```# Describe the bug
While working with a server-side blazor project, when a NullReference error happens inside the razor file, the server races and all memory is consumed. Consider the demo on video at: https://www.twitch.tv/videos/476717145?t=00h33m29s

To Reproduce

Steps to reproduce the behavior:

  1. Using ASP.NET Core 3 preview 8, build a simple server-side blazor application
  2. Reference a null object in the razor markup
  3. browse to that page
  4. wait while memory is consumed

Expected behavior

No extra memory consumption when a rendering error happens

Screenshots

https://www.twitch.tv/videos/476717145

Additional context

Error reported in JavaScript console is:

[2019-09-04T14:47:55.837Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at PixelBot.Orchestrator.Components.Pages.Configuration.BuildRenderTree(RenderTreeBuilder builder) in C:\dev\Quiltoni.PixelBot\PixelBot.Orchestrator\Components\Pages\Configuration.razor:line 14
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__5_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.Rendering.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.Rendering.Renderer.ProcessRenderQueue()
@csharpfritz csharpfritz added bug This issue describes a behavior which is not expected - a bug. area-blazor Includes: Blazor, Razor Components labels Sep 4, 2019
@csharpfritz
Copy link
Contributor Author

The project used in this video sample is at: https://github.com/csharpfritz/Quiltoni.PixelBot

@rynowak
Copy link
Member

rynowak commented Sep 4, 2019

would it be possible for you to collect a dump while this is happening?

@rynowak
Copy link
Member

rynowak commented Sep 4, 2019

We've seen issues like this internally a few times, but never with a repro - usually the issue has already been fixed by the time it's reported and triaged.

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Sep 4, 2019
@mkArtakMSFT mkArtakMSFT modified the milestones: 3.1.0-preview1, 3.0.0 Sep 4, 2019
@rynowak
Copy link
Member

rynowak commented Sep 20, 2019

Closing this as no repro. We were able to reproduce this one earlier previews, but I haven't been able to repro on a recent build.

@rynowak rynowak closed this as completed Sep 20, 2019
@TheCakeMonster
Copy link
Contributor

Not sure if this is relevant, but posting as an idea in case this is seen again in the future.

In this component, Jeff had an overriding OnInitializedAsync method. At the end of the method, he delegated to base.OnInitializedAsync, but without a return or await statement, which looked a bit odd. That's exactly what you'd do with a sync method, but it's not right with an async one is it?

	protected override async Task OnInitializedAsync()
	{
		/// Some code with an await
		await Task.Delay(20);

		base.OnInitializedAsync();
	}

@rynowak
Copy link
Member

rynowak commented Sep 23, 2019

Well spotted.

I don't think this could be the cause (unless this inherited from another component) because we intentionally leave the base methods on ComponentBase empty.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.
Projects
None yet
Development

No branches or pull requests

4 participants