The function _pthread_mutex_init_calloc_cb is called from within malloc_spin_lock. This might hang if a thread in the same process space either terminated abnormally (leaving the mutex locked), or it might hang if allocated memory had been corrupted somehow. The last (less likely) possibility is that either FreeBSD or perl has a bug. How easy would it be to upgrade to an 8.x version of the OS to try it out?
fnord
Comment on Re: Strange infinite loop somewhere in libc.so while running FCGI server.
Hmmm, the perl on that server was built without threads support (standard installation). So i doubt there were threads in that process :-) Also i discovered that the problem was happening when fcgi process reached max requests and tried to finish working. So perl just was cleaning up the memory. And you're right as far as i can remember the problem is occuring only on FreeBSD 7.X, not on 8.X. Thanks for advice, i'll try to upgrade the server to 8.X and monitor what will happen. :-)