Stack Exchange
Valgrind not showing file and line (using clang++ -g)
I'm using clang++ 8.0.0-3~ubuntu18.04.2 on Ubuntu 18.04 with valgrind-3.13.0 (latest on ubuntu?)
The problem is, that Valgrind does not show an
==28708== 32 bytes in 1 blocks are still reachable in loss record 1 of 1
==28708==    at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28708==    by 0x598B7E4: _dlerror_run (dlerror.c:140)
==28708==    by 0x598B165: dlsym (dlsym.c:70)
==28708==    by 0x4F4784: __interception::GetRealFunctionAddress(char const*, unsigned long*, unsigned long, unsigned long) (in /mnt/DATEN/Consti/Documents/Studium/Uebungen/02_SS20/Objektorientierte Programmierung/assignment_5828/game)
==28708==    by 0x4CE5F3: __asan::InitializeAsanInterceptors() (in /mnt/DATEN/Consti/Documents/Studium/Uebungen/02_SS20/Objektorientierte Programmierung/assignment_5828/game)
==28708==    by 0x4F0583: __asan::AsanInitInternal() [clone .part.0] (in /mnt/DATEN/Consti/Documents/Studium/Uebungen/02_SS20/Objektorientierte Programmierung/assignment_5828/game)
==28708==    by 0x4010805: _dl_init (dl-init.c:104)
==28708==    by 0x40010C9: ??? (in /lib/x86_64-linux-gnu/ld-2.27.so)
==28708==    by 0x1: ???
==28708==    by 0x1FFEFFF50E: ???
==28708==    by 0x1FFEFFF515: ???

Compiled using this Makefile:
SUBMISSION = game
BUILDDIR   = build
EXECUTABLE = $(SUBMISSION)
SOURCES    = $(wildcard *.cpp)
OBJECTS    = $(patsubst %,$(BUILDDIR)/%,${SOURCES:.cpp=.o})
CXX        = clang++
ASANFLAGS  = -fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls
WARNINGS   = -Wall -Wextra -pedantic -ansi -Wno-unused-parameter -Wpedantic \
  -Wfloat-equal -Wshadow -Wsign-conversion \
  -Wsign-compare -Wpointer-arith -Wdeprecated
ERRORS     = -Werror=old-style-cast -Werror=non-virtual-dtor \
  -Werror=array-bounds -Werror=uninitialized \
  -Werror=format -Werror=format-nonliteral -Werror=float-equal \
  -Werror=delete-non-virtual-dtor -Werror=return-type
CXXFLAGS   = $(WARNINGS) $(ERRORS) $(ASANFLAGS) -g -c -std=c++17 -fsanitize=address -o
LDFLAGS    = $(ASANFLAGS)
LDLIBS     =
#-------------------------------------------------------------------------------

#make executable
all: builddir $(EXECUTABLE)

builddir:
    mkdir -p $(BUILDDIR)

$(BUILDDIR)/%.o: %.cpp
    @echo [CXX] $<
    @$(CXX) $(CXXFLAGS) $@ $< -MMD -MF ./$@.d

#link Objects
$(EXECUTABLE) : $(OBJECTS)
    @echo [LD] $@
    @$(CXX) -o $@ $^ $(LDFLAGS)

#make clean
clean:
    rm -f ./*.o
    rm -f ./*.o.d
    rm -f ./*.bin
    rm -rf ./$(BUILDDIR)
    rm -f $(EXECUTABLE)


run: builddir $(EXECUTABLE)
    ./$(EXECUTABLE) config/config01.json

bonus: builddir $(EXECUTABLE)
    ./$(EXECUTABLE) config/config08_bonus.json

.PHONY: clean cleanw submission run

#The dependencies:
-include $(wildcard *.d)

I've read that zdebug seems to be a thing and that older versions of valgrind do not support it, is it possible that my version does not yet support it? If so, how do I turn them off/get a newer version?

None of those stack frames are in your own code, which is why it doesn't show any line numbers. I think you're looking at a false positive, or otherwise a leak* in ASan. Why are you trying to use valgrind and ASan at the same time anyway? They largely serve the same purpose. (* It may not really be a leak if it's just allocated once at the start of the program and never cleaned up.)

I had no idea what ASan is. This Makefile was provided to us, figured I'd check my current code with valgrind... Thank you! Can you post this as an answer so I can accept?

Valgrind 3.13 is quite old. 3.15 is current and 3.16 is due to be released soon. As already mentioned, don't mix it with ASan. The both use similar techniques and are likely to interfere.

@PaulFloyd Sadly, only Ubuntu 20 supports the newest version, not even 19 can update higher than 3.13 (according to my research at least)

You can build the latest from source.
