https://bugs.kde.org/show_bug.cgi?id=378293

            Bug ID: 378293
           Summary: False Negative  on memory leak
           Product: valgrind
           Version: 3.12 SVN
          Platform: Archlinux Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: dar...@gmail.com
  Target Milestone: ---

Recently, we started using GCC's Memory and Leak sanitizers to look for
possible memory leaks. While investigating one of them, we realized that
valgrind does not report the said memory leak.

While working on the test suite for GNU Wget 2.0, we found the above false
negative. The issue is strightforward, there is a C struct with a `const char
*` member which is originally pointing to a stack-allocated string. Later, that
pointer points to a heap allocated object, which is then replaced with another
object causing a leak.

I would love to help you debug this issue and create a minimal example / dig
into valgrind, but as of now I have no idea where to start. Here is the very
simple patch I used to fix the issue:
https://github.com/darnir/wget2/commit/864c3ed549c83ffe92d846c7212632a9a89e7417
The leak happens in the file called `tests/libtest.c` at line 656 in
`wget_test_start_server()`. If there is any other information I can provide /
debug, do let me know.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to