Unity8 snap can't load the testability libraries

Bug #1657845 reported by Santiago Baldassin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity8 Session Snap
Fix Released
High
Unassigned
autopilot-qt (Ubuntu)
In Progress
Undecided
Unassigned
unity8 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

In order to introspect unity8, the testability libraries should be available. Such libraries are provided by autopilot-qt snap through a content interface called testability

unity8 snap should add a plug to such interface so that testability libraries get loaded

Related branches

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → Incomplete
Michał Sawicz (saviq)
Changed in unity8-session-snap:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Michael Terry (mterry) wrote :

OK, I've kicked off a snap build/upload for unity8 that adds a plug for this. But I'm not sure what the expectation is for actually using the content interface.

So I plug into the testability slot provided by autopilot-qt. Which gets mounted into $SNAP/testability/ -- so far so good.

But what's the expectation for using that? Add it to LD_LIBRARY_PATH in the snap's wrapper and load the testability library if that path has content?

I looked at ubuntu-calculator-app which also plugs into testability, but it doesn't seem to do anything special once plugged.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Hi Michael, $SNAP/testability/ should be added to LD_LIBRARY_PATH. QT loads the testability libraries if either the -testability command line argument is passed to QCoreApplication, or if the
QT_LOAD_TESTABILITY environment variable is set

Revision history for this message
Michael Terry (mterry) wrote :

The current edge store snap should be setting LD_LIBRARY_PATH (correctly, I hope). I had a hard time telling if the content interface mount was working as expected, so please let me know if it works as expected.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Hi Michael, I gave it a try and it is not working. The problem is that the path added to LD_LIBRARY_PATH does not seem to be ok.

./snappyenv:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/testability/usr/lib:$SNAP/testability/usr/lib/$ARCH:$SNAP/testability/usr/lib/$ARCH/mesa

In the snap that I installed, that is the path added and the path to be appended should be

$SNAP/testability/:$SNAP/testability/$ARCH:$SNAP/testability/$ARCH/mesa

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :
Revision history for this message
Michael Terry (mterry) wrote :

OK, good call. Try current edge store.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

it does look better but I'm not able to start a unity8 session. it seems that it's broken: https://launchpad.net/bugs/1661216

Revision history for this message
Michael Terry (mterry) wrote :

Should be better now.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

much better, now the libraries are present in the testability folder but I can't still introspect unity8.

phablet@ubuntu:~$ snap run --shell unity8-session
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

phablet@ubuntu:/home/phablet$ ls $SNAP/testability/
libautopilot_driver_qt4.so libautopilot_driver_qt4.so.1.0 libautopilot_driver_qt5.so libautopilot_driver_qt5.so.1.0 x86_64-linux-gnu
libautopilot_driver_qt4.so.1 libautopilot_driver_qt4.so.1.0.0 libautopilot_driver_qt5.so.1 libautopilot_driver_qt5.so.1.0.0

Just to give a little bit of more context, we are trying to introspect the unity8 process, so the unity8 process should load the testability libraries and it seems it is not doing it.

sudo cat /proc/U8PID/maps | awk '{print $6}' | grep '\.so' | sort | uniq shows that the testability libraries are not loaded

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

The testability libraries seemed to be loaded now and yet the introspection is not working. See the script attached

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Added more logs to autopilot-qt and there's something weird. The dbus registration is successfully completed but right after that a second attempt to load the library takes place and the registration to dbus can't be completed
https://pastebin.ubuntu.com/23953406/

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Taking a look at unity8 in the phone, where the introspection is actually working, u8 tries to load the library twice and the second attempt gets the registration error. I assumed that the object could not be registered because it was already registered. https://pastebin.ubuntu.com/23954187/

In the phone, the u8 introspection is working just fine

Revision history for this message
Michael Terry (mterry) wrote :

So in both the phone and the snap, the libraries get loaded twice. The first registration succeeds and the second fails.

But on the phone introspection works and with the snap, it doesn't. But we don't have clues as to why yet... :(

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

And it get's even more confusing. Switching to the deb version of unity8 in Zesty also work and the log output is exactly the same as the snap version

https://pastebin.ubuntu.com/23954748/

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

I've just tested the autopilot-qt snap with the deb version of unity8 and I was able to introspect it. I think that rules autopilot-qt out of the equation.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

It seems that unity8 is not registered to dbus in the snap version. While loged in the deb version I got this
gdbus introspect --session --dest=com.canonical.Unity8 --object-path /com/canonical/Autopilot/Introspectionnode /com/canonical/Autopilot/Introspection {
  interface com.canonical.Autopilot.Introspection {
    methods:
      GetState(in s piece,
               out a(sv) state);
      GetVersion(out s version);
    signals:
    properties:
  };

Within the snap version of u8, I got this:
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name com.canonical.Unity8 was not provided by any .service files

Listed all the names registered to the session bus and there's no unity8.

Revision history for this message
Michael Terry (mterry) wrote :

Agreed. I see similar (using desktop u8 snap). Looking into it...

Revision history for this message
Michael Zanetti (mzanetti) wrote :

using the autopilot-qt snap from the store, it doesn't work for me, because that snap is missing libqttestability.so.

Building an autopilot-qt snap from this branch [1] makes it work for me.

Running it with that, it works fine, I can call the autopilot interface on D-Bus:

$ qdbus com.canonical.Unity /com/canonical/Autopilot/Introspection GetVersion
1.4

[1] https://code.launchpad.net/~sbaldassin/autopilot-qt/adding_testability/+merge/316595

Revision history for this message
Michael Zanetti (mzanetti) wrote :

ok. fixes for unity8 and unity8-session-snap are relased (the LD_LIBRARY_PATH and testability interface stuff).

What's missing is releasing the linked branch for autopilot-qt.

Marking as fixed for unity8, added autopilot-qt as INPROGRESS

Changed in unity8 (Ubuntu):
status: Incomplete → Fix Released
Changed in unity8-session-snap:
status: Triaged → Fix Released
Changed in autopilot-qt (Ubuntu):
status: New → In Progress
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.