failed: expected ref-kind() == WirePointer::LIST [0 == 1];

76 views
Skip to first unread message

Richard Langly

unread,
Feb 28, 2022, 11:59:58 AM2/28/22
to Cap'n Proto
I am seeing the following message on Linux upon calling StreamFdMessageReader on the receiving end of a connection. I did have this working until I put messages inside a union as a wrapper.

Exception in setting up sender: capnp/layout.c++:2438: failed: expected ref-kind() == WirePointer::LIST [0 == 1]; Message contains non-list pointer where text was expected.

I'm guessing something is wrong on the sender as the receiving seems to only report the problem as soon as it reads from the fd. I am mainly confused about the WirePointer::LIST [0 == 1] part. Can anyone add clarification?


struct MyObjA {
    fieldA @0 :SomeType;
    fieldB @1 :UInt16;
    fieldC @2 :Text;
}

struct MyObjB {
    fieldA @0 :SomeType;
    fieldB @1 :UInt16;
    fieldC @2 :Text;
}

struct MyWrapper {
    union {
        objA @0 :MyObjA;
        objB @1 :MyObjB;
    }
}

auto w = builder->initRoot<MyWrapper>();
auto obj = w->initMyObjA();

obj.getMyObjA.setFieldA("a");
obj.getMyObjA.setFieldB("b");

writeMessageToFd(fd, builder);



Reply all
Reply to author
Forward
0 new messages