-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: mongodb-client-encryption-1.1.0
-
Component/s: Client Side Encryption
-
Empty show more show less
From a valgrind run of the example script in https://github.com/mongodb-university/csfle-guides (I’m happy to help with addressing this if I have some time):
==256810== HEAP SUMMARY: ==256810== in use at exit: 119,184 bytes in 157 blocks ==256810== total heap usage: 93,104 allocs, 92,947 frees, 129,728,319 bytes allocated ==256810== ==256810== 48 bytes in 1 blocks are definitely lost in loss record 33 of 114 ==256810== at 0x427FE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA5D5574: MongoCrypt::New(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE4694: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C9E: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1394680: Builtins_JSBuiltinsConstructStub (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x147CE02: Builtins_ConstructHandler (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1394589: Builtins_JSConstructStubGeneric (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x147CE02: Builtins_ConstructHandler (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 139 (16 direct, 123 indirect) bytes in 1 blocks are definitely lost in loss record 69 of 114 ==256810== at 0x4281D99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA6082E6: bson_malloc0 (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D992F: mongocrypt_binary_new_from_data (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D5617: MongoCrypt::New(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE4694: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C9E: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1394680: Builtins_JSBuiltinsConstructStub (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x147CE02: Builtins_ConstructHandler (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 299 bytes in 1 blocks are definitely lost in loss record 83 of 114 ==256810== at 0x4280583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA5D1FC4: BufferToBinary(v8::Local<v8::Object>) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D21B9: MongoCryptContext::AddMongoOperationResponse(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE369A: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C45: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1392438: Builtins_ArgumentsAdaptorTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x141101D: Builtins_ArrayForEach (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 304 bytes in 1 blocks are possibly lost in loss record 84 of 114 ==256810== at 0x4281D99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0x42589CA: allocate_dtv (dl-tls.c:286) ==256810== by 0x42589CA: _dl_allocate_tls (dl-tls.c:532) ==256810== by 0x442B322: allocate_stack (allocatestack.c:622) ==256810== by 0x442B322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660) ==256810== by 0xAF6D50: node::inspector::Agent::Start(std::string const&, node::DebugOptions const&, std::shared_ptr<node::ExclusiveAccess<node::HostPort, node::MutexBase<node::LibuvMutexTraits> > >, bool) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x9CE158: node::Environment::InitializeInspector(std::unique_ptr<node::inspector::ParentInspectorHandle, std::default_delete<node::inspector::ParentInspectorHandle> >) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x96D63C: node::CreateEnvironment(node::IsolateData*, v8::Local<v8::Context>, std::vector<std::string, std::allocator<std::string> > const&, std::vector<std::string, std::allocator<std::string> > const&, node::EnvironmentFlags::Flags, node::ThreadId, std::unique_ptr<node::InspectorParentHandle, std::default_delete<node::InspectorParentHandle> >) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xA43528: node::NodeMainInstance::CreateMainEnvironment(int*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xA436F2: node::NodeMainInstance::Run() (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x9D1734: node::Start(int, char**) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x4E860B2: (below main) (libc-start.c:308) ==256810== ==256810== 622 (16 direct, 606 indirect) bytes in 1 blocks are definitely lost in loss record 96 of 114 ==256810== at 0x4281D99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA6082E6: bson_malloc0 (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D992F: mongocrypt_binary_new_from_data (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D4E2B: MongoCrypt::New(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE4694: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C9E: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1394680: Builtins_JSBuiltinsConstructStub (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x147CE02: Builtins_ConstructHandler (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 1,286 bytes in 4 blocks are definitely lost in loss record 104 of 114 ==256810== at 0x4280583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA5D1FC4: BufferToBinary(v8::Local<v8::Object>) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D21B9: MongoCryptContext::AddMongoOperationResponse(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE369A: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C45: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 1,619 bytes in 14 blocks are definitely lost in loss record 105 of 114 ==256810== at 0x4280583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA5D1FC4: BufferToBinary(v8::Local<v8::Object>) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D7757: MongoCrypt::MakeEncryptionContext(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE369A: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C45: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 1,825 bytes in 4 blocks are definitely lost in loss record 106 of 114 ==256810== at 0x4280583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA5D1FC4: BufferToBinary(v8::Local<v8::Object>) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D6D5F: MongoCrypt::MakeDecryptionContext(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE369A: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C45: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== ==256810== 16,345 (128 direct, 16,217 indirect) bytes in 4 blocks are definitely lost in loss record 113 of 114 ==256810== at 0x427FE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==256810== by 0xA5D6B10: MongoCryptContext::NewInstance(_mongocrypt_ctx_t*) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D7847: MongoCrypt::MakeEncryptionContext(Nan::FunctionCallbackInfo<v8::Value> const&) (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xA5D0C67: ??? (in /tmp/h/csfle-guides/nodejs/node_modules/mongodb-client-encryption/build/Release/mongocrypt.node) ==256810== by 0xBE369A: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE4C45: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0xBE52C5: v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x13FF258: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810== by 0x1398501: Builtins_InterpreterEntryTrampoline (in /home/addaleax/.nvm/versions/node/v14.15.1/bin/node) ==256810==
- is duplicated by
-
NODE-3137 Memory leak after integrating mongodb-client-encryption
- Closed