There appears to be memory corruption problem that sometimes causes a segmentation fault in client, but more often causes data sent by PersistentConnection to be formatted like
{size, size, data}instead of
{size, data}(which means that contents of data are corrupted and include size bytes).