Changes between Initial Version and Version 1 of Ticket #913


Ignore:
Timestamp:
Jul 2, 2009 7:48:03 AM (11 years ago)
Author:
bennylp
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #913

    • Property Priority changed from normal to major
    • Property Summary changed from Concurrency problem in ioqueue to Concurrency problem in select ioqueue may corrupt descriptor set
  • Ticket #913 – Description

    initial v1  
     1If 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. 
     2 
     3Detailed scenario: 
     4 - thread A issues pj_ioqueue_recv(), and midway it is interrupted by thread B 
     5 - thread B issues pj_ioqueue_unregister(sock) which closes the socket. 
     6 - 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. 
     7 - subsequent select() will return -1 since it contains invalid handle 
     8 
     9This will cause the ioqueue to stop receiving events.