-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Shutter Not Launching On Ubuntu 24.04.1 #703
Comments
What happens if you run |
Let me know if you would like the full output. When running this command, I get a lot of text output, with an error and Shutter does not start. This is the error that displays: (shutter:240330): Wnck-WARNING **: 07:58:02.356: libwnck is designed to work in X11 only, no valid display found |
Full Ouput: |
I have the same using Shutter from the official 24.04 repos. I am guessing this is due to Wayland issues - https://pastebin.com/nFiC1Y4t |
I'm having this issue aswell |
Not launching or not launching at startup? |
Same here for Shutter from the official 24.04 repos |
same here for ubuntu 24.4.1 |
Workaround until update: Alias |
Did not seem to work: Terminal output
$ GDK_BACKEND=x11 shutter at /usr/bin/shutter line 9038. INFO: gathering system information... Linux framework 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Ubuntu 24.04.1 LTS \n \l Glib 1.3293 Glib built for 2.80.0, running with 2.80.0 Can't use an undefined value as an ARRAY reference at /usr/bin/shutter line 8326, line 19. |
I just installed Ubuntu 24.04.2 in a VM. Shutter from Ubuntu repos is still at 0.99.2 and has the crash on Wayland. However, when downloading Shutter 0.99.5 (note the new @DarthGandalf We really need Shutter to print its own version in the little system information report it prints at startup. |
Where did you get the new Shutter from? |
From the latest git: https://github.com/shutter-project/shutter/archive/refs/heads/master.zip |
@Photon89 sorry to ask.. how do you compile from the latest git? |
@afcuttin No worries! 😃 You don't, just unpack it and run from |
@Photon89 Do I need to install some Perl modules first? I tried |
Yes, it has a ton of dependencies. But you can install version 0.99.2 from Ubuntu's official repositories ( Thanks a lot for looking into my debug problem! 😃 |
@Photon89 Ok! But it is launching now. I installed the dependencies using cpanm. (Image::Magick and Goocanvas2 was most difficult to install). Since shutter is launching, it means that I am not able to reproduce this error, right? |
It is not 100% reproducible, unfortunately. But quite frequent, actually, at least for me. Maybe try to close or open some windows and relaunch Shutter to trigger the crash. Also, if you are using latest git, the crash won't appear, because I mitigated it in https://github.com/shutter-project/shutter/pull/696/files The crash is still present in the 0.99.5 release though. |
@Photon89 Sorry, so you solved this issue already? I thought it was related to https://stackoverflow.com/q/79137451/2173773 somehow 😄 Then how can I reproduce the error in the stackoverflow question? |
@hakonhagland Not actually solved. The current "solution" is to disable the window list functionality if the problematic array is undefined. But it would be better to find the underlying bug (probably in libwnck) such that the functionality would be there and not crashing Shutter any more. 😃 edit: You can reproduce it by using the latest release tarball instead of the git snapshot, for example: https://github.com/shutter-project/shutter/archive/refs/tags/v0.99.5.tar.gz |
Using the master branch, I set a breakpoint at Line 8458 in cdbb6ea
and I get a defined array like this:
As I understand, this is unexpected? I should instead get an empty array? |
Umm, possibly this is a launch where Shutter doesn't crash. If you continue from this breakpoint and Shutter starts and show its main window, than this is this case. It is not 100% reproducible even with the 0.99.5 release where the problematic code is in place. How can I set a breakpoint such that I can experiment with it myself? I can reproduce the crash with some probability at least. edit:
Sorry, my bad, of course, in the master branch Shutter won't crash, no matter if the array is empty or not... |
Do you mean this backtrace?
This often happens for me if I unapply the fix from #696 |
Yes, it's there. See the log |
@DarthGandalf Yes, exactly! It's actually #659 but since the same problem happened to @vadi2 here, the discussion shifted to here.
Missed it, my bad! |
@Photon89 You mean like this: |
@Photon89 Yes I was able to reproduce now:
I think we need to step into |
Nice!
Most probably! We cannot by chance get a backtrace including all relevant information from libwnck? 😄 I just tried to get something to help the libwnck dev as requested by him over at https://gitlab.gnome.org/GNOME/libwnck/-/issues/162 But I guess, it quickly grows over my head now! |
Actually, I think it is not the array that is undefined, but the screen itself
I can see that the screen is setup here: Line 8289 in cdbb6ea
|
Actually, I missed it because it wasn't there in the output posted by @DigitGram which indicates that he is using 0.99.2 from Ubuntu's repos which is known to crash under Wayland.
That's absolutely possible! Thanks for spending so much time for looking into it, I hope, you will be able to get a trace which helps to find the issue in libwnck. |
No, $wnck_screen is defined, but get_windows_stacked returns undefined, which was probably NULL on C side |
Though I cannot reproduce it anymore... I did it, then tried to add more debug output |
Even without #696? I can reproduce it quite frequently in an Ubuntu 24.04 VM... I had the impression that opening/closing windows triggers it. But maybe it's a placebo effect. |
Yeah, I unapplied the patch, and immediatelly reproduced it. Multiple times. But now I cannot again |
This minimal example: https://github.com/hakonhagland/perl-wnck-screen-debug gives segmentation fault on my machine |
Nice! I got the following backtrace from this minimal example:
Is this likely to be helpful for the libwnck dev? |
That's because you didn't initialize Gtk there. Or probably GIO or Glib instead of Gtk. Your script crashes for me, but this fixes it: diff --git a/p.pl b/p.pl
index b3c0239..e51d89a 100755
--- a/p.pl
+++ b/p.pl
@@ -11,6 +11,9 @@ BEGIN {
package => 'Wnck',
);
}
+
+use Gtk3 '-init';
+
my $wnck_screen = Wnck::Screen::get_default();
print Dumper( $wnck_screen );
|
It still crashes with the Gtk3 initialization, actually. |
@DarthGandalf Yes I think you are right :) Found this related info: https://gitlab.gnome.org/GNOME/libwnck/-/blob/master/doc/libwnck-docs.sgml#L109 |
Thinking about it, the error it spits is actually the well known error which we fixed in #611. So my question is: Why does initializing the screen work sometimes in Wayland, though it reproducibly failed in the line fixed by #611? edit: Why does it actually fail on initializing the screen already in the minimal example, while it doesn't fail on initializing the screen in Shutter (only fails later when iterating over the stacked windows array)? |
I think I made a mistake there. The programmed stopped in the debugger before Line 8458 in cdbb6ea
|
It is probably due to the fact that the crash is not 100% reproducible. Is there some "debugging Perl for dummies" text where I can learn how to set breakpoints and do what you guys are doing? I can actually reproduce the crash quite well. |
@Photon89 This video might provide a useful introduction to the perl debugger: https://www.youtube.com/watch?v=LtAGbUYTnR0 |
If we want to debug inside libwnck, gdb may be more useful than perl debugger. Something like |
@hakonhagland Thanks, I'm watching it now. @DarthGandalf I started with gdb as well, but unfortunately gdb doesn't give a backtrace with this crash. For some reason Shutter keeps running after the line which causes the problem, even prints some more line to the stdout before it exits completely, and gdb reports that there is no stack when trying to obtain a backtrace. See also https://stackoverflow.com/questions/79137451/how-to-get-a-backtrace-in-a-perl-script-on-a-not-so-fatal-error/79137681?noredirect=1 |
Maybe this can help us: https://metacpan.org/pod/Devel::GDB::Parser::Breakpoint |
@Photon89 Yes, I think so. Alternatively, we can use |
(Do you have a live chat somewhere to have a speedier debug session, maybe I can help at least from the perl side.) |
That would be great, everbody who is interested, please feel free to join to the #shutter IRC channel at libera.chat! |
Perhaps you just need
|
Regarding the actual comments:
|
oh yes. This way was good enough for the Gtk2->Gtk3 migration. https://github.com/shutter-project/shutter-rust should fix all of this, but it would be essentially new codebase, if ever finished that work at all |
See if this quick and dirty fixing of the shared variables works any better |
Woah, that's like magic! It works indeed and shows no "shared variables" warnings any more! Unfortunately, you worked with version 0.99.2, but I think, the changes should be easy to apply on latest git as well. I'll have a look into it! |
Created #709 which implements your changes! |
I think the fix I applied is not really appropriate as a real fix. Moving all the shared variables into the global scope is not that nice and makes the code harder to maintain. It should rather be a more curated fix. There are also some more errors in the modules themselves. I could try to do a better fix later today as a pull request. |
Brief summary of issue
Hello, since updating to Ubuntu 24.04.1 from 22.04.X, I cannot get Shutter to launch anymore.
Steps to reproduce the issue
Error output
No error, just nothing.
Extra information, such as Shutter version, display server in use (Xorg or Wayland), operating system and ideas for how to solve:
Laptop: ASUS ExpertBook B9450CEA
OS: Ubuntu 24.04.1 Wayland
Shutter: both 0.99.4 and 0.99.5
The text was updated successfully, but these errors were encountered: