-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valgrind is reporting multiple memory leaks #122
Comments
Some of these leaks are due to OpenSSL/libcurl, not really too much to worry about and besides we cannot do anything about them really.
Good catch, I am unaware of this one. Will fix :-)
This one is fixed on trunk I believe. Please try again with the trunk and debug info turned on, this way you get better traces from valgrind. Nico |
Result when building from trunk:
|
The add_subcommand_alias routine contained a use-after-free bug which was discovered by valgrind. I actually used the AddressSanitizer to track down this bug - it is much more useful. The actual bug is that old_sc saved a reference to the old array that was realloc-ed and then the function pointer from out the now free'ed array was copied over. Fix this by storing the function pointer into a temporary, then realloc-ing the array and then copy the temporary value into the new array entry. Github-Issue: #122 Reported-By: Mikael Fangel (https://github.com/MikaelFangel)
The add_subcommand_alias routine contained a use-after-free bug which was discovered by valgrind. I actually used the AddressSanitizer to track down this bug - it is much more useful. The actual bug is that old_sc saved a reference to the old array that was realloc-ed and then the function pointer from out the now free'ed array was copied over. Fix this by storing the function pointer into a temporary, then realloc-ing the array and then copy the temporary value into the new array entry. Github-Issue: #122 Reported-By: Mikael Fangel (https://github.com/MikaelFangel)
The add_subcommand_alias routine contained a use-after-free bug which was discovered by valgrind. I actually used the AddressSanitizer to track down this bug - it is much more useful. The actual bug is that old_sc saved a reference to the old array that was realloc-ed and then the function pointer from out the now free'ed array was copied over. Fix this by storing the function pointer into a temporary, then realloc-ing the array and then copy the temporary value into the new array entry. Github-Issue: #122 Reported-By: Mikael Fangel (https://github.com/MikaelFangel)
I can't really derive all the leaks from the provided stack traces because they do not contain any debug information. Probably stripped or compiled without -g. Also, I can't reproduce with the same version of valgrind (3.22). Github-Issue: #122 Reported-By: Mikael Fangel (https://github.com/MikaelFangel)
I can't really derive any information from the stack trace because it contains a lot of noise and also it's missing debug info. Are the binaries stripped or are they not even compiled with -g and -O0? I have tried tracing down the leaks from the functions being called but I am unsure as I can't reproduce the leaks with the same version of valgrind locally (and another machine as well which ran the version 3.21). See the Can you please compile without all the Nix Shell noise and include the debug info (see HACKING.md). |
Fair, enough and yes, I actually forgot to compile with the debugging flag on. I'll see if I can set up a debugging environment during the week and provide some better info. (: |
I've run a memory check with
valgrind
on the application, and it looks like the application has several memory leaks.Simple example
Larger example
The text was updated successfully, but these errors were encountered: