socket close hangs and CPU go to 100%

Hello,

I'm currently having a problem with HPUX.

The application is a C app. It's a socket server.
It runs mostly fine, but under some circumstances (I can not replicate it), the app hangs and the CPU goes to 100%.

I have use gdb to attach to the app, and it was doing a close().
the close() system call is the one that is hanging.

--------------------
(gdb) where
#0 0xc00000000031a5d0:0 in _close_sys+0x30 () from /usr/lib/hpux64/libc.so.1
#1 0xc00000000032ac40:0 in close+0x140 () from /usr/lib/hpux64/libc.so.1
#2 0x4000000000053950:0 in server (soc_id=5, client_address={sin_family = 2,
sin_port = 3149, sin_addr = {s_addr = 3489154679},
sin_zero = "\000\000\000\000\000\000\000"}) at src/tpswitch.c:982
#3 0x4000000000055b50:0 in main (argc=1, argv=0x9fffffffffffe8a0)
at src/tpswitch.c:1244
-----------------------

The previous stack trace shows that the app is in _close_sys+0x30() from the c library.

The descriptor passed to close() is a socket descriptor.

Thanks in advance for your Help!