In my multithreaded application I'm performing an aio_read followed by an aio_suspend in one thread, and most of the time it works well. Sometimes the thread hangs at the aio_suspend which doesn't return. I added a call to aio_error just before the aio_suspend and it does return EINPROGRESS. If I attach to the application with gdb it shows the thread waiting in __aio_suspend_sys+0x30 (). If I interrupt the aio_suspend with a SIGINT and then continue, the application finishes correctly with the I/O having completed successfully.
Any suggestions on how to determine why the aio_suspend is not returning when the I/O has completed?