unity --reset crashes with NameError

Bug #774280 reported by Luke Plant
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Low
Didier Roche-Tolomelli
unity (Ubuntu)
Fix Released
Low
Unassigned
Natty
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: unity

1. install unity 3.8.14
2. run unity --reset
-> for people getting the crash, it shouldn't anymore (just not reset)

Running "unity --reset" results in a NameError crash.

I do not have the exact backtrace (I can get it if nescessary), but it was very short, and very obvious that it will happen if you look at the code:

http://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/tools/unity.cmake#L72

72 try:
73 current_profile_schema = client.get_schema("/apps/compizconfig-1/current_profile")
74 except GError, e:
75 print "WARNING: environment is incorrect: %s\nDid you just try to reset in a tty?" % e

There is a NameError on GError, since GError has not been imported. Some experimentation/googling suggests it should be glib.GError.

It seems that bug #753528 was never fixed at all, since this code was introduced to fix that bug (revision 1154.1.1) , but if it had been tested even once this issue would have been located (unless this was a caused by a bad merge and an import being lost)

Further, even when you fix that issue, you get another exception 2 lines later - something like "AttributeError: 'str' object has no attribute 'get_string'". I'm guessing this could be a change in what type of values are actually returned.

I had to change the line:
  if current_profile_gconfvalue.get_string() == 'unity':
to
  if current_profile_gconfvalue == 'unity':'

(I think this is bug 737320 - but the bug I'm reporting is different from that).

Then it finally worked.

Please note, in trying to reproduce this, I had some issues, I think related to whether unity was running or not. The primary issue that caused all this was unity failing to run or something (I ended up in a session with no interface at all, and had to google to try to work out a fix). So I can try to reproduce backtraces if you want, but it might be tricky, and just inspection of the code reveals the bug.

Revision history for this message
Luke Plant (spookylukey) wrote :

This bug is NOT a duplicate of bug #759744, despite the similarity, and has not been fixed by the fix committed for that bug - I've checked in the bzr branch and in the most recent download linked from that bug. Please remove the duplicate status. Thanks!

Changed in unity (Ubuntu):
status: New → Confirmed
Changed in unity:
status: New → Confirmed
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Luke, for some people current_profile_gconfvalue is a gconf value, for other it's a string name.
I'm really unsure why it's the case to be honest.

Some hints on that, (in which case the schema isn't installed) in this issue will be really appreciated, thanks :)

Revision history for this message
Luke Plant (spookylukey) wrote :

Didier,

I've had a little look, but I really don't know how this works - I know Python, but not gconf. I can confirm that the snippet of code that was returning a 'str' now seems to be returning a 'GConfValue'

I'm afraid I won't be able to debug this further, because:

1) I've found I can't stand Unity (no offence - each to his own etc, but the Ubuntu classic was serving me fine)
2) Running Unity has tended to change my non-Unity Compiz settings when I've tried it, and so I don't want to do any more experimenting.

I'm happy to execute some debugging commands if it will help, as long as don't mess up my existing settings, because I've had enough problems as it is.

Perhaps a simple "hasattr('get_string')" check would be a working, Pythonic solution until the issue is properly understood?

Thanks,

Luke

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

You're right about the hasattr thing, can be an easy workaround (and we are probably migrating to a gsettings backend next time). So let's go that way then! :-)

Changed in unity:
assignee: nobody → Didier Roche (didrocks)
milestone: none → 3.8.14
importance: Undecided → Low
Changed in unity (Ubuntu):
importance: Undecided → Low
Changed in unity:
status: Confirmed → Fix Committed
Changed in unity (Ubuntu):
status: Confirmed → Fix Committed
description: updated
Changed in unity:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 3.8.14-0ubuntu1

---------------
unity (3.8.14-0ubuntu1) oneiric; urgency=low

  * New upstream bug-fix release.
    - In a dual monitor setup with different resolutions, Unity places windows
      in the "dead zone" (LP: #752098)
    - Left pixel of launcher is not clickable on session start (LP: #758026)
    - unity crashed with AttributeError in reset_unity_compiz_profile(): 'str'
      object has no attribute 'get_string' (LP: #737320)
    - unity --reset crashes with NameError (LP: #774280)
    - Bottom icon on launcher tilts when it maybe shouldn't if icons fill
      launcher nearly exactly (LP: #728949)
    - Dodge active window - launcher should not show when modal dialog is
      opened (LP: #718185)
    - Unity maximizes windows that don't support resize on launch (LP: #769781)
    - compiz crashed with SIGSEGV in sigc::signal_base::impl() (LP: #762801)
    - inactive menus becomes brighter on sub-sequent clicks (LP: #733740)
    - Unity crashes when dynamic quicklist dbusmenu contains a hidden menuitem.
      (LP: #759174)
    - Opening quicklist with launcher keynav returns focus to previous window
      (LP: #750781)
    - window's title does not fade in the right position (LP: #722178)
  * debian/control:
    - depends on compiz for some people upgrading (LP: #773253)
  * debian/patches/01_add_scp_to_systray.patch:
    - remove, upstream now
 -- Didier Roche <email address hidden> Thu, 26 May 2011 17:41:14 +0200

Changed in unity (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted unity into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in unity (Ubuntu Natty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Pedro Villavicencio (pedro) wrote :

I've followed the test case and can confirm that it doesn't crash when doint a reset, marking this as verification-done, thanks all.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 3.8.14-0ubuntu1~natty1

---------------
unity (3.8.14-0ubuntu1~natty1) natty-proposed; urgency=low

  * New upstream bug-fix release.
    - In a dual monitor setup with different resolutions, Unity places windows
      in the "dead zone" (LP: #752098)
    - Left pixel of launcher is not clickable on session start (LP: #758026)
    - unity crashed with AttributeError in reset_unity_compiz_profile(): 'str'
      object has no attribute 'get_string' (LP: #737320)
    - unity --reset crashes with NameError (LP: #774280)
    - Bottom icon on launcher tilts when it maybe shouldn't if icons fill
      launcher nearly exactly (LP: #728949)
    - Dodge active window - launcher should not show when modal dialog is
      opened (LP: #718185)
    - Unity maximizes windows that don't support resize on launch (LP: #769781)
    - compiz crashed with SIGSEGV in sigc::signal_base::impl() (LP: #762801)
    - inactive menus becomes brighter on sub-sequent clicks (LP: #733740)
    - Unity crashes when dynamic quicklist dbusmenu contains a hidden menuitem.
      (LP: #759174)
    - Opening quicklist with launcher keynav returns focus to previous window
      (LP: #750781)
    - window's title does not fade in the right position (LP: #722178)
  * debian/control:
    - depends on compiz for some people upgrading (LP: #773253)
  * debian/patches/01_add_scp_to_systray.patch:
    - remove, upstream now
 -- Didier Roche <email address hidden> Thu, 26 May 2011 17:41:14 +0200

Changed in unity (Ubuntu Natty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.