crash in ReaderArena::tryGetSegment()

21 views
Skip to first unread message

Robert Ritz

unread,
Mar 23, 2020, 2:52:27 PM3/23/20
to Cap'n Proto
I'm using release 0.6.1 and seeing a crash due to calling pure virtual function ReaderArena::tryGetSegment().
Stack trace is:

 std::terminate() ()

 __cxa_pure_virtual ()

 capnp::_::ReaderArena::tryGetSegment(kj::Id<unsigned int, capnp::_::Segment>) ()

 capnp::Data::Reader capnp::_::PointerReader::getBlob<capnp::Data>(void const*, unsigned int) const ()

 capnp::_::PointerHelpers<capnp::Data, (capnp::Kind)1>::get (defaultBytes=0, defaultValue=0x0, reader=...)

 ...


Any idea if this is a known issue?  Or any other suggestion?


Thanks,

Rob


Kenton Varda

unread,
Mar 23, 2020, 3:00:25 PM3/23/20
to Robert Ritz, Cap'n Proto
Hi Robert,

This almost certainly means that you're trying to use a Reader object after the containing MessageReader has been destroyed. Check where you're creating the MessageReader and make sure it stays alive until you're done using all the Reader objects that point into it.

-Kenton

--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/530df444-eeb7-459a-abfa-f992de71b1c8%40googlegroups.com.

Robert Ritz

unread,
Mar 23, 2020, 6:36:57 PM3/23/20
to Kenton Varda, Cap'n Proto
Thanks for the quick reply.  As you suspected, I was referencing a MessageReader object that was out of scope.

Thanks,
Rob
Reply all
Reply to author
Forward
0 new messages