-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
NRE in Compositor.RequestCompositionUpdate #15226
Comments
|
Ok thx for your quick responses. I will update to 11.0.10 first with the client that has the issues and ask him to run some usage tests. For context. The entire code base also runs on windows forms; with the same backend code. The controls are programmatically created and injected with a factory pattern in both winforms and avalonia projects. |
I am seeing this error when setting
Version 11.1.0-beta1 |
@arnirichard can you file a repo for that? could be a great help for debugging that |
@timunie I will do that but I will need to strip it, and the projects loads a few hundred MB of data, and is showing up to 100K items on the screen at once. I don't know how to replicate, but this happens much more often when my monitor is connected using HDMI than USB-C. When I connect to a monitor wirelessly, the application crashes almost immediately, so this is somehow related to the speed of monitor connector. |
@timunie This is my starter project using both PopUp and WriteableBitmap |
Note that you can zoom in using ctrl-mouse scroll and move with the mouse. That may trigger the bug. |
For what it's worth; i still can't replicate but did further investigate it. I did notice my stack trace above it a little different then Arnirichard's. The client that has it, it occurs sometimes. Just going from other software, back to the avalonia based interface and clicking with his mouse on a top label in our toolbar. (screenshot below of our toolbar which is a horizontal stackpanel with labels) I double checked all code; nothing works in other than the UI thread, setting properties. |
I tested this today on a wireless screen. I did not experience any problems seen before. The problem has changed from being related to WriteableBitmap to Popup. My guess the issue with WriteableBitmap got automatically resolved with a recent Avalonia upgrade. I will try next to debug with Avalonia's source code since the issue happens a few times each day. |
This is a strange one. There's nothing in
|
Could it be that |
@grokys @timunie @maxkatz6 When I look at I have tried to add my project to the Avalonia solution, and added direct references to respective Avalonia projects, but I can't build the project since |
Use src/Samples/Sandbox. Remember to adjust the namespaces in both XAML and CS file |
cc: @kekekeks |
I can prevent the crash by setting |
Any progress on getting a repro for this anyone? It's definitely something we need to fix, if we can understand what's going on. |
I tried arnirichard's repo but can't reproduce. Checked his code looking for things similar in our repo. Additionally we use a lot of custom drawing as well all over with SKia. Similar as Arnirichard's repo. The user that had the issue was having it frequently.. multiple times a day. I can't replicate it. Is anybody from the avalonia team able to look at RequestCompositionBatchCommitAsync() and arnirichard's suggestion question about this? |
If we can't reproduce on a simple sample, it's hard to go further here. In case a chat / debug session is needed or you want to add this issue to priority list, that's something for paid support only I'm afraid. That said imo Best bet is to add some more logging to your code and also.try.to reproduce on sandbox / simple sample. Maybe the user reporting that issue is willing to test some basic samples. |
Yep, we've looked and we can't see where the null is coming from...
The thing is, the only potential NRE comes from the |
I saw this stacktrace which might be more helpful
|
Now is the question of which border and why is the same border added to another popup? Is it something consumed from Resources to minimize code lines? |
The popup is just inside a
|
I am running my project from SandBox, this breakpoint catches the error _nextCommit is assigned to null before returning the method. In below, nextCommit1 is null, and nextCommit2 is not null If there is anything I can investigate using breakpoints, please say it. Edit: It seems the problem appears soon after closing a window. Stacktrace
> Avalonia.Base.dll!Avalonia.Rendering.Composition.Compositor.RequestCompositionBatchCommitAsync() Line 127 C#
Avalonia.Base.dll!Avalonia.Rendering.Composition.Compositor.RequestCommitAsync() Line 100 C#
Avalonia.Base.dll!Avalonia.Rendering.Composition.Compositor.RequestCompositionUpdate(System.Action action) Line 246 C#
Avalonia.Base.dll!Avalonia.Rendering.Composition.CompositingRenderer.QueueUpdate() Line 82 C#
Avalonia.Base.dll!Avalonia.Rendering.Composition.CompositingRenderer.AddDirty(Avalonia.Visual visual) Line 93 C#
Avalonia.Base.dll!Avalonia.Visual.InvalidateVisual() Line 378 C#
Avalonia.Controls.dll!Avalonia.Controls.TextBlock.InvalidateTextLayout() Line 687 C#
Avalonia.Controls.dll!Avalonia.Controls.TextBlock.OnPropertyChanged(Avalonia.AvaloniaPropertyChangedEventArgs change) Line 815 C#
Avalonia.Base.dll!Avalonia.AvaloniaObject.OnPropertyChangedCore(Avalonia.AvaloniaPropertyChangedEventArgs change) Line 703 C#
Avalonia.Base.dll!Avalonia.Animation.Animatable.OnPropertyChangedCore(Avalonia.AvaloniaPropertyChangedEventArgs change) Line 191 C#
Avalonia.Base.dll!Avalonia.AvaloniaObject.RaisePropertyChanged(Avalonia.AvaloniaProperty property, Avalonia.Data.Optional oldValue, Avalonia.Data.BindingValue newValue, Avalonia.Data.BindingPriority priority, bool isEffectiveValue) Line 754 C#
Avalonia.Base.dll!Avalonia.PropertyStore.EffectiveValue.SetAndRaiseCore(Avalonia.PropertyStore.ValueStore owner, Avalonia.StyledProperty property, string value, Avalonia.Data.BindingPriority priority, bool isOverriddenCurrentValue, bool isCoercedDefaultValue) Line 244 C#
The error happens after I close a window
|
Would it be possible to make this 'temporary' solution which apparently resolves the issue?
|
|
@arnirichard I'm not very deep into this area of Avalonia, however if I were you I'd file a draft PR to:
|
Thanks @timunie I can't make a PR without knowing more about the code. I will take a closer look and see what I can figure out. |
Describe the bug
A rare condition but occuring frequently (couple of times a day with full time usage with some users) at users of our software.
It's hard for me to figure out what is causing it as it's only avalonia stacktrace it seems.
Stack trace:
at Avalonia.Rendering.Composition.Compositor.RequestCompositionUpdate(Action action)
at Avalonia.Rendering.Composition.CompositingRenderer.AddDirty(Visual visual)
at Avalonia.Reactive.LightweightObservableBase
1.PublishNext(T value) at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty
1 property, Optional1 oldValue, BindingValue
1 newValue, BindingPriority priority, Boolean isEffectiveValue)at Avalonia.PropertyStore.EffectiveValue
1.SetAndRaiseCore(ValueStore owner, StyledProperty
1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue)at Avalonia.PropertyStore.EffectiveValue
1.SetAndRaise(ValueStore owner, IValueEntry value, BindingPriority priority) at Avalonia.PropertyStore.ValueStore.ReevaluateEffectiveValues(IValueEntry changedValueEntry) at Avalonia.PropertyStore.ValueStore.OnFrameActivationChanged(ValueFrame frame) at Avalonia.Styling.StyleInstance.Avalonia.Styling.Activators.IStyleActivatorSink.OnNext(Boolean value) at Avalonia.Styling.Activators.StyleActivatorBase.ReevaluateIsActive() at Avalonia.Styling.Activators.StyleClassActivator.Avalonia.Controls.IClassesChangedListener.Changed() at Avalonia.Controls.Classes.NotifyChanged() at Avalonia.Controls.Classes.Avalonia.Controls.IPseudoClasses.Remove(String name) at Avalonia.Input.InputElement.UpdatePseudoClasses(Nullable
1 isFocused, Nullable1 isPointerOver) at Avalonia.Input.InputElement.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.Controls.Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.Controls.ContentControl.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.Controls.Button.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change) at Avalonia.Input.InputElement.<>c.<.cctor>b__32_6(InputElement x, PointerEventArgs e) at Avalonia.Reactive.LightweightObservableBase
1.PublishNext(T value)at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
at Avalonia.Input.PointerOverPreProcessor.SetPointerOverToElement(IPointer pointer, IInputRoot root, IInputElement element, UInt64 timestamp, Point position, PointerPointProperties properties, KeyModifiers inputModifiers)
at Avalonia.Input.PointerOverPreProcessor.SetPointerOver(IPointer pointer, IInputRoot root, IInputElement element, UInt64 timestamp, Point position, PointerPointProperties properties, KeyModifiers inputModifiers)
at Avalonia.Input.PointerOverPreProcessor.OnNext(RawInputEventArgs value)
at Avalonia.Reactive.LightweightObservableBase
1.PublishNext(T value) at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg) at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken) at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl) at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action
1 lifetimeBuilder)at FAvalonia.Program.Launch(String[] args)
at FAvalonia.Do.Launch(String[] args)
at FAvaloniaLauncher.Program.Main(String[] args)
To Reproduce
We can't reproduce it ourselves.
I have however found other software (coincidentally also in 3d printing space) where users reported the same bug:
sn4k3/UVtools#797
This was an older report:
#13608
Expected behavior
No response
Avalonia version
11.0.9
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: