[JAVA-4215] Closing a MongoClient twice with AutoEncryptionSettings causes double free and crash Created: 30/Jun/21 Updated: 28/Oct/23 Resolved: 07/Jul/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Client Side Encryption |
| Affects Version/s: | None |
| Fix Version/s: | 3.12.9, 4.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Brown | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | internal-user | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Case: | (copied to CRM) | ||||||||
| Description |
|
This issue is easily reproducible and I can supply a sample program on request. Triggering conditions are creating a MongoClient for CSFLE, adding AutoEncryptionSettings, connecting to some MongoDB and doing something (it does not need to actually involve any encryption), closing the MongoClient, then closing it again. The second close causes a double free exception, and depending on your environment, can cause a crash dump or heap corruption error. If the MongoClient is not using AutoEncryption settings, you can close it twice with no ill effects. Driver version is 4.2.3 (sync), mongodb-crypt version is 1.2.0. |
| Comments |
| Comment by Githook User [ 07/Jul/21 ] |
|
Author: {'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}Message: Ensure MongoClient#close only actions on first call Backport from: e069cfcbf91d59987de89129bc0c4c83e16b2d99
|
| Comment by Githook User [ 06/Jul/21 ] |
|
Author: {'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}Message: Ensure MongoClient#close only actions on first call
|
| Comment by Ross Lawley [ 02/Jul/21 ] |