question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.9.3] [Mac OS] SharpGen.Runtime.SharpGenException

See original GitHub issue

AvaloniaUI 0.93

OS is running under virtual machine:

macOS 10.13.6 (17G66)
Darwin 17.7.0

Got the following error when executing an application:

Unhandled exception. SharpGen.Runtime.SharpGenException: HRESULT: [0x80004005], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Unknown
   at SharpGen.Runtime.Result.CheckError()
   at Avalonia.Native.Interop.IAvnGlDisplay.CreateContext(IAvnGlContext share)
   at Avalonia.Native.GlPlatformFeature..ctor(IAvnGlDisplay display)
   at Avalonia.Native.AvaloniaNativePlatform.DoInitialize(AvaloniaNativePlatformOptions options)
   at Avalonia.Native.AvaloniaNativePlatform.Initialize(IntPtr factory, AvaloniaNativePlatformOptions options)
   at Avalonia.Native.AvaloniaNativePlatform.Initialize(AvaloniaNativePlatformOptions options)
   at Avalonia.AvaloniaNativePlatformExtensions.<>c__DisplayClass0_0`1.<UseAvaloniaNative>b__0()
   at Avalonia.Controls.AppBuilderBase`1.Setup()
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at PanelCreator.App.Program.Main(String[] args)
Abort trap: 6

Probably related to a commit 643217452896a0bfd1d037ce6af4fa3ffaa36b9c

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kekekekscommented, Feb 9, 2020

OSX doesn’t properly support OpenGL when running in virtual machines. We’ve been trying to use it anyway which caused various visual artifacts. You can disable OpenGL acceleration by adding .With(new AvaloniaNativePlatformOptions { UseGpu = false }) to your AppBuilder.

0reactions
VakhtinAndreycommented, Feb 9, 2020

There is another unhandled system exception. It appears after application was closed (ShutdownMode.OnMainWindowClose is used). MacOS error.txt

Here is a console output

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Avalonia.Native.WindowBaseImpl.Resize(Size clientSize)
   at Avalonia.Controls.Window.<.ctor>b__16_0(Size x)
   at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
   at System.Reactive.Sink`1.ForwardOnNext(TTarget value)
   at System.Reactive.Linq.ObservableImpl.Skip`1.Count._.OnNext(TSource value)
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
   at Avalonia.Reactive.AvaloniaPropertyObservable`1.PropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e)
   at Avalonia.AvaloniaObject.RaisePropertyChanged(AvaloniaProperty property, Object oldValue, Object newValue, BindingPriority priority)
   at Avalonia.Utilities.DeferredSetter`1.SetAndRaisePropertyChanged(AvaloniaObject source, AvaloniaProperty`1 property, TSetRecord& backing, TSetRecord value)
   at Avalonia.Utilities.DeferredSetter`1.SetAndNotify(AvaloniaObject source, AvaloniaProperty`1 property, TSetRecord& backing, TSetRecord value)
   at Avalonia.AvaloniaObject.SetAndRaise[T](AvaloniaProperty`1 property, T& field, T value)
   at Avalonia.Controls.TopLevel.set_ClientSize(Size value)
   at Avalonia.Controls.WindowBase.HandleResized(Size clientSize)
   at Avalonia.Controls.Window.HandleResized(Size clientSize)
   at Avalonia.Native.WindowBaseImpl.WindowBaseEvents.Avalonia.Native.Interop.IAvnWindowBaseEvents.Resized(AvnSize size)
   at Avalonia.Native.Interop.IAvnWindowBaseEventsShadow.IAvnWindowBaseEventsVtbl.Resized(IntPtr thisObject, Void* param0)
--- End of stack trace from previous location where exception was thrown ---
   at Avalonia.Native.PlatformThreadingInterface.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at PanelCreator.App.Program.Main(String[] args)
Abort trap: 6
Read more comments on GitHub >

github_iconTop Results From Across the Web

About the security content of macOS Monterey 12.6.3
This document describes the security content of macOS Monterey 12.6.3.
Read more >
Install .NET on macOS
In this article, you'll learn how to install .NET on macOS. .NET is made up of the runtime and the SDK. The runtime...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found