"QQmlExpression: Attempted to evaluate an expression in an invalid context" sometimes logged after deleting account - freezes system-settings.

Bug #1231729 reported by Mike McCracken
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Online Accounts setup for Ubuntu Touch
Fix Released
High
Alberto Mardegan
ubuntu-system-settings-online-accounts (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I have experienced the system-settings app getting frozen after deleting accounts on and off for a while.
I ignored it initially because I assumed it was due to incomplete state caused by my in-development provider plugin.
However, that plugin is now finished, and I'm still seeing the freezes and now I've confirmed that it occurs with other plugins.

I haven't been able to fully isolate this bug, but these steps reproduce it with some reliability (~75%):
this happens as often on the desktop as on the device.

1. Successfully create two accounts using the same provider (tested with ubuntuone and twitter).
(I'm not sure it has to be the same provider)
2. delete both.
sometimes, the UI will freeze after deleting the first, sometimes after deleting the second.

In every case where it does freeze, this error is logged just before it freezes:

QQmlExpression: Attempted to evaluate an expression in an invalid context

As comments, I'll post a few traces from running system-settings from the console on the desktop, with U1_DEBUG=1 loaded, which redirects QDebug() to stderr. (in case you're wondering where the output comes from).

Related branches

Revision history for this message
Mike McCracken (mikemc) wrote :
Download full text (13.5 KiB)

Here's an example where I launch system-settings, create two twitter accounts, and then delete one. It freezes after the deletion.

% U1_DEBUG=1 annotate-output system-settings
13:24:10 I: Started system-settings
13:24:10 E: unity::action::ActionManager::ActionManager(QObject*):
13:24:10 E: Could not determine application identifier. HUD will not work properly.
13:24:10 E: Provide your application identifier in $APP_ID environment variable.
13:24:10 E: file:///usr/lib/i386-linux-gnu/qt5/qml/Ubuntu/Components/ListItems/SingleControl.qml:59: Unable to assign [undefined] to bool
13:24:11 E: OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
13:24:11 E: libGL error: failed to load driver: vboxvideo
13:24:11 E: libGL error: Try again with LIBGL_DEBUG=verbose for more details.
13:32:39 E: virtual void OnlineAccounts::Plugin::registerTypes(const char*) Ubuntu.OnlineAccounts
13:32:40 E: WARNING: The 'gicon' image provider is deprecated and will be removed soon. Please use file:// urls for file icons, and the 'theme' image provider for themed icons (image://theme/iconname,fallback1,fallback2).
13:32:40 E: account-service-model.cpp 275 update
13:32:46 E: account.cpp 60 setObjectHandle Accounts::Account(0xb0e9120)
13:32:46 E: account-service.cpp 100 setObjectHandle Accounts::AccountService(0xb12bb18)
13:32:46 E: account-service-model.cpp 275 update
13:32:46 E: accountService role is deprecated, use accountServiceHandle
13:32:46 E: account-service.cpp 100 setObjectHandle Accounts::AccountService(0xb0a0088)
13:32:46 E: Authenticating...
13:32:46 E: ../../../../lib/SignOn/connection-manager.cpp 106 setupSocketConnection p2p error: QDBusError("org.freedesktop.DBus.Error.FileNotFound", "Failed to connect to socket /run/user/1000/signond/socket: No such file or directory") 1
13:32:46 E: ../../../../lib/SignOn/connection-manager.cpp 132 init Peer connection unavailable, activating service
13:32:46 E: ../../../../lib/SignOn/identityimpl.cpp 96 updateState Updating state: "PendingRegistration" SignOn::IdentityImpl(0xb09f938)
13:32:46 E: ../../../../lib/SignOn/identityimpl.cpp 172 storeCredentials Storing credentials
13:32:46 E: file:///usr/lib/i386-linux-gnu/qt5/qml/Ubuntu/Components/Page.qml:155: TypeError: Cannot read property 'actionManager' of null
13:32:46 E: ../../../../lib/SignOn/connection-manager.cpp 106 setupSocketConnection p2p error: QDBusError("org.freedesktop.DBus.Error.FileNotFound", "Failed to connect to socket /run/user/1000/signond/socket: No such file or directory") 1
13:32:46 E: ../../../../lib/SignOn/connection-manager.cpp 150 init Connected to "qt_default_session_bus"
13:32:46 E: ../../../../lib/SignOn/identityimpl.cpp 96 updateState Updating state: "Ready" SignOn::IdentityImpl(0xb09f938)
13:32:46 E: ../../../../lib/SignOn/identityimpl.cpp 96 updateState Updating state: "NeedsUpdate" SignOn::IdentityImpl(0xb09f938)
13:32:46 E: ../../../../lib/SignOn/identityimpl.cpp 96 updateState Updating state: "PendingUpdate" SignOn::IdentityImpl(0xb09f938)
13:32:46 E: ../../../../lib/SignOn/identityimpl.cpp 443 infoUpdated SERVER INFO UPDATED. NeedsUpdate " 0 "
13:32:47 E: ../../../../lib/S...

Alberto Mardegan (mardy)
Changed in ubuntu-system-settings-online-accounts:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Alberto Mardegan (mardy) wrote :

Thanks Mike, this was a bit tricky to solve. :-) The problem was that when the account was deleted it would be removed from the model, which would cause the Repeater to destroy the delegate, which could happen while the edit page was still shown.

I think I fixed it in the attached branch. I'd appreciate if you could test it, and you are also very welcome to review the merge proposal. :-)

Alberto Mardegan (mardy)
Changed in ubuntu-system-settings-online-accounts:
status: Confirmed → In Progress
Revision history for this message
Mike McCracken (mikemc) wrote :

Hi Alberto, I'm having problems installing this from source on my desktop saucy system.
following the 'qmake && make && sudo make install' steps ends up installing some things in root (/Ubuntu/* and /online-accounts/).

I dug through the qmake files a bit, and saw that it requires pkg-config info in the libsystemsettings-dev package, but installing that didn't seem to help.

How do you build & install it when testing?

Revision history for this message
Alberto Mardegan (mardy) wrote : Re: [Bug 1231729] Re: "QQmlExpression: Attempted to evaluate an expression in an invalid context" sometimes logged after deleting account - freezes system-settings.

On 10/07/2013 06:26 PM, Mike McCracken wrote:
> I dug through the qmake files a bit, and saw that it requires pkg-config
> info in the libsystemsettings-dev package, but installing that didn't
> seem to help.

It should, but maybe there are other dependencies.
I recommend you to first run

  sudo apt-get build-dep ubuntu-system-settings-online-accounts

So that all dependencies are all installed. Then you can build with just
qmake, but better run a "bzr clean-tree" first, in order to ensure that
all Makefiles get rebuilt.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-system-settings-online-accounts at revision 56, scheduled for release in ubuntu-system-settings-online-accounts, milestone Unknown

Changed in ubuntu-system-settings-online-accounts:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-system-settings-online-accounts - 0.2~+13.10.20131011-0ubuntu1

---------------
ubuntu-system-settings-online-accounts (0.2~+13.10.20131011-0ubuntu1) saucy; urgency=low

  [ Ken VanDine ]
  * Put the cancel button in a ListItem to ensure consistent spacing
    with other elements in system-settings.

  [ Andrew Starr-Bochicchio ]
  * Add loading indicator to OAuth page. (LP: #1235004)

  [ Alberto Mardegan ]
  * Delay destruction of the delegate until the edit page is popped Use
    ListView.delayRemove feature to delay the destruction of the
    delegate until we have removed the edit page from the stack. . (LP:
    #1231729)
  * Add a Cancel button to the OAuth authentication pages Use signon-
    ui's new X-PageComponent key to specify a QML page to be used. (LP:
    #1231691)
  * Close the WebView when the authentication is cancelled. (LP:
    #1231680)
  * AccountCreationPage: look for a "flickable" property from the
    plugin. (LP: #1221845)
  * Stop using deprecated gicon image provider .

  [ Ubuntu daily release ]
  * Automatic snapshot from revision 65
 -- Ubuntu daily release <email address hidden> Fri, 11 Oct 2013 08:47:24 +0000

Changed in ubuntu-system-settings-online-accounts (Ubuntu):
status: New → Fix Released
Revision history for this message
Alberto Mardegan (mardy) wrote :

This is happening again. Logged as bug 1315341.

Alberto Mardegan (mardy)
Changed in ubuntu-system-settings-online-accounts:
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.