Cordova 2.8 plugin errors in Trusty

Bug #1270838 reported by Víctor R. Ruiz
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cordova Ubuntu
Fix Released
Critical
Robert Bruce Park

Bug Description

Apparently, Cordova 2.8 fails to load plugins in Trusty.

Version: 2.8.0+14.04.20131024.4-0ubuntu1

Test case:
- Install cordova-ubuntu-2.8 and cordova-ubuntu-tests
- Execute /usr/bin/cordova-ubuntu-2.8 /usr/share/cordova-ubuntu-tests/cordovamobilespec/www/ --desktop_file_hint=/usr/share/applications/cordova-ubuntu-tests.desktop
- Click to "Automatic tests"
- Click to "Run all tests"

Expected result:
- A page should appear to run all the tests

Actual result:
- The page is blank, just showing the "Back" link.

The console log display this errors:

Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/InAppBrowser.qml:18:9: QML Image: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/close.png
Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/CaptureWidget.qml:116:9: QML QQuickBorderImage: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/toolbar-right.png
Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/CaptureWidget.qml:85:13: QML Image: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/shoot.png
Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/CaptureWidget.qml:77:9: QML QQuickBorderImage: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/toolbar-middle.png
Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/CaptureWidget.qml:56:13: QML Image: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/back.png
Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/CaptureWidget.qml:47:9: QML QQuickBorderImage: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/toolbar-left.png
Warning: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/CaptureWidget.qml:27:5: QML Image: Cannot open: file:///usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/assets/microphone.png

Critical: Missing cordovaGetPluginInstances symbol in "/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so"

Critical: Unknown Plugin(s) ("com.cordova.App", "com.cordova.InAppBrowser", "com.cordova.Splashscreen", "com.cordova.Capture", "com.cordova.Globalization", "com.cordova.Media", "com.cordova.Contacts", "com.cordova.Camera", "com.cordova.Compass", "com.cordova.Connection", "com.cordova.Console", "com.cordova.Device", "com.cordova.Geolocation", "com.cordova.Events", "com.cordova.Accelerometer", "com.cordova.Notification", "com.cordova.File")

Related branches

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Blank screen at Automatic tests > Run all tests.

summary: - Plugin errors in Trusty
+ Cordova 2.8 plugin errors in Trusty
Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

$ ldd /usr/lib/cordova-ubuntu-2.8/libcoreplugins.so | grep "not found"
 libcordovaubuntuplugin.so => not found

Changed in cordova-ubuntu:
assignee: nobody → Robert Bruce Park (robru)
importance: Undecided → Critical
Revision history for this message
Robert Bruce Park (robru) wrote :

Confirmed, but I don't get the asset warnings. My console log looks like this instead:

$ /usr/bin/cordova-ubuntu-2.8 /usr/share/cordova-ubuntu-tests/cordovamobilespec/www/ --desktop_file_hint=/usr/share/applications/cordova-ubuntu-tests.desktop
Warning:
WARNING: This project is using the experimental QML API extensions for QtWebKit and is therefore tied to a specific QtWebKit release.
WARNING: The experimental API will change from version to version, or even be removed. You have been warned!

Critical: Missing cordovaGetPluginInstances symbol in "/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so"
Critical: Unknown Plugin(s) ("com.cordova.App", "com.cordova.InAppBrowser", "com.cordova.Splashscreen", "com.cordova.Capture", "com.cordova.Globalization", "com.cordova.Media", "com.cordova.Contacts", "com.cordova.Camera", "com.cordova.Compass", "com.cordova.Connection", "com.cordova.Console", "com.cordova.Device", "com.cordova.Geolocation", "com.cordova.Events", "com.cordova.Accelerometer", "com.cordova.Notification", "com.cordova.File")
Critical: Missing cordovaGetPluginInstances symbol in "/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so"
Critical: Unknown Plugin(s) ("com.cordova.App", "com.cordova.InAppBrowser", "com.cordova.Splashscreen", "com.cordova.Capture", "com.cordova.Globalization", "com.cordova.Media", "com.cordova.Contacts", "com.cordova.Camera", "com.cordova.Compass", "com.cordova.Connection", "com.cordova.Console", "com.cordova.Device", "com.cordova.Geolocation", "com.cordova.Events", "com.cordova.Accelerometer", "com.cordova.Notification", "com.cordova.File")
Critical: Missing cordovaGetPluginInstances symbol in "/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so"
Critical: Unknown Plugin(s) ("com.cordova.App", "com.cordova.InAppBrowser", "com.cordova.Splashscreen", "com.cordova.Capture", "com.cordova.Globalization", "com.cordova.Media", "com.cordova.Contacts", "com.cordova.Camera", "com.cordova.Compass", "com.cordova.Connection", "com.cordova.Console", "com.cordova.Device", "com.cordova.Geolocation", "com.cordova.Events", "com.cordova.Accelerometer", "com.cordova.Notification", "com.cordova.File")

Changed in cordova-ubuntu:
status: New → Confirmed
tags: added: html5-blocker
Revision history for this message
Daniel Holbach (dholbach) wrote :

Robert: which version of the package do you have installed? Is this with the 'arch: all' vs. 'arch: any' change landed?

Revision history for this message
Robert Bruce Park (robru) wrote :

$ apt-cache policy cordova-ubuntu-2.8
cordova-ubuntu-2.8:
  Installed: 2.8.0+14.04.20131024.4-0ubuntu1
  Candidate: 2.8.0+14.04.20131024.4-0ubuntu1

$ apt-get source cordova-ubuntu

$ egrep Package\|Architecture cordova-ubuntu*/debian/control
Package: cordova-ubuntu-2.8
Architecture: any
Package: qtdeclarative5-cordova-2.8-plugin
Architecture: any
Package: cordova-ubuntu-2.8-dev
Architecture: all
Package: cordova-ubuntu-2.8-examples
Architecture: all

This is the latest version released in Trusty, and there are no unreleased commits[0] at this time.

[0] https://code.launchpad.net/~cordova-ubuntu/cordova-ubuntu/2.8

Revision history for this message
David Barth (dbarth) wrote :

Hmm, on further inspection, this is a missing symbol, probably not caused by an arch issue, as Robert confirmed plugins where already marked as package 'any', ie arch-specific.

The culprit seems to be a missing libcordovau buntuplugin.so which is not installed anywhere indeed

The same .so is also absent from the Saucy build of cordova-ubuntu-2.8, but when testing with the saucy package, cordova-ubuntu-2.8 starts without blocking on the missing symbols.

So something in the build process or build dependencies of Cordova changed between saucy and trusty

Revision history for this message
David Barth (dbarth) wrote :

For ref. the saucy package is version: 2.8.0+13.10.20130917.1-0ubuntu1

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Echoing the general conclusion that it is probably not debian package arch related.
* I built and am running the ubuntu-html5-container pkg with arch: 'any' (amd64 sys)
* I also get the plugin config/missing message:
$ ubuntu-html5-app-launcher --www=.
[...]
Error loading plugins config!
Testing "/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so"
Missing cordovaGetPluginInstances symbol in "/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so"
[...]

Revision history for this message
Robert Bruce Park (robru) wrote :

I don't really understand what's going wrong here, but libcordovaubuntuplugin.so gets installed to /usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/libcordovaubuntuplugin.so.

I tried symlinking and copying the file to /usr/lib/cordova-ubuntu-2.8/ instead, but neither of those attempts worked. I get the same results and same console log when I try to launch cordovamobilespec.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

objdump -T /usr/lib/cordova-ubuntu-2.8/libcoreplugins.so | grep cordovaGetPluginInstances

?

Revision history for this message
Robert Bruce Park (robru) wrote :

$ objdump -T /usr/lib/cordova-ubuntu-2.8/libcoreplugins.so | grep cordovaGetPluginInstances
0000000000052120 g DF .text 0000000000002615 Base cordovaGetPluginInstances

Revision history for this message
Daniel Holbach (dholbach) wrote :

I ran the command through strace and it looks like it's not even looking for libcoreplugins.so

Do we know when this started happening?

Revision history for this message
Daniel Holbach (dholbach) wrote :

Maybe I looked at the wrong branches, but AFAICS this was introduced by this set of changes: http://paste.ubuntu.com/6831970/

It's the diff between current lp:cordova-ubuntu/2.8 and lp:~abreu-alexandre/cordova-ubuntu/expose-mainview

(Please correct me if I'm wrong.)

Revision history for this message
Daniel Holbach (dholbach) wrote :

Ignore my last comment.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Not sure if this is a red herring, but this happens during the build:

   dh_shlibdeps -O--parallel
        dpkg-shlibdeps -Tdebian/cordova-ubuntu-2.8.substvars debian/cordova-ubuntu-2.8/usr/bin/cordova-ubuntu-2.8 debian/cordova-ubuntu-2.8/usr/lib/co
rdova-ubuntu-2.8/libcoreplugins.so
dpkg-shlibdeps: warning: couldn't find library libcordovaubuntuplugin.so needed by debian/cordova-ubuntu-2.8/usr/lib/cordova-ubuntu-2.8/libcoreplugins
.so (ELF format: 'elf64-x86-64'; RPATH: '')
        dpkg-shlibdeps -Tdebian/qtdeclarative5-cordova-2.8-plugin.substvars debian/qtdeclarative5-cordova-2.8-plugin/usr/lib/x86_64-linux-gnu/qt5/qml/
CordovaUbuntu.2.8/libcordovaubuntuplugin.so

Available files during the build:
/obj-x86_64-linux-gnu/libcoreplugins.so
./obj-x86_64-linux-gnu/www/libcoreplugins.so
./debian/cordova-ubuntu-2.8/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so
./debian/tmp/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so

./obj-x86_64-linux-gnu/CordovaUbuntu.2.8/libcordovaubuntuplugin.so
./obj-x86_64-linux-gnu/libcordovaubuntuplugin.so
./debian/tmp/usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/libcordovaubuntuplugin.so
./debian/qtdeclarative5-cordova-2.8-plugin/usr/lib/x86_64-linux-gnu/qt5/qml/CordovaUbuntu.2.8/libcordovaubuntuplugin.so

Revision history for this message
Daniel Holbach (dholbach) wrote :

The build warning was the same in 2.8.0+13.10.20130904.2-0ubuntu1 and 2.8.0+13.10.20130917.1-0ubuntu1 too.

Revision history for this message
Daniel Holbach (dholbach) wrote :

I think I found the problem. We might be installing the .so files into the wrong places:

daniel@daydream:~/webapps/cordova-ubuntu/build-area/cordova-ubuntu-2.8.0+14.04.20131024.4$ ldd ./obj-x86_64-linux-gnu/libcoreplugins.so | grep cordovaubuntu
 libcordovaubuntuplugin.so => /home/daniel/webapps/cordova-ubuntu/build-area/cordova-ubuntu-2.8.0+14.04.20131024.4/obj-x86_64-linux-gnu/libcordovaubuntuplugin.so (0x00007f93d1593000)
daniel@daydream:~/webapps/cordova-ubuntu/build-area/cordova-ubuntu-2.8.0+14.04.20131024.4$ ldd ./debian/cordova-ubuntu-2.8/usr/lib/cordova-ubuntu-2.8/libcoreplugins.so | grep cordovaubuntu
 libcordovaubuntuplugin.so => not found
daniel@daydream:~/webapps/cordova-ubuntu/build-area/cordova-ubuntu-2.8.0+14.04.20131024.4$

Revision history for this message
Daniel Holbach (dholbach) wrote :

Ok. The last comment is a red herring too. In a saucy vm it works just fine, with

ldd /usr/lib/cordova-ubuntu-2.8/libcoreplugins.so | grep cordovaubuntu
 libcordovaubuntuplugin.so => not found

There is a "hidden dlopen" in cordova.cpp, initPlugins which might be more interesting.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Trusty amd64 (failing): http://paste.ubuntu.com/6833255/

Saucy i386 (succeeding): http://paste.ubuntu.com/6833258/

Revision history for this message
Daniel Holbach (dholbach) wrote :

Adding information from an email conversation. Alex Abreu says:

"So basically cordova pulls in some mangled symbols from 5.2 and tries to resolve them at runtime while being bound
to the 4.8 icu so libs."

"As you can see in the log:

_ZTIN6icu_528ByteSinkE

It it searching for a 5.2 mangled symbol ...

A "dpkg -L libicu-dev | grep .so$ | xargs objdump -T | grep _ZTIN6icu_528ByteSinkE" did indeed showed me that the symbol wasn't defined anywhere.

BUT, and here is the core of the issue, ICU being the backend for some Qt libs (all?) in terms of i8n it pulls the ICU version for which it was build for. so we end up w/:

alex:$ ldd /usr/lib/cordova-ubuntu-2.8/libcoreplugins.so | grep icu
libicui18n.so.48 => /usr/lib/x86_64-linux-gnu/libicui18n.so.48 (0x00007f5b4a6bb000)
libicuuc.so.48 => /usr/lib/x86_64-linux-gnu/libicuuc.so.48 (0x00007f5b4a34f000)
libicudata.so.48 => /usr/lib/x86_64-linux-gnu/libicudata.so.48 (0x00007f5b45492000)

but cordova-ubuntu-2.8 pulls "libicu-dev" as a build depends in its debian/control ... which is ICU 5.2 (unless I am mistaken)."

"Here is a small branch that remove direct icu references from cordova ...

https://code.launchpad.net/~abreu-alexandre/cordova-ubuntu/fix-icu-dev-version

I quickly tested the branch and it seems to work (no more undefined ref, & the symbol is revolved).

So from there:

*Some* of the missing plugin bits that I just removed (those part of cordova "globalization" API
that forced the direct usage of icu because they were not provided by QLocale) are in qt 5.2 (timezone & UTC offset apparently),
I haven't checked if all of them were there yet."

Revision history for this message
Daniel Holbach (dholbach) wrote :

Failing tests: http://paste.ubuntu.com/6837086/ (5 in navigator.contacts, 3 in navigator.globalization).

Revision history for this message
Robert Bruce Park (robru) wrote :

Confirmed, I see the same test failures as Daniel with alex's branch. But it's progress!

Changed in cordova-ubuntu:
status: Confirmed → Fix Committed
Changed in cordova-ubuntu:
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.