.z.bm:x

Where x is a unary function.

Kdb+ before V2.7 was sensitive to being fed malformed data structures, sometimes resulting in a crash, but now validates incoming IPC messages to check that data structures are well formed, reporting 'badmsg and disconnecting senders of malformed data structures. The raw message is captured for analysis via the callback .z.bm. The sequence upon receiving such a message is

  1. calls .z.bm with a 2-item list: (handle;msgBytes)
  2. close the handle and call .z.pc
  3. signals 'badmsg

E.g. with the callback defined

q).z.bm:{`msg set (.z.p;x);}

after a bad msg has been received, the global var msg will contain the timestamp, the handle and the full message. Note that this check validates only the data structures, it cannot validate the data itself.