[CDRIVER-2529] Consider using memory checking tools on Darwin and Windows Created: 06/Mar/18  Updated: 31/Mar/22

Status: Backlog
Project: C Driver
Component/s: tests
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2528 Possible leaks in DarwinSSL implement... Closed
Epic Link: CDRIVER-2733

 Description   

Platforms other than Linux don't benefit from our Valgrind evergreen tasks. We can consider making tasks to use tools like
leaks on macOS, which can run a process and print a list of leaks detected at exit:

leaks -atExit ./test-libmongoc --no-fork

Another tool on macOS that looks interesting is libgmalloc, which overrides the behavior of malloc and detects memory errors like use-after-free. man libgmalloc shows how to use this with:

DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib ./test-libmongoc --no-fork

We also can research memory checking command line tools for Windows.



 Comments   
Comment by A. Jesse Jiryu Davis [ 23/Mar/18 ]

JetBrains has valgrind working in WSL (Windows subsystem for Linux) if you use CLion, it suggests we should be able to use WSL and valgrind in an Evergreen script:

https://blog.jetbrains.com/clion/2018/02/clion-2018-1-eap-valgrind-wsl-partial-commits-cpp-support/

But we need to research whether the WSL environment represents how Windows users will really run the driver. E.g., if the driver ends up using OpenSSL instead of SChannel in this environment then we haven't gained any test coverage.

Comment by Andrew Morrow (Inactive) [ 06/Mar/18 ]

I believe that XCode clang on modern OS X supports ASAN, UBSAN, TSAN, etc.

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