[CDRIVER-4185] Access violation when trying to join a thread Created: 12/Oct/21  Updated: 28/Oct/23  Resolved: 22/Jun/23

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.24.2

Type: Bug Priority: Major - P3
Reporter: Linda Qin Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File mongo-c-driver-thread.png    
Epic Link: Improve Developer Experience
Quarter: FY24Q2
Case:

 Description   

When a new monitor thread fails to create and returns the `EAGAIN` error, we incorrectly assume it has been created. Then when attempting to shutdown the thread later on, we cause an Access Violation in the client application. Some details:

`thread_create` doesn't check if the creation succeeds or not.

When we attempt to stop the server monitor thread, it is assumed that it was already running. The call on `thread_join stop` will crash

It would be nice if C driver could handle this situation gracefully to avoid crashes.



 Comments   
Comment by Githook User [ 26/Jun/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4185 log and do not update state when creating thread fails (#1315)

  • log and do not update state when creating thread fails

add `errno_out` arg to mcommon_thread_create

Comment by Githook User [ 22/Jun/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-4185 log and do not update state when creating thread fails (#1315)

  • log and do not update state when creating thread fails

add `errno_out` arg to mcommon_thread_create

Generated at Wed Feb 07 21:20:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.