We've found a recurring problem where some userland process would be
authorhiren <hiren@FreeBSD.org>
Tue, 7 Mar 2017 00:20:01 +0000 (00:20 +0000)
committerhiren <hiren@FreeBSD.org>
Tue, 7 Mar 2017 00:20:01 +0000 (00:20 +0000)
commit7bc7c2fbf31a39dd22371c86bfeff1361fd32341
tree57a81830ffcf759a26fc9ee795f06df45d511652
parent749be37c286cfa2cc68b1dad3483c31a472528d5
We've found a recurring problem where some userland process would be
stuck spinning at 100% cpu around sbcut_internal(). Inside
sbflush_internal(), sb_ccc reached to about 4GB and before passing it
to sbcut_internal(), we type-cast it from uint to int making it -ve.

The root cause of sockbuf growing this large is unknown. Correct fix
is also not clear but based on mailing list discussions, adding
KASSERTs to panic instead of looping endlessly.

Reviewed by: glebius
Sponsored by: Limelight Networks
sys/kern/uipc_sockbuf.c