I am able to reliably produce seg faults in a minimal TSocket example by simply sending 5 characters to the listening port. To reproduce, run this in one session (root -b server.C):
{
|
auto ss = new TServerSocket(9090, kTRUE); |
auto sock = ss->Accept();
|
char buf[1024]; |
if(sock) sock->Recv(buf, 1024); |
}
|
and this in another:
echo 12345 | nc -v localhost 9090 |
The same thing happens when using TSocket::Recv(TMessage *&mess) and the same thing happens with the net tutorial hserv2.C.
The actual seg fault seems to be taking place in tobuf in Bytes.h.