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
Bugs, which is subscribed to 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.

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to