PDA

View Full Version : EAGAIN (Resource temporarily unavailable) with all my Qt based applications



dotjan
4th July 2012, 20:21
Hi all, debugging my app I have found it sometimes takes the CPU at 100% for several seconds, and of course for those period the application become a bit unresponsive, even when apparently there is not a lot of activity to do, if I know well my code ;-)

Looking at a strace I can see thousands of error like the following while the CPU gets that busy:

read(6, 0x64ff74, 4096) = -1 EAGAIN (Resource temporarily unavailable)

Same messages are thrown also when I move my mouse over the application window, whatever it is. It might be more related to the OS, but does anyone have a hint? Are these messages significant anyhow, as they are wherever with any app ( I run Linux/KDE)?

Is it maybe the library? I am running Qt libraries 4.7.4

Thanks.

wysota
4th July 2012, 21:16
Open a terminal, type in "man read" and search for EAGAIN.

dotjan
4th July 2012, 22:43
That has already been done

EAGAIN The file descriptor fd refers to a file other than a socket and has been marked nonblocking (O_NONBLOCK), and the read would
block.

But it does not answer to my question unfortunately, which is more than what that error means. As said, those errors cause my system to run out of CPU.

Maybe someone else can elaborate further?

wysota
4th July 2012, 22:55
It means it is not an error. The application is checking if there is anything to read on a descriptor. Your problem is elsewhere. By the way, strace is usually useless for such tracing. Either use a profiler or a debugger. Strace traces system calls which is completely uninteresting.