Dear all:

When looking into the soclose() in uipc_socket.c, I thought of one possible situation.

If thread A called soclose() first, and then execute sorele() then sofree(). However, in sofree() (defined in uipc_socket.c), the socket mutex and accept mutex is unlocked first before releasing socket send buffer. While thread A is dealing with the send buffer releasing, another thread, thread B, jumped in. It also calls soclose(), and then sorele(). Following will be a catastrophe: sorele() will examine the socket's reference count ((so)->so_count), then panic occurs since the count value equals zero!

Is there any reasonable explanation?

Thanks.

BR,

Yi-Wen

_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to