D
D
Danil Tunev2021-05-02 11:39:07
linux
Danil Tunev, 2021-05-02 11:39:07

How to find an error in a program with system calls?

Hello! I decided to write a network application on linux using JAP C and standard libraries supplied with the gcc compiler - with such header files sys/epoll.h sys/socket.h, etc. In terms of functionality, the program uses epoll_wait () in a cycle to poll all established tcp connections for read/write/errors, and accordingly writes/reads/closes the connection.
Now, I began to notice that after about one hour of work-idle time, the program takes all the resources of the processor (99% -101%), while under load the program consumes 30% -40% less resources of the stone. This is the first time I have encountered such a problem, I don’t even want to write such a thing, but maybe the problem is in the lib itself or system calls and the kernel, in general, or maybe 32-bit systems are no longer supported?
Now I launched the program in the gdb debugger, but I have little experience with it, and the type of error is depressing). What would you advise in such a situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question