I found that top-3.8beta1 sometimes hung on Solaris.
This was tracked to malloc arena corruption due to improper use of
free() in the thread handling code.
This shows up immediately when debugging when using libumem...
eg: on Solaris 9/x86...
$ env LD_PRELOAD=/usr/lib/libumem.so.1 UMEM_DEBUG=guards,verbose ./top
free(807de00): invalid or corrupted buffer
free() was being handed a pointer that wasn't at the start
of the malloc()'d block.
I attach a patch to fix this.