scope hangs on SearchMetadata::location(metadata)

Bug #1351477 reported by Kyle Nitzsche
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-scopes-api
Fix Released
Undecided
Unassigned
unity-scopes-api (Ubuntu)
Fix Released
Undecided
Unassigned
Utopic
Fix Committed
Undecided
Unassigned

Bug Description

Build 166.

Trying to use Location from the SearchMetadata passed to the Query, but the scope hangs:

Query::Query(CannedQuery const& query,\
                    SearchMetadata const& metadata,\
                    QString const& scopePath):
                        metadata_(metadata),
{
[...]
country = getCountry(metadata_);
}

QString RssQuery::getCountry(SearchMetadata md) {
    qDebug() << "======= BEFORE";
    unity::scopes::Location const &loc = md.location();
    qDebug() << "======== AFTER ";[...]
}

When I comment thelocation() line, the scope works and I see this in /home/phablet/.cache/upstart/scope-registry.log:
======= BEFORE
======== AFTER

With the line present, the scope hangs and I see only this:
======= BEFORE

Related branches

Revision history for this message
Michi Henning (michihenning) wrote :

Thanks for the bug report! When the process is hung, could you attach with gdb and forward the stack trace for all threads?

sudo gdb
attach <pid>
set logging on
t a a bt
set logging off

That'll put the stack trace into gdb.txt

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

Here's the stack trace under unity-scope-tool on desktop - thx.

Revision history for this message
Michi Henning (michihenning) wrote :

Looking at your stack trace, none of the stacks include your Query constructor. So, it doesn't look like the scope is hanging, rather, it looks like an exception was thrown by md.location() (which is what happens if no location data was sent by the client).

Can you put an exception handler for std::exception around the call and print the value of e.what() please?

I'll have a look at the code. At the very least, if this happens, we should leave a footprint of it behind.

Changed in unity-scopes-api:
assignee: nobody → Michi Henning (michihenning)
status: New → In Progress
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

It turns out that location awareness in a scope requires the scope's .ini file include this:
LocationDataNeeded = true

With that in place, it seems to be working, so i will close this bug.

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

Actually, I will not close it because if that is required it should be stated somewhere clearly in docs.

Revision history for this message
Michi Henning (michihenning) wrote :

Right. The linked branch improves on the situation with better documentation and by leaving a message in the registry log if a scope's implementation of a callback method throws.

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

Fix committed into lp:unity-scopes-api/devel at revision None, scheduled for release in unity-scopes-api, milestone Unknown

Changed in unity-scopes-api:
status: In Progress → Fix Committed
Changed in unity-scopes-api:
status: Fix Committed → Fix Released
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:unity-scopes-api/devel at revision 531, scheduled for release in unity-scopes-api, milestone Unknown

Changed in unity-scopes-api:
status: Fix Released → Fix Committed
Changed in unity-scopes-api (Ubuntu):
status: New → Fix Committed
Changed in unity-scopes-api (Ubuntu Utopic):
status: New → Fix Committed
Changed in unity-scopes-api (Ubuntu):
status: Fix Committed → Fix Released
Changed in unity-scopes-api:
assignee: Michi Henning (michihenning) → nobody
assignee: nobody → Michi Henning (michihenning)
status: Fix Committed → Fix Released
assignee: Michi Henning (michihenning) → nobody
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.