Are there any buffer limitations or specific guidelines with sharing standard error in POSIX / Linux among multiple forked processes?
perror("Some descriptor related error: ");
I have a server application which calls perror when needed. As a single process it works fine. In case of multiple processes created with fork, after running server for a while (printing error many times when it occurs), it starts printing the error statement continuously and goes in an infinite loop.
I verified by commenting out the print statement that server runs normally otherwise.
So it appears to me there might be some buffer overflow kind of scenario for standard error which runs out after some time.
I have not used any mutex or semaphore against perror.
The server code is large and it uses epoll for handling multiple client descriptors with a pool of worker processes which pick up clients as they come.