id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
913	Concurrency problem in select ioqueue may corrupt descriptor set	bennylp	bennylp	"If one thread is unregistering the socket while another is issuing pending operation such as recv or send, this may corrupt the descriptor set in the ioqueue, causing subsequent select() inside pj_ioqueue_poll() to return error.

Detailed scenario:
 - thread A issues pj_ioqueue_recv(), and midway it is interrupted by thread B
 - thread B issues pj_ioqueue_unregister(sock) which closes the socket.
 - thread A resumes execution, ultimately gaining the key's mutex. But it does not check if the key has been unregistered. It adds the socket handle (which has been closed by thread B) to the read descriptor set.
 - subsequent select() will return -1 since it contains invalid handle

This will cause the ioqueue to stop receiving events.
"	defect	closed	major	release-1.4	pjlib	trunk	fixed		
