-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 1.27.5
-
Component/s: Authentication
-
None
-
C Drivers
Summary
LeakSanitizer is showing a SASL leak at shutdown.
==29830==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 192 byte(s) in 1 object(s) allocated from:
#0 0x60b40975e86f in malloc (/home/user/folder/proc/build/bin/proc+0x10b386f)
#1 0x7c5880f10a07 ()
#2 0x7c5880f1118e ()
#3 0x7c58829b1529 in sasl_client_add_plugin (/lib/x86_64-linux-gnu/libsasl2.so.2+0xb529)
#4 0x7c58829b7a20 (/lib/x86_64-linux-gnu/libsasl2.so.2+0x11a20)
#5 0x7c58829b38ae in sasl_client_init (/lib/x86_64-linux-gnu/libsasl2.so.2+0xd8ae)
#6 0x7c5882bd07a7 in _mongoc_do_init (/usr/local/lib/libmongoc-1.0.so.0+0x6a7a7)
#7 0x7c5882bd0a0a in mongoc_init (/usr/local/lib/libmongoc-1.0.so.0+0x6aa0a)
There are other objects in sasl_client_add_plugin that are reported as leaked as well.
Source
Environment
mongo-c-driver-1.27.5, compiled and run on Ubuntu 24.04.1 LTS
How to Reproduce
#include <mongoc/mongoc.h> int main(int argc, char** argv) { mongoc_init(); mongoc_cleanup(); return 0; }
g++ -g -O0 -static-libasan -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -I/usr/local/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0 main.cpp -Wl,-s -L/usr/local/lib/libmongoc-1.0 -lmongoc-1.0 -o main
./main
Leaks printed here.