What does the VgTs_WaitSys error in Valgrind mean?

I have a server written in C that generates a new stream whenever a new client connects. To test my server, I wrote a script that emulates 500 clients. The server processes the first few hundred clients, and towards the end I get the following error from Valgrind:

Thread 456: status = VgTs_WaitSys ==4182== at 0x4E383EC: recv (recv.c:34) ==4182== by 0x4017F1: process_data (socket2.h:45) ==4182== by 0x40195E: thread (FBServer.c:82) ==4182== by 0x4E30A03: start_thread (pthread_create.c:300) ==4182== by 0x532DD4C: clone (clone.S:112) Thread 457: status = VgTs_WaitSys ==4182== at 0x4E383EC: recv (recv.c:34) ==4182== by 0x4017F1: process_data (socket2.h:45) ==4182== by 0x40195E: thread (FBServer.c:82) ==4182== by 0x4E30A03: start_thread (pthread_create.c:300) ==4182== by 0x532DD4C: clone (clone.S:112) ... Thread 499: status = VgTs_WaitSys ==4182== at 0x4E383EC: recv (recv.c:34) ==4182== by 0x4017F1: process_data (socket2.h:45) ==4182== by 0x40195E: thread (FBServer.c:82) ==4182== by 0x4E30A03: start_thread (pthread_create.c:300) ==4182== by 0x532DD4C: clone (clone.S:112) 

On line 82 in FBServer.c, the thread calls a function called process_data, which receives data from the client. The process_data function is shown below:

 void process_data(int clientSock) { size_t n; char jstring[MAX_LEN + 1]; int bytes_received_so_far = 0; int bytes_count; char *buf = NULL; while(bytes_count = recv(clientSock, jstring, MAX_LEN, 0)) { if(bytes_count <= 0) { close(clientSock); pthread_exit(NULL); } printf("Bytes received = %d\n", bytes_count); jstring[bytes_count] = '\0'; ... ... } } 

Can someone help me in interpreting error messages.

+4
source share
1 answer

What version of Valgrind are you using?

The only comment I could find in the source was the following:

VgTs_WaitSys, /* waiting for a syscall to complete */

Thus, this means that the program simply blocks the system call (recv in your case). I'm not sure, but it may not be a mistake, just the additional information output by Valgrind.

+1
source

All Articles