[Bug 989819] Re: Make duplicate signature more specific for DBusException and OSError

Martin Pitt martin.pitt at ubuntu.com
Fri Apr 1 15:04:16 UTC 2016


Trusty backport of http://bazaar.launchpad.net/~apport-
hackers/apport/trunk/revision/3066 uploaded to the SRU review queue.

** Description changed:

  Looking through some db bug examples and saw some incorrect bug
  associations, one example
  
  "Traceback (most recent call last):
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
-     res = f(*args, **kwargs)
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
-     res = f(*args, **kwargs)
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1090, in on_combobox_locale_chooser_changed
-     self.writeUserFormats()
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
-     self.writeUserFormatsSetting(userFormats=code)
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
-     iface.SetFormatsLocale(macr['SYSLOCALE'])
-   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
-     return self._proxy_method(*args, **keywords)
-   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
-     **keywords)
-   File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
-     message, timeout)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
+     res = f(*args, **kwargs)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
+     res = f(*args, **kwargs)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1090, in on_combobox_locale_chooser_changed
+     self.writeUserFormats()
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
+     self.writeUserFormatsSetting(userFormats=code)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
+     iface.SetFormatsLocale(macr['SYSLOCALE'])
+   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
+     return self._proxy_method(*args, **keywords)
+   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
+     **keywords)
+   File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
+     message, timeout)
  DBusException: org.freedesktop.Accounts.Error.PermissionDenied: Not authorized"
  
  has been associated to
  https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/930785
  
  "Traceback (most recent call last):
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
-     res = f(*args, **kwargs)
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
-     res = f(*args, **kwargs)
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1081, in on_combobox_locale_chooser_changed
-     self.writeUserFormats()
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
-     self.writeUserFormatsSetting(userFormats=code)
-   File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
-     iface.SetFormatsLocale(macr['SYSLOCALE'])
-   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
-     return self._proxy_method(*args, **keywords)
-   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
-     **keywords)
-   File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
-     message, timeout)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
+     res = f(*args, **kwargs)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
+     res = f(*args, **kwargs)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1081, in on_combobox_locale_chooser_changed
+     self.writeUserFormats()
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
+     self.writeUserFormatsSetting(userFormats=code)
+   File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
+     iface.SetFormatsLocale(macr['SYSLOCALE'])
+   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
+     return self._proxy_method(*args, **keywords)
+   File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
+     **keywords)
+   File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
+     message, timeout)
  DBusException: org.freedesktop.Accounts.Error.Failed: 'bg_BG.UTF-8' is not a valid locale name"
  
+ The "functions signature" is the same, the exceptions are different
+ though, it should probably consider that as part of the signature
  
- The "functions signature" is the same, the exceptions are different though, it should probably consider that as part of the signature
+ SRU TEST CASE:
+ --------------
+  * Modify /usr/bin/pybuild to append these two lines right after "def main(cfg):"
+ 
+     raise OSError(99, 'some OS error')
+ 
+  * Now running "pybuild" will provoke an OSError, and you should get a
+ /var/crash/_usr_share_dh-python_pybuild.1000.crash
+ 
+  * With current apport, the crash signature looks like this, i. e. it
+ does not include the errno (99):
+ 
+   $ python3 -c 'import apport; r = apport.Report(); r.load(open("/var/crash/_usr_share_dh-python_pybuild.1000.crash", "rb")); print(r.crash_signature())'
+ /usr/share/dh-python/pybuild:OSError:/usr/share/dh-python/pybuild at 449:main
+ 
+  * With this apport update (you need to rm the .crash and re-generate
+ it), it will look like this instead:
+ 
+   /usr/share/dh-python/pybuild:OSError(99):/usr/share/dh-
+ python/pybuild at 449:main
+ 
+  i. e. the errno 99 will be used to disambiguate/duplicate the crash.
+ 
+ This works similarly for DBusErrors, but this is much harder to test
+ manually. The backported patch includes automatic test cases which cover
+ the DBusError cases, though.

** Changed in: apport (Ubuntu Trusty)
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/989819

Title:
  Make duplicate signature more specific for DBusException and OSError

Status in Daisy:
  Confirmed
Status in apport package in Ubuntu:
  Fix Released
Status in apport source package in Trusty:
  In Progress
Status in apport source package in Xenial:
  Fix Released

Bug description:
  Looking through some db bug examples and saw some incorrect bug
  associations, one example

  "Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1090, in on_combobox_locale_chooser_changed
      self.writeUserFormats()
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
      self.writeUserFormatsSetting(userFormats=code)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
      iface.SetFormatsLocale(macr['SYSLOCALE'])
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
      return self._proxy_method(*args, **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
      **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
      message, timeout)
  DBusException: org.freedesktop.Accounts.Error.PermissionDenied: Not authorized"

  has been associated to
  https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/930785

  "Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 62, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 74, in wrapper
      res = f(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 1081, in on_combobox_locale_chooser_changed
      self.writeUserFormats()
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py", line 775, in writeUserFormats
      self.writeUserFormatsSetting(userFormats=code)
    File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 71, in writeUserFormatsSetting
      iface.SetFormatsLocale(macr['SYSLOCALE'])
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in __call__
      return self._proxy_method(*args, **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
      **keywords)
    File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
      message, timeout)
  DBusException: org.freedesktop.Accounts.Error.Failed: 'bg_BG.UTF-8' is not a valid locale name"

  The "functions signature" is the same, the exceptions are different
  though, it should probably consider that as part of the signature

  SRU TEST CASE:
  --------------
   * Modify /usr/bin/pybuild to append these two lines right after "def main(cfg):"

      raise OSError(99, 'some OS error')

   * Now running "pybuild" will provoke an OSError, and you should get a
  /var/crash/_usr_share_dh-python_pybuild.1000.crash

   * With current apport, the crash signature looks like this, i. e. it
  does not include the errno (99):

    $ python3 -c 'import apport; r = apport.Report(); r.load(open("/var/crash/_usr_share_dh-python_pybuild.1000.crash", "rb")); print(r.crash_signature())'
  /usr/share/dh-python/pybuild:OSError:/usr/share/dh-python/pybuild at 449:main

   * With this apport update (you need to rm the .crash and re-generate
  it), it will look like this instead:

    /usr/share/dh-python/pybuild:OSError(99):/usr/share/dh-
  python/pybuild at 449:main

   i. e. the errno 99 will be used to disambiguate/duplicate the crash.

  This works similarly for DBusErrors, but this is much harder to test
  manually. The backported patch includes automatic test cases which
  cover the DBusError cases, though.

To manage notifications about this bug go to:
https://bugs.launchpad.net/daisy/+bug/989819/+subscriptions



More information about the foundations-bugs mailing list