C API: deserialization fails when connected in same process

45 views
Skip to first unread message

Mathias Gaunard

unread,
Mar 22, 2021, 7:36:07 AM3/22/21
to Kdb+ Personal Developers
Hi,

I have been trying to transfer K objects from one process to another, and I have been using the b9 and d9 functions to attempt to so.

I am using b9 with mode 3, though I have also tried -1, 1 and 2 as well.

d9 (and its validation counterpart okx) work fine so long as I don't call khpu previously in the same process. If I do, then okx fails, and d9 segfaults on a call to ss.

The only symbols in the data are for the names of the columns of table.

There seems to be some funny business going on with symbols whenever I am connected to a live KDB/Q instance. What am I doing wrong?

Thanks for any assistance.

Mathias Gaunard

unread,
Mar 24, 2021, 10:40:01 PM3/24/21
to personal...@googlegroups.com
On Mon, 22 Mar 2021 at 11:36, Mathias Gaunard <mathias...@gmail.com> wrote:

> There seems to be some funny business going on with symbols whenever I am connected to a live KDB/Q instance. What am I doing wrong?

Looking into this some more, I found out that the first byte of the
serialized data generated by b9 was 0 if not connected in the same
process, and 1 if connected.
By hacking that byte to be whatever it should be, I got
deserialization to work just fine.

What is the reasoning behind this?
Reply all
Reply to author
Forward
0 new messages