Public bug reported:

Ubuntu 26.04 currently ships
https://launchpad.net/ubuntu/+source/valgrind/1:3.26.0-0ubuntu1, which
matches the upstream version Valgrind 3.26.0. The problem is that this
version has a nasty bug that makes Valgrind produce invalid (malformed)
XML output under --xml=yes and therefore unusable (because any compliant
XML parser will reject it).

This is a known bug fixed upstream in Valgrind 3.27.0. See
https://valgrind.org/docs/manual/dist.news.html:

    Release 3.27.0 (20 Apr 2026)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    [...]
    
    * ==================== FIXED BUGS ====================
    
    [...]
    
    514613  Unclosed leak_summary/still_reachable tag in xml output

You can find more details at
https://bugs.kde.org/show_bug.cgi?id=514613.

The bug report linked above already contains plenty of details about the
bug, but here's how I personally reproduced the issue:

    $ podman run --rm -it 
docker.io/library/ubuntu:resolute-20260421@sha256:f3d28607ddd78734bb7f71f117f3c6706c666b8b76cbff7c9ff6e5718d46ff64
 bash
    root@a2faadd4af22:/# cd
    root@a2faadd4af22:~# apt-get update
    [...]
    root@a2faadd4af22:~# DEBIAN_FRONTEND=noninteractive apt-get install gcc 
valgrind libxml2-utils
    [...]
    root@a2faadd4af22:~# echo '#include <stdlib.h>
    int main(void)
    {
        int *p = malloc(sizeof(int));
        return 0;
    }' > leak.c
    root@a2faadd4af22:~# gcc -g -O0 -std=c99 -Wall -Wextra -Wpedantic leak.c -o 
leak
    leak.c: In function 'main':
    leak.c:4:10: warning: unused variable 'p' [-Wunused-variable]
        4 |     int *p = malloc(sizeof(int));
          |          ^
    root@a2faadd4af22:~# valgrind --xml=yes --xml-file=out.xml ./leak
    root@a2faadd4af22:~# xmllint --noout out.xml
    out.xml:103: parser error : Opening and ending tag mismatch: 
still_reachable line 96 and leak_summary
    </leak_summary>
                   ^
    out.xml:118: parser error : Opening and ending tag mismatch: leak_summary 
line 83 and valgrindoutput
    </valgrindoutput>
                     ^
    root@a2faadd4af22:~#

I suggest either updating the "valgrind" package to 3.27.0 or at least
applying a patch for this specific bug.

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: valgrind 1:3.26.0-0ubuntu1
Uname: Linux 6.6.114.1-microsoft-standard-WSL2 x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
CloudBuildName: ubuntu-oci:minimized
CloudSerial: 20260421
Date: Thu May 14 01:03:15 2026
ProcEnviron:
 PATH=(custom, no user)
 TERM=xterm
SourcePackage: valgrind
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: valgrind (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug cloud-image resolute

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2152584

Title:
  Invalid XML output (fixed upstream in 3.27.0, but currently on 3.26.0)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/2152584/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to