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

Tmds.DBus.Protocol.DisconnectedException: Object reference not set to an instance of an object. on 11.1 #16662

Closed
MVKozlov opened this issue Aug 12, 2024 · 1 comment

Comments

@MVKozlov
Copy link

Describe the bug

I try build test Classic desktop app with Tray icon

This work ok

a bit later I want to use Tmds.DBus.Protocol package for my own dbus experiments and get core dump

Unhandled exception. Tmds.DBus.Protocol.DisconnectedException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Tmds.DBus.Protocol.MessageWriter.WriteRaw(String data) at Tmds.DBus.Protocol.MessageWriter.WriteStringCore(String s) at Tmds.DBus.SourceGenerator.VariantWriter.WriteDBusItem(MessageWriter& writer, DBusItem value) at Tmds.DBus.SourceGenerator.VariantWriter.WriteDBusVariant(MessageWriter& writer, DBusVariantItem value) at Tmds.DBus.SourceGenerator.WriterExtensions.WriteDictionary_aesv(MessageWriter& writer, Dictionary`2 values) at Tmds.DBus.SourceGenerator.OrgKdeStatusNotifierItem.<>c__DisplayClass22_0.g__Reply|13() at Tmds.DBus.SourceGenerator.OrgKdeStatusNotifierItem.HandleMethodAsync(MethodContext context) at Tmds.DBus.Protocol.DBusConnection.HandleMessages(Exception exception, Message message) --- End of inner exception stack trace --- at Tmds.DBus.Protocol.DBusConnection.MyValueTaskSource`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at Tmds.DBus.Protocol.DBusConnection.CallMethodAsync(MessageBuffer message) at Tmds.DBus.Protocol.Connection.CallMethodAsync(MessageBuffer message) at Avalonia.FreeDesktop.DBusTrayIconImpl.CreateTrayIcon() at System.Threading.Tasks.Task.<>c.b__128_0(Object state) at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore() at Avalonia.Threading.DispatcherOperation.Execute() at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job) at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback) at Avalonia.Threading.Dispatcher.Signaled() at Avalonia.X11.X11PlatformThreading.CheckSignaled() at Avalonia.X11.X11PlatformThreading.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 Test.Desktop.Program.Main(String[] args) in D:\Work\cs\Test\Test.Desktop\Program.cs:line 13 Aborted (core dumped)

To Reproduce

Take default trayicon example
https://docs.avaloniaui.net/docs/reference/controls/tray-icon
add latest stable Tmds.DBus.Protocol (0.19)

dotnet publish -c Release -r linux-x64 -o publish\linux --no-self-contained /p:PublishSingleFile=true

other publish types also tied, no success

Expected behavior

no core dump

Avalonia version

11.0.10-11.1.2

OS

Linux

Additional context

Ubuntu 22.04
Net 6.0
Tmds.DBus.Protocol 0.19
seems 0.17 and below are usable for 11.0.10
but on 11.1.2 it make core dump

@MVKozlov
Copy link
Author

MVKozlov commented Dec 3, 2024

Fixed in #15568

@MVKozlov MVKozlov closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants