malloc goes into an infinite loop
807567Jul 25 2003 — edited Nov 19 2004Dear Experts,
Please help. There is a multithreaded server application running on a dual CPU box. The application runs for moths without any problems, but every once in a while stops responding. Symptoms: one thread enters a tight loop and CPU utilization goes to 50%, all other threads stop. truss utility does not generate any output. pstack utility shows that the active thread is stack in malloc:
fef42874 t_splay (1354f38, 77b0c, fdf0a638, fef41a54, 0, 0) + 1a8
fef42548 t_delete (40a1bc0, fefba008, 14608a8, 40a1b50, 175bdf0, 68) + 50
fef4214c realfree (40a1bb8, fefc08f0, fefba008, 40a1b50, 69, 40a1b58) + a0
fef42a20 cleanfree (0, fefba008, fefc0864, fefc08e4, fefc086c, 0) + 58
fef41b54 mallocunlocked (1, feeae000, fefba008, 8, fdf0d19b, 0) + f0
fef41a48 malloc (1, 3da30, 3840, fdf0c750, fdf0cd12, fdf0d19b) + 20
Subsequent runs of pstack show that everything remains the same except for the call to t_splay.
pstack-run-1: fef42874 t_splay (1354f38, 77b0c, fdf0a638, fef41a54, 0, 0) + 1a8
pstack-run-2: fef428b0 t_splay (1354f38, 77b0c, fdf0a638, fef41a54, 0, 0) + 1e4
pstack-run-3: fef42874 t_splay (1354f38, 77b0c, fdf0a638, fef41a54, 0, 0) + 1a8
pstack-run-4: fef427e4 t_splay (1354f38, 77b0c, fdf0a638, fef41a54, 0, 0) + 118
The problem seems to go away when the application is bound to a single CPU. But, since the problem occurs very infrequently and I have not been able to reproduce it in a controlled environment, I am not absolutely positive. Any help would be very appreciated.
Thank You,
Dmitry