[Bug 1008898] Re: crash after inserting wireless password

Bug Watch Updater 1008898 at bugs.launchpad.net
Thu Jun 7 11:14:55 UTC 2012


Launchpad has imported 6 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=50740.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2012-06-05T16:50:56+00:00 Fabio Marconi wrote:

TEST CASE
1. Start an installation with Ubiquity on Hardware, without wired connection and with a Wifi Card
2. Proceed to Wireless setup page
3. Select a network
4. Enter password
5. Click on 'Connect'

ACTUAL RESULT:
Crash below

WORKAROUND:
Setup the Wifi connection from network-manager before starting Ubiquity

Jun 5 07:59:45 ubuntu ubiquity[3109]: Step_before = stepPrepare
Jun 5 07:59:45 ubuntu ubiquity[3109]: switched to page wireless
Jun 5 08:00:19 ubuntu ubiquity[3109]: Exception in GTK frontend (invoking crash handler):
Jun 5 08:00:19 ubuntu ubiquity[3109]: Traceback (most recent call last):
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py", line 1328, in on_next_clicked
Jun 5 08:00:19 ubuntu ubiquity[3109]: if ui.plugin_on_next_clicked():
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/ubiquity/plugins/ubi-wireless.py", line 134, in plugin_on_next_clicked
Jun 5 08:00:19 ubuntu ubiquity[3109]: self.nmwidget.connect_to_ap()
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/ubiquity/ubiquity/nm.py", line 443, in connect_to_ap
Jun 5 08:00:19 ubuntu ubiquity[3109]: self.view.connect_to_selection(passphrase)
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/ubiquity/ubiquity/nm.py", line 384, in connect_to_selection
Jun 5 08:00:19 ubuntu ubiquity[3109]: self.wifi_model.connect_to_ap(model[parent][0], ssid, passphrase)
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/ubiquity/ubiquity/nm.py", line 126, in connect_to_ap
Jun 5 08:00:19 ubuntu ubiquity[3109]: obj, dbus.ObjectPath(device), dbus.ObjectPath(saved_path))[1]
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
Jun 5 08:00:19 ubuntu ubiquity[3109]: **keywords)
Jun 5 08:00:19 ubuntu ubiquity[3109]: File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
Jun 5 08:00:19 ubuntu ubiquity[3109]: message, timeout)
Jun 5 08:00:19 ubuntu ubiquity[3109]: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "AddAndActivateConnection" with signature "a{sa{sv}}ss" on interface "(null)" doesn't exist
Jun 5 08:00:19 ubuntu ubiquity[3109]:
Jun 5 08:00:19 ubuntu ubiquity[3109]:
Jun 5 08:00:20 ubuntu ubiquity[3109]: log-output -t ubiquity /usr/share/apport/apport-gtk

Reply at: https://bugs.launchpad.net/python-dbus/+bug/1008898/comments/6

------------------------------------------------------------------------
On 2012-06-05T16:52:03+00:00 Fabio Marconi wrote:

Original report on Launchpad:
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1008898

Reply at: https://bugs.launchpad.net/python-dbus/+bug/1008898/comments/7

------------------------------------------------------------------------
On 2012-06-05T17:25:28+00:00 Stéphane Graber wrote:

To try and give a bit more background on what's going on here.

We have a piece of python called nm.py in the Ubuntu Installer that
talks over DBUS to Network Manager.

That piece of code was designed to work with both python2 and python3,
however we noticed that it completely fails on python3 because of
invalid signature.

The script can be found at: http://paste.ubuntu.com/1025375/
The workaround we applied is: http://paste.ubuntu.com/1025377/

Basically, with python2, the following:
self.manager.AddAndActivateConnection(obj, dbus.ObjectPath(device), dbus.ObjectPath(saved_path))

Would match the service signature of "a{sa{sv}}oo".

But the same code running with python3 doesn't as the objects appear to
get downcasted to strings, before checking for the existing signatures.

This obviously makes the program crash as "a{sa{sv}}ss" (python3) !=
"a{sa{sv}}oo" (service).

Reply at: https://bugs.launchpad.net/python-dbus/+bug/1008898/comments/8

------------------------------------------------------------------------
On 2012-06-05T17:55:07+00:00 Simon McVittie wrote:

(In reply to comment #0)
> Jun 5 08:00:19 ubuntu ubiquity[3109]: dbus.exceptions.DBusException:
> org.freedesktop.DBus.Error.UnknownMethod: Method "AddAndActivateConnection"
> with signature "a{sa{sv}}ss" on interface "(null)" doesn't exist

For D-Bus calls to be reliable, you should specify an interface (use
dbus_interface=... in the call, or call the method via a dbus.Interface
wrapper). I don't know whether that's what causes this signature
mismatch or not, though; it's just best-practice.

When you introspect the object represented by self.manager, what do you
get? (To find out, run "gdbus introspect --system -d
org.freedesktop.NetworkManager -o /org/freedesktop/NetworkManager -x",
assuming self.manager represents the /org/freedesktop/NetworkManager
object on org.freedesktop.NetworkManager on the system bus.) I get this,
among other things:

...
    <method name="AddAndActivateConnection">
      <arg name="connection" type="a{sa{sv}}" direction="in"/>
      <arg name="device" type="o" direction="in"/>
      <arg name="specific_object" type="o" direction="in"/>
      <arg name="path" type="o" direction="out"/>
      <arg name="active_connection" type="o" direction="out"/>
    </method>
...

Reply at: https://bugs.launchpad.net/python-dbus/+bug/1008898/comments/9

------------------------------------------------------------------------
On 2012-06-05T18:13:35+00:00 Simon McVittie wrote:

OK, so this is actually a combination of two things.

(In reply to comment #3)
> For D-Bus calls to be reliable, you should specify an interface (use
> dbus_interface=... in the call, or call the method via a dbus.Interface
> wrapper).

Because you didn't do this, dbus-python couldn't correlate the signature
of the method with the signature in the Introspect() result, and had to
guess what you meant. Normally that'd be OK, because you used ObjectPath
as a hint that you thought the service would expect object paths.

However, the signature-guessing function in dbus-python was broken for
ObjectPath and Signature objects under Python 3, because those objects
have changed from a subtype of the old meaning of str (= bytes) in
Python 2, to a subtype of the new meaning of str (= unicode) in Python
3. I've fixed that in git, I'll attach a patch here.

The precedence is:

* using dbus.SomeType (lowest)
* Introspect() result
* signature="..." (highest)

If dbus-python wasn't constrained by backwards-compatibility, the
signature would be required (like it is in GDBus), but unfortunately
that's not really an option.

Reply at: https://bugs.launchpad.net/python-
dbus/+bug/1008898/comments/10

------------------------------------------------------------------------
On 2012-06-05T18:14:10+00:00 Simon McVittie wrote:

Created attachment 62596
Py3: correctly guess the signature of ObjectPath(...) and  Signature(...)

Under Python 2, ObjectPath and Signature are subtypes of str (= bytes),
and the existing type-guessing worked.

The type-guessing code assumed that all unicode objects were just
strings, but that assumption became false in the Python 3 port:
ObjectPath and Signature are still subtypes of str, but str now means
unicode, not bytes.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50740

Reply at: https://bugs.launchpad.net/python-
dbus/+bug/1008898/comments/11


** Changed in: python-dbus
       Status: Unknown => Fix Released

** Changed in: python-dbus
   Importance: Unknown => High

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

Title:
  crash after inserting wireless password

Status in Python Dbus:
  Fix Released
Status in “ubiquity” package in Ubuntu:
  Fix Released
Status in “ubiquity” source package in Quantal:
  Fix Released

Bug description:
  TEST CASE
  1. Start an installation with Ubiquity on Hardware, without wired connection and with a Wifi Card
  2. Proceed to Wireless setup page
  3. Select a network
  4. Enter password
  5. Click on 'Connect'

  ACTUAL RESULT:
  Crash below

  WORKAROUND:
  Setup the Wifi connection from network-manager before starting Ubiquity

  Jun  5 07:59:45 ubuntu ubiquity[3109]: Step_before = stepPrepare
  Jun  5 07:59:45 ubuntu ubiquity[3109]: switched to page wireless
  Jun  5 08:00:19 ubuntu ubiquity[3109]: Exception in GTK frontend (invoking crash handler):
  Jun  5 08:00:19 ubuntu ubiquity[3109]: Traceback (most recent call last):
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py", line 1328, in on_next_clicked
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     if ui.plugin_on_next_clicked():
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/ubiquity/plugins/ubi-wireless.py", line 134, in plugin_on_next_clicked
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     self.nmwidget.connect_to_ap()
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/ubiquity/ubiquity/nm.py", line 443, in connect_to_ap
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     self.view.connect_to_selection(passphrase)
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/ubiquity/ubiquity/nm.py", line 384, in connect_to_selection
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     self.wifi_model.connect_to_ap(model[parent][0], ssid, passphrase)
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/ubiquity/ubiquity/nm.py", line 126, in connect_to_ap
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     obj, dbus.ObjectPath(device), dbus.ObjectPath(saved_path))[1]
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     **keywords)
  Jun  5 08:00:19 ubuntu ubiquity[3109]:   File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
  Jun  5 08:00:19 ubuntu ubiquity[3109]:     message, timeout)
  Jun  5 08:00:19 ubuntu ubiquity[3109]: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "AddAndActivateConnection" with signature "a{sa{sv}}ss" on interface "(null)" doesn't exist
  Jun  5 08:00:19 ubuntu ubiquity[3109]:
  Jun  5 08:00:19 ubuntu ubiquity[3109]:
  Jun  5 08:00:20 ubuntu ubiquity[3109]: log-output -t ubiquity /usr/share/apport/apport-gtk

  
  ProblemType: BugDistroRelease: Ubuntu 12.10
  Package: ubiquity 2.11.4
  ProcVersionSignature: Ubuntu 3.4.0-3.8-generic 3.4.0
  Uname: Linux 3.4.0-3-generic x86_64
  ApportVersion: 2.1.1-0ubuntu2
  Architecture: amd64
  CasperVersion: 1.317
  Date: Tue Jun  5 08:24:51 2012
  InstallCmdLine: file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash -- oem-config/enable=trueLiveMediaBuild: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120604.3)
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bashSourcePackage: ubiquity
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-dbus/+bug/1008898/+subscriptions




More information about the foundations-bugs mailing list