malt
malt copied to clipboard
Support of suppression files
Is there a way to exclude some detected memory leaks by ignoring some symbols ?
For Valgrind, it is called suppression files: http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress There is often small memory leaks in 3rd libraries which cannot be easily corrected.
Not yet but can be done quite easily.
Maybe I can provide a file similarly to valgrind.
Originally I was thinking to be able to do it in the GUI but both can be nice so I will to your proposition as it is easy to do.
Thanks for providing idea.
Yesterday, I check (quickly) the source code. It seems that the "leaks" section in the JSON isn't used by malt-webview to display leaks (in calltree panel). Finaly, I quickly filtered the stackTracker (when a Stack contains the symbol I want to ignore) in AllocStackProfiler. It works for several symbols but sometimes I can't find some symbols (but there are displayed in malt-webview).
Sorry was traveling out past weeks, will work on this maybe next week or week after. Thanks for the feedback will look.
But I think there is currently a symbol location extraction which might be buggy on many Linux disto enabling -fPIE + ASLR (https://github.com/memtt/malt/issues/23), I'm on and might have fix in coming days. Maybe this is the symbol issue you are speeking about.
Is your project open source so I can look on it directly ?
About the filtering, is it OK if I will proceed like this :
- Use a INI or JSON formatted file to define suppression. (INI would be if I go for backend suppresion, but I think I will prefer GUI side one).
- Permit to suppress full object file (.so file.....) allowing wildcard allowed
- Permit to suppress objct name in C++ if demangling is valid again with wildcard allowed
- Permit to suppress function name again with wildcard allowed
- Permit to suppress full symbol name again with wildcard allowed.
- Permit to suppress a line range
I would think naively something like this (still need to think more but that looks a nice first spec):
{
"MySoFile-strict": {
"object": "libMySoFile.so.1.2"
},
"MySoFile-wildcard": {
"object": "libMySoFileWithWildCard.so.*"
},
"MySourcePath-strict": {
"source": "/src/driver/tcp.cpp"
},
"MySourcePath-wildcard": {
"source": "/src/driver/*.cpp"
},
"MyClass-strict": {
"class": "MyDriverTCP"
},
"MyClass-wildcard": {
"class": "MyDriver*"
},
"MyFunc-strict": {
"function": "doConnectTCP"
},
"MyFunc-wildcard": {
"function": "doConnect*"
},
"MySymbol-strict": {
"function": "MyClass::doConnectTCP"
},
"MySymbol-wildcard": {
"function": "MyClass::doConnect*"
},
"ExludeLines": {
"source": "/src/driver/tcp.cpp",
"line": [20-34],
},
"All-joint-to-strictly-specify": {
"object": "libMySoFile.so.1.2",
"source": "/src/driver/tcp.cpp",
"class": "MyDriverTCP",
"function": "doConnectTCP",
"line": [20-34],
}
}
Any comment ?