I noticed in some case that some of our threads were just hanging. After adding hundreds of printf statements, I came to the conclusion that log4c was the probable cause.
I changed my utility log method to do a printf instead of use log4c and viola, all the hanging stopped.
There is some critical bug in this framework that causes a hang/deadlock when utilized with a highly multi-threaded app with high transaction usage.
Has anyone noticed anything similar? I notice this is no longer supported. Is there a recommended logger for c? I can try log4c++ I guess.
My test case was simple. start an app, open 15 threads. each thread does a log statement, printf("thread number") and sleep(1) and runs forever. monitor the console for any thread that is not outputting the printf and you know that you are hung. now increase to 30 threads and retest.
when it runs for 10 hours without problems, you know the issue is solved.
/Z
/Z
We use log4c in multithread environment and haven't noticed this problem yet. I'll try to reproduce it, or pass it through hellgrind.
I adopt log4c after some time of its inactivity. I can't do much user support or development, but I'm interested in critical bugs and/or patches. :-)