[GODRIVER-2872] Fix failing "TestClientSideEncryptionProse" test Created: 16/Jun/23 Updated: 08/Nov/23 Resolved: 30/Aug/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Client Side Encryption |
| Affects Version/s: | None |
| Fix Version/s: | 1.12.2 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Matt Dale | Assignee: | Qingyang Hu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | greenerbuild | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
|
The test
fails frequently with an error like
Check out an example test failure here Definition of done:
|
| Comments |
| Comment by Githook User [ 08/Nov/23 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |
| Comment by Qingyang Hu [ 30/Aug/23 ] |
|
The original comment was not accurate. The C side mongocrypt_binary_new_from_data() does a shallow copy of the passed array only, while the Golang slice which holds the memory may be freed or moved by GC. Once a GC happens, for example, between C.mongocrypt_binary_new_from_data() and C.mongocrypt_ctx_encrypt_init(), the memory block pointed by C.mongocrypt_binary_t gets corrupted and resulted in sporadic "invalid BSON". |
| Comment by Githook User [ 30/Aug/23 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |