Valgrind has problems parsing files in WSL2 due to DWARF encoding
When using the latest version of the testrunner (like in ESP A4) in Windows Subsystem for Linux 2 (WSL2), Valgrind is unable to parse the debug info in the compiled binary file due to an invalid version of DWARF. Adding the -gdwarf-2
flag to the compilation with clang solved this issue for me.
When using the current version of the testrunner, the Valgrind Output is the following:
==7780== Memcheck, a memory error detector
==7780== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7780== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==7780== Command: ./a4 config/config_02.txt
==7780== Parent PID: 7748
==7780==
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x1b
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x25
### unhandled dwarf2 abbrev form code 0x1b
==7780== Valgrind: debuginfo reader: ensure_valid failed:
==7780== Valgrind: during call to ML_(img_get)
==7780== Valgrind: request for range [269765999, +4) exceeds
==7780== Valgrind: valid image size of 33288 for image:
==7780== Valgrind: "/mnt/e/TU/ESP/espws22-a4-569/a4"
==7780==
==7780== Valgrind: debuginfo reader: Possibly corrupted debuginfo file.
==7780== Valgrind: I can't recover. Giving up. Sorry.
==7780==