Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jmespath::search() segfault on valid query #343

Closed
1 of 3 tasks
mtmorgan opened this issue Dec 14, 2021 · 17 comments · Fixed by microsoft/vcpkg#22774
Closed
1 of 3 tasks

jmespath::search() segfault on valid query #343

mtmorgan opened this issue Dec 14, 2021 · 17 comments · Fixed by microsoft/vcpkg#22774

Comments

@mtmorgan
Copy link
Contributor

Describe the bug

For this json

[
  {
    "name" : "foo", 
    "datasets" : [
      { "name" : "bar", "tissues" : [ { "label" : "baz" }] }
    ]
  },
  {
    "name" : "foo1", 
    "datasets" : [
      { "name" : "bar1", "tissues" : [ { "label" : "baz1" }] }
    ]
  }
]

the JMESpath query

[].{
    collection: name,
    dataset: datasets[].name,
    tissue: datasets[].tissue[*].label
}

should return a valid object, instead it segfaults with

jsoncons $ ./test
zsh: segmentation fault  ./test

Enumerate the steps to reproduce the bug

Here's a small program demonstrating this

#include <jsoncons/json.hpp>
#include <jsoncons_ext/jmespath/jmespath.hpp>

using namespace jsoncons; // for convenience

std::string data = R"(
    [{
      "name" : "foo", 
      "datasets" : [
        { "name" : "bar", "tissues" : [ { "label" : "baz" }] }
      ]
    },
    {
      "name" : "foo1", 
      "datasets" : [
        { "name" : "bar1", "tissues" : [ { "label" : "baz1" }] }
      ]
    }]
)";

int main()
{
    std::string path = R"(
        [].{
            collection: name,
            dataset: datasets[].name,
            tissue: datasets[].tissue[*].label
        }
    )";

    json j = json::parse(data);
    json result = jmespath::search(j, path);

    return 0;
}

compiled and executed as

/tmp/jsoncons $ g++ -std=c++14 -g -O0 -I /tmp/jsoncons/include -o test segfault.cpp
/tmp/jsoncons $ ./test
zsh: segmentation fault  ./test

Under lldb

(lldb) run
Process 5452 launched: '/tmp/jsoncons/test' (x86_64)
Process 5452 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x000000010000869c test`std::__1::vector<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::size(this=0x0005000100704e58 size=0) const at vector:656:46
   653
   654 	    _LIBCPP_INLINE_VISIBILITY
   655 	    size_type size() const _NOEXCEPT
-> 656 	        {return static_cast<size_type>(this->__end_ - this->__begin_);}
   657 	    _LIBCPP_INLINE_VISIBILITY
   658 	    size_type capacity() const _NOEXCEPT
   659 	        {return __base::capacity();}
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x000000010000869c test`std::__1::vector<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::size(this=0x0005000100704e58 size=0) const at vector:656:46
    frame #1: 0x0000000100012ece test`jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::size(this=0x0005000100704e50) const at json_container_types.hpp:137:52
    frame #2: 0x000000010000536c test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size(this=0x0000000100704c90) const at basic_json.hpp:2403:58
    frame #3: 0x00000001000053bd test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size(this=0x0000000100704e38) const at basic_json.hpp:2409:72
    frame #4: 0x000000010000b8db test`jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::destroy(this=0x0000000100704da0) at json_container_types.hpp:1217:36
    frame #5: 0x000000010000b7fc test`jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object(this=0x0000000100704da0) at json_container_types.hpp:647:13
    frame #6: 0x000000010000b7d5 test`jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object(this=0x0000000100704da0) at json_container_types.hpp:646:9
    frame #7: 0x000000010000b7b9 test`std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >::destroy(this=0x00007ffeefbff1c0, __p=0x0000000100704da0) at memory:1936:64
    frame #8: 0x000000010000b78d test`void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::__destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >((null)=std::__1::true_type @ 0x00007ffeefbff148, __a=0x00007ffeefbff1c0, __p=0x0000000100704da0) at memory:1798:18
    frame #9: 0x000000010000b75d test`void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(__a=0x00007ffeefbff1c0, __p=0x0000000100704da0) at memory:1635:14
    frame #10: 0x000000010000b712 test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::destroy(this=0x0000000100704d90) at basic_json.hpp:883:17
    frame #11: 0x000000010000b6b8 test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage(this=0x0000000100704d90) at basic_json.hpp:855:21
    frame #12: 0x000000010000b5a5 test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage(this=0x0000000100704d90) at basic_json.hpp:852:13
    frame #13: 0x00000001000046cd test`void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage>(this=0x0000000100704d90) at basic_json.hpp:1929:24
    frame #14: 0x00000001000045d6 test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_(this=0x0000000100704d90) at basic_json.hpp:1913:21
    frame #15: 0x0000000100004545 test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json(this=0x0000000100704d90) at basic_json.hpp:3126:14
    frame #16: 0x00000001000022c5 test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json(this=0x0000000100704d90) at basic_json.hpp:3125:9
    frame #17: 0x000000010004ae6b test`std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator(this=0x0000000100704ea8, __ptr=0x0000000100704d90)(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const at memory:2368:5
    frame #18: 0x000000010004ae2f test`std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(this=0x0000000100704ea8, __p=0x0000000000000000) at memory:2623:7
    frame #19: 0x000000010004adc9 test`std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr(this=0x0000000100704ea8) at memory:2577:19
    frame #20: 0x0000000100049945 test`std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr(this=0x0000000100704ea8) at memory:2577:17
    frame #21: 0x000000010004ad09 test`std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(this=0x00007ffeefbff538, __p=0x0000000100704ea8) at memory:1936:64
    frame #22: 0x000000010004acdd test`void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >((null)=std::__1::true_type @ 0x00007ffeefbff398, __a=0x00007ffeefbff538, __p=0x0000000100704ea8) at memory:1798:18
    frame #23: 0x000000010004acad test`void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(__a=0x00007ffeefbff538, __p=0x0000000100704ea8) at memory:1635:14
    frame #24: 0x000000010008e7eb test`std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(this=0x00007ffeefbff528, __new_last=0x0000000100704ea0) at vector:426:9
    frame #25: 0x000000010008e77b test`std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear(this=0x00007ffeefbff528) at vector:369:29
    frame #26: 0x000000010008e727 test`std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base(this=0x00007ffeefbff528) at vector:463:9
    frame #27: 0x000000010008e6f8 test`std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector(this=0x00007ffeefbff528 size=7) at vector:555:5
    frame #28: 0x000000010008e6c5 test`std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector(this=0x00007ffeefbff528 size=7) at vector:550:5
    frame #29: 0x000000010008e6a5 test`jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources(this=0x00007ffeefbff528) at jmespath.hpp:389:15
    frame #30: 0x000000010008d4e5 test`jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources(this=0x00007ffeefbff528) at jmespath.hpp:389:15
    frame #31: 0x000000010003ca43 test`jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(this=0x00007ffeefbff5f0, doc=0x00007ffeefbff830, ec=0x00007ffeefbff620) at jmespath.hpp:3371:13
    frame #32: 0x000000010000214c test`jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(doc=0x00007ffeefbff830, path=0x00007ffeefbff6f8) at jmespath.hpp:5163:28
    frame #33: 0x0000000100001915 test`main at segfault.cpp:32:19
    frame #34: 0x00007fff6a3b8cc9 libdyld.dylib`start + 1
    frame #35: 0x00007fff6a3b8cc9 libdyld.dylib`start + 1

What compiler, architecture, and operating system?

$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

What jsoncons library version?

  • Latest release 0.168.0
  • Other release ______
  • master
@mtmorgan mtmorgan added the Bug label Dec 14, 2021
@mtmorgan mtmorgan changed the title jmespath::search() segfault on valid query segfaults jmespath::search() segfault on valid query Dec 14, 2021
@danielaparker
Copy link
Owner

Thanks for the detailed report. I've added your test case to the JMESPath test suite, but was unable to reproduce the segfault on any of our test environments, instead I got the expected result (matches the online JMESPath evaluator on the JMESPath site)

[
    {
        "collection": "foo",
        "dataset": ["bar"],
        "tissue": []
    },
    {
        "collection": "foo1",
        "dataset": ["bar1"],
        "tissue": []
    }
]

I don't think the segfault is because of this specific query. Are you able to run any of the JMESPath examples from the jsoncons/jmespath page?

@mtmorgan
Copy link
Contributor Author

mtmorgan commented Dec 16, 2021

Thanks, i am able to run the examples on the jsoncons/jmespath page and have generally been using your library over the last several days without running into problems. Also, I can run my example on other platforms, so I guess this is something unique to my OS or configuration. I'll try to narrow this down but any suggestions welcome.

@danielaparker
Copy link
Owner

Okay, if you can make the example the simplest possible that still produces the segfault, that may help me identify what's happening.

@mtmorgan
Copy link
Contributor Author

I meant for the 'tissue/tissues' in the data and query to agree; the segfault occurs whether they do or not but the following has both as 'tissue'

A single object in the outer array [{...}] succeeds.

if there are two object [{...}, {...}], either [].{ collection:..., dataset:...} or [].{collection:..., tissue:...} succeeds.

And one weird observation:

#include <jsoncons/json.hpp>
#include <jsoncons_ext/jmespath/jmespath.hpp>

using jsoncons::json; 
namespace jmespath = jsoncons::jmespath;

int main()
{
    std::string data;
    std::string path;
    json j, result;

    path = R"(
        [].{
            collection: name,
            dataset: datasets[].name,
            tissue: datasets[].tissue[*].label
        }
    )";
    data = R"(
        [{
          "name" : "foo", 
          "datasets" : [
            { "name" : "bar", "tissue" : [ { "label" : "baz" }] }
          ]
        }]
    )";
    j = json::parse(data);
    result = jmespath::search(j, path);
    std::cout << pretty_print(result) << "\n\n";

    data = R"(
        [{
          "name" : "foo", 
          "datasets" : [
            { "name" : "bar", "tissue" : [ { "label" : "baz" }] }
          ]
        },
        {
          "name" : "foo1", 
          "datasets" : [
            { "name" : "bar1", "tissue" : [ { "label" : "baz1" }] }
          ]
        }]
    )";
    j = json::parse(data);
    result = jmespath::search(j, path);
    std::cout << pretty_print(result) << "\n\n";

    return 0;
}

succeeds (correct answer; no segfault)!

@danielaparker
Copy link
Owner

And one weird observation:

    std::string data;
    std::string path;
    json j, result;

    j = json::parse(data);
    result = jmespath::search(j, path);

Maybe not that weird. The stack trace does suggest an order of destruction issue, and these changes could affect that.

Could you do the following experiment? Declare data and path as before, I don't think they matter. Then try these combinations separately:

>     json j;
> 
>     j = json::parse(data);
>     json result = jmespath::search(j, path);
>     json result;
> 
>     json j = json::parse(data);
>     result = jmespath::search(j, path);

Thanks,
Daniel

@mtmorgan
Copy link
Contributor Author

Either order worked, including on repeated compilations / runs.

I tried to work back from the code in my second comment #343 (comment) to the code in my first #343 (comment).

I removed the first query, and moved the data outside main.

#include <jsoncons/json.hpp>
#include <jsoncons_ext/jmespath/jmespath.hpp>

using jsoncons::json; 
namespace jmespath = jsoncons::jmespath;

std::string data = R"(
        [{
          "name" : "foo", 
          "datasets" : [
            { "name" : "bar", "tissue" : [ { "label" : "baz" }] }
          ]
        },
        {
          "name" : "foo1", 
          "datasets" : [
            { "name" : "bar1", "tissue" : [ { "label" : "baz1" }] }
          ]
        }]
    )";

int main()
{
    std::string path;
    json j, result;
    
    path = R"(
        [].{
            collection: name,
            dataset: datasets[].name,
            tissue: datasets[].tissue[*].label
        }
    )";

    j = json::parse(data);
    result = jmespath::search(j, path);
    std::cout << pretty_print(result) << "\n\n";

    return 0;
}

and everything is fine. I don't like the data indentation and clean it up as

std::string data = R"(
    [{
      "name" : "foo", 
      "datasets" : [
        { "name" : "bar", "tissue" : [ { "label" : "baz" }] }
      ]
    },
    {
      "name" : "foo1", 
      "datasets" : [
        { "name" : "bar1", "tissue" : [ { "label" : "baz1" }] }
      ]
    }]
)";

and I am back to consistent segfaults.

Also, until this session I had thought this was deterministic -- either a segfault or not. But it seemed like I hit configurations (whether or not the three lines were commented out?) where it seemed like there were different behaviors for the same input. Honestly though I wasn't able to keep results straight.

@mtmorgan
Copy link
Contributor Author

mtmorgan commented Dec 17, 2021

... I realize this is a little quixotic without reproducibility on your end, so thanks for the patience. I'll confirm that the segfault is not consistent -- no segfaults this morning. I ran the segfaulting code from the previous comment under valgrind and offer the following but with caveats

  • valgrind on macOS isn't officially supported, but comes from a reputable source
  • the invalid reads reported by valgrind are always present, whether segfault or not, whenever the program contains jmespath::search().
  • valgrind on a fairly standard ubuntu docker does not show any problems
==65090== Memcheck, a memory error detector
==65090== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==65090== Using Valgrind-3.18.0.GIT-lbmacos and LibVEX; rerun with -h for copyright info
==65090== Command: ./test3-segfault
==65090==
==65090== Invalid read of size 1
==65090==    at 0x100005EFC: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::storage() const (basic_json.hpp:2346)
==65090==    by 0x100006C1B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2400)
==65090==    by 0x100006CAC: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2409)
==65090==    by 0x10000D1CA: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::destroy() (json_container_types.hpp:1217)
==65090==    by 0x10000D0EB: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:647)
==65090==    by 0x10000D0C4: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:646)
==65090==    by 0x10000D0A8: std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >::destroy(jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1936)
==65090==    by 0x10000D07C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::__destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::integral_constant<bool, true>, std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1798)
==65090==    by 0x10000D04C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1635)
==65090==    by 0x10000D001: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::destroy() (basic_json.hpp:883)
==65090==    by 0x10000CFA7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:855)
==65090==    by 0x10000CE94: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:852)
==65090==    by 0x100005FBC: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage>() (basic_json.hpp:1929)
==65090==    by 0x100005EC5: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_() (basic_json.hpp:1913)
==65090==    by 0x100005E34: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3126)
==65090==    by 0x100003634: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3125)
==65090==    by 0x10004C6FA: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Address 0x100b329f0 is 0 bytes inside a block of size 16 free'd
==65090==    at 0x10042491D: free (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x10004C706: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Block was alloc'd at
==65090==    at 0x100424545: malloc (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x1004F8DE9: operator new(unsigned long) (in /usr/lib/libc++abi.dylib)
==65090==    by 0x10004B0A7: std::__1::__unique_if<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::__unique_single std::__1::make_unique<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (memory:3033)
==65090==    by 0x100049CA6: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >* jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::create_json<jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (jmespath.hpp:457)
==65090==    by 0x10008ABA8: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3003)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x100056646: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::multi_select_hash::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3131)
==65090==    by 0x10004AE61: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::projection_base::apply_expressions(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:2749)
==65090==    by 0x10008AD50: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3024)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x10003E2AE: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3370)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==
==65090== Invalid read of size 8
==65090==    at 0x10001478C: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::value() const (basic_json.hpp:788)
==65090==    by 0x100006C53: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2403)
==65090==    by 0x100006CAC: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2409)
==65090==    by 0x10000D1CA: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::destroy() (json_container_types.hpp:1217)
==65090==    by 0x10000D0EB: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:647)
==65090==    by 0x10000D0C4: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:646)
==65090==    by 0x10000D0A8: std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >::destroy(jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1936)
==65090==    by 0x10000D07C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::__destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::integral_constant<bool, true>, std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1798)
==65090==    by 0x10000D04C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1635)
==65090==    by 0x10000D001: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::destroy() (basic_json.hpp:883)
==65090==    by 0x10000CFA7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:855)
==65090==    by 0x10000CE94: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:852)
==65090==    by 0x100005FBC: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage>() (basic_json.hpp:1929)
==65090==    by 0x100005EC5: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_() (basic_json.hpp:1913)
==65090==    by 0x100005E34: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3126)
==65090==    by 0x100003634: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3125)
==65090==    by 0x10004C6FA: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Address 0x100b329f8 is 8 bytes inside a block of size 16 free'd
==65090==    at 0x10042491D: free (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x10004C706: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Block was alloc'd at
==65090==    at 0x100424545: malloc (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x1004F8DE9: operator new(unsigned long) (in /usr/lib/libc++abi.dylib)
==65090==    by 0x10004B0A7: std::__1::__unique_if<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::__unique_single std::__1::make_unique<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (memory:3033)
==65090==    by 0x100049CA6: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >* jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::create_json<jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (jmespath.hpp:457)
==65090==    by 0x10008ABA8: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3003)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x100056646: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::multi_select_hash::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3131)
==65090==    by 0x10004AE61: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::projection_base::apply_expressions(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:2749)
==65090==    by 0x10008AD50: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3024)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x10003E2AE: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3370)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==
==65090== Invalid read of size 8
==65090==    at 0x100009F8C: std::__1::vector<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::size() const (vector:656)
==65090==    by 0x1000147BD: jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::size() const (json_container_types.hpp:137)
==65090==    by 0x100006C5B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2403)
==65090==    by 0x100006CAC: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2409)
==65090==    by 0x10000D1CA: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::destroy() (json_container_types.hpp:1217)
==65090==    by 0x10000D0EB: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:647)
==65090==    by 0x10000D0C4: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:646)
==65090==    by 0x10000D0A8: std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >::destroy(jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1936)
==65090==    by 0x10000D07C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::__destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::integral_constant<bool, true>, std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1798)
==65090==    by 0x10000D04C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1635)
==65090==    by 0x10000D001: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::destroy() (basic_json.hpp:883)
==65090==    by 0x10000CFA7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:855)
==65090==    by 0x10000CE94: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:852)
==65090==    by 0x100005FBC: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage>() (basic_json.hpp:1929)
==65090==    by 0x100005EC5: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_() (basic_json.hpp:1913)
==65090==    by 0x100005E34: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3126)
==65090==    by 0x100003634: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3125)
==65090==    by 0x10004C6FA: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Address 0x100b32a50 is 16 bytes inside a block of size 32 free'd
==65090==    at 0x10042491D: free (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x1000057D4: std::__1::_DeallocateCaller::__do_call(void*) (new:334)
==65090==    by 0x1000057B8: std::__1::_DeallocateCaller::__do_deallocate_handle_size(void*, unsigned long) (new:292)
==65090==    by 0x100005790: std::__1::_DeallocateCaller::__do_deallocate_handle_size_align(void*, unsigned long, unsigned long) (new:262)
==65090==    by 0x100005764: std::__1::__libcpp_deallocate(void*, unsigned long, unsigned long) (new:340)
==65090==    by 0x10001558C: std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::deallocate(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >*, unsigned long) (memory:1872)
==65090==    by 0x100006514: std::__1::allocator_traits<std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::deallocate(std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >&, jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >*, unsigned long) (memory:1594)
==65090==    by 0x10000645C: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::destroy() (basic_json.hpp:730)
==65090==    by 0x1000063E7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::~array_storage() (basic_json.hpp:767)
==65090==    by 0x1000063A4: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::~array_storage() (basic_json.hpp:764)
==65090==    by 0x100005F8C: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage>() (basic_json.hpp:1929)
==65090==    by 0x100005EB7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_() (basic_json.hpp:1910)
==65090==    by 0x100005E34: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3126)
==65090==    by 0x100003634: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3125)
==65090==    by 0x10004C6FA: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Block was alloc'd at
==65090==    at 0x100424545: malloc (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x1004F8DE9: operator new(unsigned long) (in /usr/lib/libc++abi.dylib)
==65090==    by 0x100004F58: std::__1::__libcpp_allocate(unsigned long, unsigned long) (new:253)
==65090==    by 0x100009C72: std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::allocate(unsigned long, void const*) (memory:1869)
==65090==    by 0x100009BB0: std::__1::allocator_traits<std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::allocate(std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >&, unsigned long) (memory:1586)
==65090==    by 0x100021E85: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::create<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&>(std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&) (basic_json.hpp:714)
==65090==    by 0x100021E57: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::array_storage(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&, jsoncons::semantic_tag) (basic_json.hpp:736)
==65090==    by 0x100021DF3: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::array_storage(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&, jsoncons::semantic_tag) (basic_json.hpp:735)
==65090==    by 0x100021DB6: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::construct<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage, jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >, jsoncons::semantic_tag&>(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >&&, jsoncons::semantic_tag&) (basic_json.hpp:1923)
==65090==    by 0x100021D40: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::basic_json(jsoncons::json_array_arg_t, jsoncons::semantic_tag, std::__1::allocator<char> const&) (basic_json.hpp:2914)
==65090==    by 0x100021CF6: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::basic_json(jsoncons::json_array_arg_t, jsoncons::semantic_tag, std::__1::allocator<char> const&) (basic_json.hpp:2913)
==65090==    by 0x10004B0E5: std::__1::__unique_if<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::__unique_single std::__1::make_unique<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (memory:3033)
==65090==    by 0x100049CA6: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >* jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::create_json<jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (jmespath.hpp:457)
==65090==    by 0x10008ABA8: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3003)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x100056646: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::multi_select_hash::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3131)
==65090==    by 0x10004AE61: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::projection_base::apply_expressions(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:2749)
==65090==    by 0x10008AD50: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3024)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x10003E2AE: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3370)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==
==65090== Invalid read of size 8
==65090==    at 0x100009F90: std::__1::vector<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::size() const (vector:656)
==65090==    by 0x1000147BD: jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::size() const (json_container_types.hpp:137)
==65090==    by 0x100006C5B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2403)
==65090==    by 0x100006CAC: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::size() const (basic_json.hpp:2409)
==65090==    by 0x10000D1CA: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::destroy() (json_container_types.hpp:1217)
==65090==    by 0x10000D0EB: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:647)
==65090==    by 0x10000D0C4: jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>::~json_object() (json_container_types.hpp:646)
==65090==    by 0x10000D0A8: std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >::destroy(jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1936)
==65090==    by 0x10000D07C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::__destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::integral_constant<bool, true>, std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1798)
==65090==    by 0x10000D04C: void std::__1::allocator_traits<std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> > >::destroy<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >(std::__1::allocator<jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void> >&, jsoncons::json_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, void>*) (memory:1635)
==65090==    by 0x10000D001: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::destroy() (basic_json.hpp:883)
==65090==    by 0x10000CFA7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:855)
==65090==    by 0x10000CE94: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage::~object_storage() (basic_json.hpp:852)
==65090==    by 0x100005FBC: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::object_storage>() (basic_json.hpp:1929)
==65090==    by 0x100005EC5: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_() (basic_json.hpp:1913)
==65090==    by 0x100005E34: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3126)
==65090==    by 0x100003634: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3125)
==65090==    by 0x10004C6FA: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Address 0x100b32a48 is 8 bytes inside a block of size 32 free'd
==65090==    at 0x10042491D: free (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x1000057D4: std::__1::_DeallocateCaller::__do_call(void*) (new:334)
==65090==    by 0x1000057B8: std::__1::_DeallocateCaller::__do_deallocate_handle_size(void*, unsigned long) (new:292)
==65090==    by 0x100005790: std::__1::_DeallocateCaller::__do_deallocate_handle_size_align(void*, unsigned long, unsigned long) (new:262)
==65090==    by 0x100005764: std::__1::__libcpp_deallocate(void*, unsigned long, unsigned long) (new:340)
==65090==    by 0x10001558C: std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::deallocate(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >*, unsigned long) (memory:1872)
==65090==    by 0x100006514: std::__1::allocator_traits<std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::deallocate(std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >&, jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >*, unsigned long) (memory:1594)
==65090==    by 0x10000645C: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::destroy() (basic_json.hpp:730)
==65090==    by 0x1000063E7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::~array_storage() (basic_json.hpp:767)
==65090==    by 0x1000063A4: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::~array_storage() (basic_json.hpp:764)
==65090==    by 0x100005F8C: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::destroy_var<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage>() (basic_json.hpp:1929)
==65090==    by 0x100005EB7: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::Destroy_() (basic_json.hpp:1910)
==65090==    by 0x100005E34: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3126)
==65090==    by 0x100003634: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::~basic_json() (basic_json.hpp:3125)
==65090==    by 0x10004C6FA: std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::operator()(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) const (memory:2368)
==65090==    by 0x10004C6BE: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::reset(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >*) (memory:2623)
==65090==    by 0x10004C658: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004B1D4: std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::~unique_ptr() (memory:2577)
==65090==    by 0x10004C598: std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::destroy(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1936)
==65090==    by 0x10004C56C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::integral_constant<bool, true>, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1798)
==65090==    by 0x10004C53C: void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::destroy<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >(std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >&, std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (memory:1635)
==65090==    by 0x10008FF7A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::__destruct_at_end(std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >*) (vector:426)
==65090==    by 0x10008FF0A: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::clear() (vector:369)
==65090==    by 0x10008FEB6: std::__1::__vector_base<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~__vector_base() (vector:463)
==65090==    by 0x10008FE87: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:555)
==65090==    by 0x10008FE54: std::__1::vector<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, std::__1::allocator<std::__1::unique_ptr<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::default_delete<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > > >::~vector() (vector:550)
==65090==    by 0x10008FE34: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10008EC74: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::~dynamic_resources() (jmespath.hpp:389)
==65090==    by 0x10003E2D2: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3371)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==  Block was alloc'd at
==65090==    at 0x100424545: malloc (in /usr/local/Cellar/valgrind/HEAD-3568e0b/libexec/valgrind/vgpreload_memcheck-amd64-darwin.so)
==65090==    by 0x1004F8DE9: operator new(unsigned long) (in /usr/lib/libc++abi.dylib)
==65090==    by 0x100004F58: std::__1::__libcpp_allocate(unsigned long, unsigned long) (new:253)
==65090==    by 0x100009C72: std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >::allocate(unsigned long, void const*) (memory:1869)
==65090==    by 0x100009BB0: std::__1::allocator_traits<std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > > >::allocate(std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >&, unsigned long) (memory:1586)
==65090==    by 0x100021E85: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::create<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&>(std::__1::allocator<jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > >, jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&) (basic_json.hpp:714)
==65090==    by 0x100021E57: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::array_storage(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&, jsoncons::semantic_tag) (basic_json.hpp:736)
==65090==    by 0x100021DF3: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage::array_storage(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > > const&, jsoncons::semantic_tag) (basic_json.hpp:735)
==65090==    by 0x100021DB6: void jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::construct<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::array_storage, jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >, jsoncons::semantic_tag&>(jsoncons::json_array<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >&&, jsoncons::semantic_tag&) (basic_json.hpp:1923)
==65090==    by 0x100021D40: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::basic_json(jsoncons::json_array_arg_t, jsoncons::semantic_tag, std::__1::allocator<char> const&) (basic_json.hpp:2914)
==65090==    by 0x100021CF6: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::basic_json(jsoncons::json_array_arg_t, jsoncons::semantic_tag, std::__1::allocator<char> const&) (basic_json.hpp:2913)
==65090==    by 0x10004B0E5: std::__1::__unique_if<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >::__unique_single std::__1::make_unique<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (memory:3033)
==65090==    by 0x100049CA6: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >* jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources::create_json<jsoncons::json_array_arg_t const&>(jsoncons::json_array_arg_t const&) (jmespath.hpp:457)
==65090==    by 0x10008ABA8: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3003)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x100056646: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::multi_select_hash::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3131)
==65090==    by 0x10004AE61: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::projection_base::apply_expressions(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:2749)
==65090==    by 0x10008AD50: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::flatten_projection::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) const (jmespath.hpp:3024)
==65090==    by 0x10004A520: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::evaluate_tokens(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::vector<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token, std::__1::allocator<jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::token> > const&, jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::dynamic_resources&, std::__1::error_code&) (jmespath.hpp:2308)
==65090==    by 0x10003E2AE: jsoncons::jmespath::detail::jmespath_evaluator<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&>::jmespath_expression::evaluate(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, std::__1::error_code&) (jmespath.hpp:3370)
==65090==    by 0x10000386B: jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > jsoncons::jmespath::search<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > >(jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> > const&, jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >::string_view_type const&) (jmespath.hpp:5163)
==65090==    by 0x100002EAE: main (test3.cpp:36)
==65090==
==65090==
==65090== HEAP SUMMARY:
==65090==     in use at exit: 18,047 bytes in 163 blocks
==65090==   total heap usage: 312 allocs, 149 frees, 88,463 bytes allocated
==65090==
==65090== LEAK SUMMARY:
==65090==    definitely lost: 0 bytes in 0 blocks
==65090==    indirectly lost: 0 bytes in 0 blocks
==65090==      possibly lost: 0 bytes in 0 blocks
==65090==    still reachable: 4,096 bytes in 1 blocks
==65090==         suppressed: 13,951 bytes in 162 blocks
==65090== Rerun with --leak-check=full to see details of leaked memory
==65090==
==65090== For lists of detected and suppressed errors, rerun with: -s
==65090== ERROR SUMMARY: 16 errors from 4 contexts (suppressed: 1 from 1)

@mtmorgan
Copy link
Contributor Author

mtmorgan commented Dec 17, 2021

If the criterion for minimal reproducible example is generation of valgrind warnings, then we have query with nested []

#include <jsoncons/json.hpp>
#include <jsoncons_ext/jmespath/jmespath.hpp>

using jsoncons::json; 
namespace jmespath = jsoncons::jmespath;

std::string data = R"([{ "datasets" : [] }])";

int main()
{
    std::string path = R"([].{ dataset: datasets[]})";
    json j = json::parse(data);
    json result = jmespath::search(j, path);
    return 0;
}

The valgrind trace suggests that the error occurs when dynamic_resources is being free'd

@mtmorgan
Copy link
Contributor Author

mtmorgan commented Dec 18, 2021

If I make this change

jsoncons master$ git diff
diff --git a/include/jsoncons/basic_json.hpp b/include/jsoncons/basic_json.hpp
index 30e63dc75..df311fd7e 100644
--- a/include/jsoncons/basic_json.hpp
+++ b/include/jsoncons/basic_json.hpp
@@ -880,7 +880,7 @@ namespace jsoncons {
             void destroy() noexcept
             {
                 object_allocator alloc(ptr_->get_allocator());
-                std::allocator_traits<object_allocator>::destroy(alloc, type_traits::to_plain_pointer(ptr_));
+                // std::allocator_traits<object_allocator>::destroy(alloc, type_traits::to_plain_pointer(ptr_));
                 std::allocator_traits<object_allocator>::deallocate(alloc, ptr_,1);
             }
         };

my problems (and the valgrind invalid reads) go away, but I don't have a deep enough understanding of C++ or jsoncons to know what the right solution is... Probably this introduces a memory leak...

@danielaparker
Copy link
Owner

danielaparker commented Dec 20, 2021

Yes, removing that line would cause a memory leak. The issue has to be elsewhere.

The valgrind results and the stack trace you initially reported are consistent, the issue is happening in these lines of code

dynamic_resources<Json,JsonReference> dynamic_storage;
return deep_copy(*evaluate_tokens(doc, output_stack_, dynamic_storage, ec));

in the destructor of dynamic_resources, where memory of temporarily allocated Json instances is freed, via the destructors of std::unique_ptr<Json>. This freeing happens after we've made a deep copy of this memory in the line below.

I need to think about what could possible go wrong there.

Daniel

@danielaparker
Copy link
Owner

When you have a moment, could you do the following experiment, with the code from master, and your minimal example:

#include <jsoncons/json.hpp>
#include <jsoncons_ext/jmespath/jmespath.hpp>

using jsoncons::json;
namespace jmespath = jsoncons::jmespath;

std::string data = R"([{ "datasets" : [] }])";

int main()
{
    std::string path = R"([].{ dataset: datasets[]})";
    json j = json::parse(data);
    json result = jmespath::search(j, path);
    return 0;
}

In the include file jsoncons/json_container_types.hpp, comment out line 199, like this

~json_array() noexcept
{
    // destroy();
}

and line 647, like this

~json_object() noexcept
{
    // destroy();
}

See if you still have valgrind warnings. If this compiles without warnings, uncomment line 199 and try again.

Thanks,
Daniel

@mtmorgan
Copy link
Contributor Author

I guess that's line 109, and not 199. valgrind does not produce warnings when 109 & 647 are commented out, and does not produce warnings when only 647 is commented out.

@danielaparker
Copy link
Owner

Right 109 :-)

Can you now take the latest code from master and see if you still get valgrind warnings.

Thanks,
Daniel

@mtmorgan
Copy link
Contributor Author

The latest code from master does not generate valgrind warnings!

@danielaparker
Copy link
Owner

danielaparker commented Dec 22, 2021

Okay, one last test, on line 1222 of json_container_types.hpp, you should see

{
    Json tempitem;
    tempitem.swap(kv.value());
    temp.emplace_back(std::move(tempitem));
    //temp.emplace_back(std::move(kv.value()));
}

Could you change that to

{
    //Json tempitem;
    //tempitem.swap(kv.value());
    //temp.emplace_back(std::move(tempitem));
    temp.emplace_back(std::move(kv.value()));
}

(comment out the first three lines, and uncomment the last) and run the test again?

Thanks,
Daniel

@mtmorgan
Copy link
Contributor Author

Still no valgrind warnings, with those changes in place.

@danielaparker
Copy link
Owner

danielaparker commented Dec 22, 2021

Good!

I think this fixes the issue, I can tell where the issue was arising, and how to avoid it, but I still don't understand why.

Those "destroy" functions exist to flatten json array and object structures before their elements are destroyed, for deeply nested structures, it isn't safe to destroy them recursively. As such, they only need to be applied to elements that are non-empty array and object types, and the original code was applying them unnecessarily to one other kind of value (which is used by jmespath.) However, that should have been a no-op, as it appears to have been in all other environments besides your's.

Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants