Mediascanner2 QML applications fail to start

Bug #1326753 reported by Andrew Hayzen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mediascanner2
Fix Released
Undecided
James Henstridge
mediascanner2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Hi

For the music-app [0] and an example mini app (to show it isn't the music-app causing the issue) [1] if you have a large library of tracks (I have ~3000, other people have seen the issue with ~900 on a device) the application fails to start with the following error:
terminate called after throwing an instance of 'std::runtime_error'
  what(): org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

I have attached the GDB output of running the music-app on the desktop to this bug report.

Note however, if I start a few processes which create a high load on the CPU, such as running dd if=/dev/zero of=/dev/null in a few terminals, the application starts fine.

0 - https://code.launchpad.net/~music-app-dev/music-app/use-mediascanner2.0
1 - https://code.launchpad.net/~andrew-hayzen/+junk/test-mediascanner2-crash

Related branches

Revision history for this message
Andrew Hayzen (ahayzen) wrote :
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

balloons tried to run the music-app with a blank /home and this dump [2] was created.

2 - http://paste.ubuntu.com/7595542/

Changed in mediascanner2:
status: New → Confirmed
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

test-mediascanner2-crash works on trusty for me..

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

Also tested the use-mediascanner2.0 on trusty desktop and it works for me too.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

For me and others...

This works on:
utopic mako touch ~350 tracks in library
utopic kvm desktop ~40 tracks in library

This does not work on:
trusty baremetal laptop ~3000 tracks in library
utopic mako touch ~900 tracks in library

It has been suggested that larger libraries are not being retrieved before a dbus timeout (1 second?) occurs.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

FYI if on a trusty machine you need to have the coreapps ppa [3] installed to get the latest version of mediascanner2.

$ apt-cache policy libmediascanner-2.0 mediascanner2.0 qtdeclarative5-ubuntu-mediascanner0.1
libmediascanner-2.0-0:
  Installed: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Candidate: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Version table:
 *** 0.101+14.10.20140530-0ubuntu1~ppa~trusty0 0
        500 http://ppa.launchpad.net/ubuntu-touch-coreapps-drivers/daily/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.100+14.04.20140403-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
libmediascanner-2.0-dev:
  Installed: (none)
  Candidate: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Version table:
     0.101+14.10.20140530-0ubuntu1~ppa~trusty0 0
        500 http://ppa.launchpad.net/ubuntu-touch-coreapps-drivers/daily/ubuntu/ trusty/main amd64 Packages
     0.100+14.04.20140403-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
mediascanner2.0:
  Installed: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Candidate: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Version table:
 *** 0.101+14.10.20140530-0ubuntu1~ppa~trusty0 0
        500 http://ppa.launchpad.net/ubuntu-touch-coreapps-drivers/daily/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.100+14.04.20140403-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
qtdeclarative5-ubuntu-mediascanner0.1:
  Installed: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Candidate: 0.101+14.10.20140530-0ubuntu1~ppa~trusty0
  Version table:
 *** 0.101+14.10.20140530-0ubuntu1~ppa~trusty0 0
        500 http://ppa.launchpad.net/ubuntu-touch-coreapps-drivers/daily/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     0.100+14.04.20140403-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

3 - https://launchpad.net/~ubuntu-touch-coreapps-drivers/+archive/daily

Revision history for this message
James Henstridge (jamesh) wrote :

I've proposed two mediascanner branches that should help here

1. the dbus-timeouts branch increases the time out value on the method calls to 10 seconds. That is probably way too long, but should help identify whether that is the cause of the missing method call replies.

2. the qml-exceptions branch adds try/catch blocks to the QML plugin to convert exceptions to warning messages, since the exceptions cause QML to terminate. This isn't perfect, since it doesn't provide a way to detect the error from QML, but should help in debugging the problem. Suggestions on a better way to report the errors are welcome.

I'd be interested in feedback on whether the dbus-timeout branch stops your app from terminating.

In one of the other branches I've been working on, I have adjusted the indexes in the database that should improve the performance of some of the list*() operations a bit. That branch will hopefully be landing today or tomorrow.

Revision history for this message
James Henstridge (jamesh) wrote :

Note that the output.zip file linked from each of these merge proposals includes armhf debs that can be tested out on device too, so you don't necessarily need to compile them there to test.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Just for people who have not read the comments in the merge proposals, the dbus-timeout branch didn't resolve the issue - all it did was extend the period of time before the application crashed. The qml-exceptions branch allowed the application to start, as the errors are now handled, however all models were empty and the following error was presented in the console multiple times.

Failed to retrieve songs list: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mediascanner2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mediascanner2 - 0.101+14.10.20140613-0ubuntu1

---------------
mediascanner2 (0.101+14.10.20140613-0ubuntu1) utopic; urgency=low

  [ Ubuntu daily release ]
  * debian/*symbols: auto-update new symbols to released version

  [ James Henstridge ]
  * Increase the timeout on D-Bus method calls. (LP: #1326753)
  * Catch exceptions in the QML plugin, and print a warning instead. QML
    applications terminate when C++ exceptions bubble up, which can not
    be recovered from. (LP: #1326753)
  * Add support for scanning photos using libexif. Adds libexif-dev as
    new build dependency. (LP: #1256334)
 -- Ubuntu daily release <email address hidden> Fri, 13 Jun 2014 06:22:32 +0000

Changed in mediascanner2 (Ubuntu):
status: Confirmed → Fix Released
Changed in mediascanner2:
assignee: nobody → James Henstridge (jamesh)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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