← Back to team overview

touch-packages team mailing list archive

[Bug 1494796] Re: /usr/lib/arm-linux-gnueabihf/unity-scopes/smartscopesproxy:smartscopesproxy: src/lib_json/json_value.cpp:1177: const Json::Value& Json::Value::operator[](const char*) const: Assertion `type_ == nullValue || type_ == objectValue' failed.

 

On the phone, we are using 0.6.0-rc2 of libjsoncpp. Looking at the git
repository, the assertion triggers if the node type is not objectValue:

JSON_ASSERT( type_ == nullValue  ||  type_ == objectValue );

The location of this assert matches the line number in the stack trace.

Later versions of libjsoncpp don't assert but throw an exception
instead. I suspect that's why we are seeing this only on the phone
because, on the desktop, we are using version 0.10.5.

In the get_node() overload for string, we have:

    if (!root_)
    {
        throw unity::LogicException("Current node is empty");
    }

    if (!root_.isMember(node_name))
    {
        throw unity::LogicException("Node " + node_name + " does not exist");
    }
    // ...

I'm pushing a branch that checks the node type before calling isMember()
and throws if the node type isn't objectValue. I expect that'll stop the
crash.

The question still is why we are trying to get a member from something
that isn't an object. Marcus, is this expected?

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unity-scopes-api in
Ubuntu.
https://bugs.launchpad.net/bugs/1494796

Title:
  /usr/lib/arm-linux-gnueabihf/unity-
  scopes/smartscopesproxy:smartscopesproxy:
  src/lib_json/json_value.cpp:1177: const Json::Value&
  Json::Value::operator[](const char*) const: Assertion `type_ ==
  nullValue || type_ == objectValue' failed.

Status in Canonical System Image:
  In Progress
Status in unity-scopes-api package in Ubuntu:
  Confirmed

Bug description:
  The Ubuntu Error Tracker has been receiving reports about a problem
  regarding unity-scopes-api.  This problem was most recently seen with
  version 0.6.19+15.04.20150724.3-0ubuntu1, the problem page at
  https://errors.ubuntu.com/problem/82f3407ea224db29041027eca65d23d17eb2027e
  contains more details.

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1494796/+subscriptions


References