Re: [capnproto] initialise nested lists

2018-03-02 Thread 'Fritz Lehmann' via Cap'n Proto
Hi Kenton, > I think you want something like: > > auto outer = name.initNestedList(vec.size()); > for (uint i = 0; i < vec.size(); i++) { > auto inner = outer.init(i, vec[i].size()); > for (uint j = 0; j < vec[i].size(); j++) { > inner.set(j, vec[i][j]); > } >

Re: [capnproto] Re: Segfault during JSON encode() in v0.6.1

2018-03-02 Thread 'Kenton Varda' via Cap'n Proto
Sorry, I don't really have any ideas here. The stack trace is deep in STL code for the type handler map, inside find(). If you've registered no type handlers, that map should be empty. It's hard to imagine how find() on an empty std::unordered_map could ever segfault... -Kenton On Fri, Mar 2, 201

Re: [capnproto] Re: Segfault during JSON encode() in v0.6.1

2018-03-02 Thread Marc Sune
Kenton, On Friday, March 2, 2018 at 7:27:30 PM UTC+1, Kenton Varda wrote: > > Hi Marc, > > Do you have any custom type handlers registered via addTypeHandler()? Is > it possible that the handler class has gone out-of-scope (been destroyed) > by the time the encoder is executed? > No, I am not u

Re: [capnproto] Re: Segfault during JSON encode() in v0.6.1

2018-03-02 Thread 'Kenton Varda' via Cap'n Proto
Hi Marc, Do you have any custom type handlers registered via addTypeHandler()? Is it possible that the handler class has gone out-of-scope (been destroyed) by the time the encoder is executed? -Kenton On Fri, Mar 2, 2018 at 10:18 AM, Marc Sune wrote: > > That's about all that I can get, even t

[capnproto] Re: Segfault during JSON encode() in v0.6.1

2018-03-02 Thread Marc Sune
> That's about all that I can get, even though capnproto is compiled with DEBUG. Or shall I say, it should :/ On Friday, March 2, 2018 at 7:17:02 PM UTC+1, Marc Sune wrote: > > Hi guys, > > I am experiencing a _very_ strange segfault during JSON encoding of > message: > > ``` > Program received

[capnproto] Segfault during JSON encode() in v0.6.1

2018-03-02 Thread Marc Sune
Hi guys, I am experiencing a _very_ strange segfault during JSON encoding of message: ``` Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 27946] 0x01e4b81a in std::__detail::_Hashtable_ebo_helper<1, capnp::(anonymous namespace)::TypeHash, true>::_S_cget(std::__