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

[GTK] Arch Linux crashing when Drawables are used #1914

Closed
Miepee opened this issue Mar 24, 2021 · 9 comments · Fixed by GtkSharp/GtkSharp#233 or #1924
Closed

[GTK] Arch Linux crashing when Drawables are used #1914

Miepee opened this issue Mar 24, 2021 · 9 comments · Fixed by GtkSharp/GtkSharp#233 or #1924
Labels
Milestone

Comments

@Miepee
Copy link
Contributor

Miepee commented Mar 24, 2021

Expected Behavior

Arch Linux shouldn't crash, and behave like other Linux distros.

Actual Behavior

Arch Linux crashes. Here's the stacktrace:

Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Gtk.Widget.DrawnSignalCallback(IntPtr inst, IntPtr arg0, IntPtr gch)
   at GLib.ExceptionManager.RaiseUnhandledException(Exception e, Boolean is_terminal)
   at Gtk.Widget.DrawnSignalCallback(IntPtr inst, IntPtr arg0, IntPtr gch)
   at Eto.GtkSharp.Forms.ApplicationHandler.Run()
   at Eto.Forms.Application.Run(Form mainForm)
   at etotest4.Gtk.MainClass.Main(String[] args)

Steps to Reproduce the Problem

  1. Create an Eto Project
  2. Create a drawable object, and assign it to currentForm.Content .
  3. Build for Linux-x64 and launch it on Arch Linux (based) distro.

Code that Demonstrates the Problem

This code is a slightly modified "Hello-World"/default-project in order to invoke the crash.

void InitializeComponent()
        {
            Title = "Hello World";
            MinimumSize = new Size(200, 200);
            Resizable = true;

            Drawable drawable = new Drawable();

            // This can be commented out, it's use is only to see that the drawable gets actually used. Behaviour is the same.
            drawable.Content = new Label() { Text = "Hello world!" };

            Content = drawable;

            var quitCommand = new Command { MenuText = "Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q };
            quitCommand.Executed += (sender, e) => Application.Instance.Quit();

            var aboutCommand = new Command { MenuText = "About..." };
            aboutCommand.Executed += (sender, e) => new AboutDialog().ShowDialog(this);

            // create menu
            Menu = new MenuBar
            {
                ApplicationItems =
                {
			// application (OS X) or file menu (others)
			new ButtonMenuItem { Text = "&Preferences..." },
                },
                QuitItem = quitCommand,
                AboutItem = aboutCommand
            };

        }

Specifications

  • Version: Eto.Forms 2.5.10, Eto.Platforms.Gtk 2.5.10
  • Platform(s): GTK
  • Operating System(s): Arch Linux (3 Different machines + VM).

Tested with .net Core 5 from both the Community repositories, from the Arch User Repositores (AUR) and from the prepackaged dotnet binaries from MS as well as just using the "self-contained"-option on compile.

I also tried compiling for ubuntu.18.04-x64 and arch-x64 instead of linux-x64, every one has the same result.

I tried both building it on other platforms and then transferring the compiled version to an Arch PC, as well as building it on an Arch PC instead.

@Miepee
Copy link
Contributor Author

Miepee commented Mar 24, 2021

Update after some investigation:
People that haven't updated their packages are actually able to still launch those applications, but everyone who updated some time in about the last two weeks just segfaults or crashes.
Not sure if this is an issue with how dotnet is now handled (they were moved recently to the community repositories instead of being in AUR), with GTK, or with how Eto interacts with those.

Other dotnet applications still run fine, only programs made using Eto crash.

Also, it seems like, not just drawables crash, but a whole lot of other stuff as well!? Can't really pinpoint anything exact though.

@cwensley
Copy link
Member

@Miepee thanks for reporting the issue! What version of .NET are you using? This sounds like it is possibly something that needs fixing in https://github.com/GtkSharp/GtkSharp, but I can't be 100% sure.

@Miepee
Copy link
Contributor Author

Miepee commented Mar 24, 2021

Latest dotnet, which at time of writing is 5.0.4 for runtime, SDK and targeting pack.
Host is at 5.0.2.

@Miepee
Copy link
Contributor Author

Miepee commented Mar 24, 2021

This sounds like it is possibly something that needs fixing in https://github.com/GtkSharp/GtkSharp, but I can't be 100% sure.

Maybe? I managed to get a new stacktrace which only differs in the last line:
at etotest4.Gtk.MainClass.Main(String[] args) in /home/narr/Dokumente/gitRepos/etotest4/etotest4/etotest4.Gtk/Program.cs:line 11

Which is for me new Application(Eto.Platforms.Gtk).Run(new MainForm());. So considering it even fails at just creating the GTK form, that seems likely to me at least.

@danielrparks
Copy link

danielrparks commented Mar 25, 2021

This crash is caused by updating glib2 from 2.66.7-1 to 2.68.0-1.

@Miepee
Copy link
Contributor Author

Miepee commented Mar 25, 2021

Are you sure it's not glib2 instead of glibc @danielrparks?
Someone of my testers has glibc at version 2.33-4, but glib2 at version 2.68.0-4.
Plus, in the OpenTabletDriver Issue that mentioned this issue, you were also talking about glib2 all the time, instead of glibc.

@danielrparks
Copy link

@Miepee You are correct, I meant glib2. Sorry about that.

@Miepee
Copy link
Contributor Author

Miepee commented Mar 25, 2021

Also we can confirm that.
By following the Arch Wiki instructions on how to downgrade packages, downgrading to glib2 2.66 is fine, while 2.68 crashes.

@danielrparks
Copy link

Fixed upstream in GtkSharp 3.24.24.32. Updating to GtkSharp 3.24.24.32 or later should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants