Skip to content

Crash report on version 0.88 (window_control.get_icon_pb(win) = None) #174

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

Closed
gabdub opened this issue May 1, 2019 · 10 comments
Closed

Comments

@gabdub
Copy link

gabdub commented May 1, 2019

After updating to version 0.88 I started receiving the following crash report:

PythonArgs: ['/usr/lib/mate-applets/mate-dock-applet/dock_applet.py']
Traceback:
 Traceback (most recent call last):
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2711, in view_opened
     self.window_added(the_app, object)
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2759, in window_added
     dock_app = self.match_bamf_app_to_dock_app(application)
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2653, in match_bamf_app_to_dock_app
     self.set_app_icon(dock_app, size)
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 3180, in set_app_icon
     pixbuf = pixbuf.scale_simple(icon_size * scale_factor, icon_size * scale_factor,
 AttributeError: 'NoneType' object has no attribute 'scale_simple'

I'm currently running Ubuntu Mate 19.04.
Seems like pixbuf = window_control.get_icon_pb(win) on dock.py @ 3178 is returning None.

@gabdub
Copy link
Author

gabdub commented May 1, 2019

I forgot to mention that I've only seen the crash at boot time.

@gabdub
Copy link
Author

gabdub commented May 1, 2019

Added if pixbuf is not None: @ line 3179 and the crash moved to:

PythonArgs: ['/usr/lib/mate-applets/mate-dock-applet/dock_applet.py']
Traceback:
 Traceback (most recent call last):
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2711, in view_opened
     self.window_added(the_app, object)
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2753, in window_added
     if application.get_desktop_file() is not None:
 AttributeError: 'NoneType' object has no attribute 'get_desktop_file'

@thefossilrecord
Copy link

Had the same crash (v0.88 GTK3 Ubuntu Mate 18.04.02) with pixbuf = window_control.get_icon_pb(win) but this was mid-session a while after boot time. I think the follow on crash after your patch is because application is not valid - looking at the code we're already in the state where dock_app is none so maybe it's not safe to assume the application is valid at that point too.

@gabdub
Copy link
Author

gabdub commented May 5, 2019

Yes, checking /var/crash I also have the crash long after boot time.
In every boot some hidden process triggers this issue in my system.

@thefossilrecord
Copy link

Documentation for Bamf.Matcher function get_application_for_window says it can return none. One possible fix for the secondary crash would be to add checks in to see whether the result obtained from the call to get_application_for_window returned none. This would stop the call into window_added with an empty application object. The code does do this for the call in window_removed but not for the other places it calls it.

@gabdub
Copy link
Author

gabdub commented May 12, 2019

I applied vkareh's patch #173 by hand and rebooted a couple of times and the crash at boot-time appears to be gone.

@gabdub
Copy link
Author

gabdub commented May 12, 2019

After another reboot, the second crash I reported appears again:

PythonArgs: ['/usr/lib/mate-applets/mate-dock-applet/dock_applet.py']
Traceback:
 Traceback (most recent call last):
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2711, in view_opened
     self.window_added(the_app, object)
   File "/usr/lib/mate-applets/mate-dock-applet/dock.py", line 2753, in window_added
     if application.get_desktop_file() is not None:
 AttributeError: 'NoneType' object has no attribute 'get_desktop_file'

@thefossilrecord
Copy link

In dock.py, you can search for:

the_app = matcher.get_application_for_window(object)
self.window_added(the_app, object)

and

the_app = matcher.get_application_for_window(object)
self.window_removed(the_app, object)

and change them to:

the_app = matcher.get_application_for_window(object)
if the_app is not None:
    self.window_added(the_app, object)
the_app = matcher.get_application_for_window(object)
if the_app is not None:
    self.window_removed(the_app, object)

and see if that improves things.

@gabdub
Copy link
Author

gabdub commented May 13, 2019

I added the two "ifs" and it's working well for now, I will continue testing it.

@gabdub
Copy link
Author

gabdub commented May 19, 2019

0 crash reports in a week!
I'll close the issue when patch #173 is applied and the two ifs are added.

robint99 added a commit that referenced this issue May 21, 2019
@gabdub gabdub closed this as completed Jun 5, 2019
savoury1 pushed a commit to savoury1/mate-dock-applet that referenced this issue Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants