[SERVER-49432] Avoid read-after-delete in ServiceExecutorSync shutdown Created: 10/Jul/20  Updated: 29/Oct/23  Resolved: 16/Jul/20

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.4.1, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0
Sprint: Service Arch 2020-07-27
Participants:
Linked BF Score: 0

 Description   

The shutdown procedure of ServiceExecutorSynchronous uses two variables to communicate with executor threads: a condition variable and an atomic word.

It is possible for the last executor thread to access the condition variable after it's destroyed, which could result in a read-after-delete failure. To prevent such failures, we should extend the lifetime of all resources (e.g., the condition variable) shared between the ServiceExecutor and the executor threads.



 Comments   
Comment by Githook User [ 18/Aug/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-49432 Avoid read-after-delete in ServiceExecutorSync shutdown

(cherry picked from commit b348b91ffdfab32e5a1ec9e63c9def884adf1acb)
Branch: v4.4
https://github.com/mongodb/mongo/commit/c11e23cd26bd8c93f13e8795f115dfd87e39f980

Comment by Githook User [ 16/Jul/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-49432 Avoid read-after-delete in ServiceExecutorSync shutdown
Branch: master
https://github.com/mongodb/mongo/commit/b348b91ffdfab32e5a1ec9e63c9def884adf1acb

Generated at Thu Feb 08 05:19:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.