[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#903389: glibc/2.27-4 appears to break unrar-free/1:0.0.1+cvs20140707-4 autopktest: different Valgrind status codes



control: reassign -1 valgrind
control: retitle -1 valgrind can't read debug info from binaries built with -z separate-code
control: forwarded -1 https://bugs.kde.org/show_bug.cgi?id=395682
control: severity -1 important
control: affects -1 libc6

Hi,

On 2018-07-10 12:04, Andre Naujoks wrote:
> Hi.
> 
> Just my two cents. I think this might be the same as this:
> 
> https://bugs.kde.org/show_bug.cgi?id=395682
> 
> and respectively
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=23357
> 
> It seems a default option for ld (-z separate-code) was changed, which makes valgrind unable to read the binaries info.
> This in turn (and here is where the guessing starts) may lead to valgrind not being able to apply its default
> suppressions!?

Thanks for the pointer. Valgrind indeed misses support for reading
binaries built with -z separate-code. This causes it to misses
glibc specific suppressions, which triggers the CI issue with
unrar-free. It also means that the name of the function where an
issue is found is not printed anymore, rendering it almost useless.

| $ cat test-uninitialized.c
| #include <stdio.h>
| 
| int get_uninitialized()
| {
|         int uninitialized;
| 
|         return uninitialized;
| }
| 
| int main()
| {
|         printf("%i\n", get_uninitialized());
|         return 0;
| }


When such a binary is built with binutils 2.30, and used with libc6
2.27-3, it correctly print the issue:

| $ valgrind ./test-uninitialized
| ==4036== Memcheck, a memory error detector
| ==4036== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
| ==4036== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
| ==4036== Command: ./test-uninitialized
| ==4036== 
| ==4036== Conditional jump or move depends on uninitialised value(s)
| ==4036==    at 0x4E8780A: vfprintf (vfprintf.c:1642)
| ==4036==    by 0x4E8EEB5: printf (printf.c:33)
| ==4036==    by 0x108673: main (in /tmp/test-uninitialized)
| ==4036== 
| ==4036== Use of uninitialised value of size 8
| ==4036==    at 0x4E836FB: _itoa_word (_itoa.c:179)
| ==4036==    by 0x4E86EEF: vfprintf (vfprintf.c:1642)
| ==4036==    by 0x4E8EEB5: printf (printf.c:33)
| ==4036==    by 0x108673: main (in /tmp/test-uninitialized)
| ==4036== 
| ==4036== Conditional jump or move depends on uninitialised value(s)
| ==4036==    at 0x4E83705: _itoa_word (_itoa.c:179)
| ==4036==    by 0x4E86EEF: vfprintf (vfprintf.c:1642)
| ==4036==    by 0x4E8EEB5: printf (printf.c:33)
| ==4036==    by 0x108673: main (in /tmp/test-uninitialized)
| ==4036== 
| ==4036== Conditional jump or move depends on uninitialised value(s)
| ==4036==    at 0x4E86F93: vfprintf (vfprintf.c:1642)
| ==4036==    by 0x4E8EEB5: printf (printf.c:33)
| ==4036==    by 0x108673: main (in /tmp/test-uninitialized)
| ==4036== 
| ==4036== Conditional jump or move depends on uninitialised value(s)
| ==4036==    at 0x4E87074: vfprintf (vfprintf.c:1642)
| ==4036==    by 0x4E8EEB5: printf (printf.c:33)
| ==4036==    by 0x108673: main (in /tmp/test-uninitialized)
| ==4036== 
| 0
| ==4036== 
| ==4036== HEAP SUMMARY:
| ==4036==     in use at exit: 0 bytes in 0 blocks
| ==4036==   total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
| ==4036== 
| ==4036== All heap blocks were freed -- no leaks are possible
| ==4036== 
| ==4036== For counts of detected and suppressed errors, rerun with: -v
| ==4036== Use --track-origins=yes to see where uninitialised values come from
| ==4036== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)

When such a binary is built with binutils 2.30.90.20180705-1, and used
with libc6 2.27-3, it fails to print the functions in that binary:

| $ valgrind ./test-uninitialized
| ==4058== Memcheck, a memory error detector
| ==4058== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
| ==4058== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
| ==4058== Command: ./test-uninitialized
| ==4058== 
| ==4058== Conditional jump or move depends on uninitialised value(s)
| ==4058==    at 0x4E8780A: vfprintf (vfprintf.c:1642)
| ==4058==    by 0x4E8EEB5: printf (printf.c:33)
| ==4058==    by 0x109183: ??? (in /tmp/test-uninitialized)
| ==4058==    by 0x4E5AA86: (below main) (libc-start.c:310)
| ==4058== 
| ==4058== Use of uninitialised value of size 8
| ==4058==    at 0x4E836FB: _itoa_word (_itoa.c:179)
| ==4058==    by 0x4E86EEF: vfprintf (vfprintf.c:1642)
| ==4058==    by 0x4E8EEB5: printf (printf.c:33)
| ==4058==    by 0x109183: ??? (in /tmp/test-uninitialized)
| ==4058==    by 0x4E5AA86: (below main) (libc-start.c:310)
| ==4058== 
| ==4058== Conditional jump or move depends on uninitialised value(s)
| ==4058==    at 0x4E83705: _itoa_word (_itoa.c:179)
| ==4058==    by 0x4E86EEF: vfprintf (vfprintf.c:1642)
| ==4058==    by 0x4E8EEB5: printf (printf.c:33)
| ==4058==    by 0x109183: ??? (in /tmp/test-uninitialized)
| ==4058==    by 0x4E5AA86: (below main) (libc-start.c:310)
| ==4058== 
| ==4058== Conditional jump or move depends on uninitialised value(s)
| ==4058==    at 0x4E86F93: vfprintf (vfprintf.c:1642)
| ==4058==    by 0x4E8EEB5: printf (printf.c:33)
| ==4058==    by 0x109183: ??? (in /tmp/test-uninitialized)
| ==4058==    by 0x4E5AA86: (below main) (libc-start.c:310)
| ==4058== 
| ==4058== Conditional jump or move depends on uninitialised value(s)
| ==4058==    at 0x4E87074: vfprintf (vfprintf.c:1642)
| ==4058==    by 0x4E8EEB5: printf (printf.c:33)
| ==4058==    by 0x109183: ??? (in /tmp/test-uninitialized)
| ==4058==    by 0x4E5AA86: (below main) (libc-start.c:310)
| ==4058== 
| 0
| ==4058== 
| ==4058== HEAP SUMMARY:
| ==4058==     in use at exit: 0 bytes in 0 blocks
| ==4058==   total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
| ==4058== 
| ==4058== All heap blocks were freed -- no leaks are possible
| ==4058== 
| ==4058== For counts of detected and suppressed errors, rerun with: -v
| ==4058== Use --track-origins=yes to see where uninitialised values come from
| ==4058== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)

When the same binary is run with libc6 2.27-4, all the function names
are missing:

| ==4148== Memcheck, a memory error detector
| ==4148== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
| ==4148== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
| ==4148== Command: ./test-uninitialized
| ==4148== 
| ==4148== Conditional jump or move depends on uninitialised value(s)
| ==4148==    at 0x4CD68CA: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CDDF75: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CA9B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148== 
| ==4148== Use of uninitialised value of size 8
| ==4148==    at 0x4CD27BB: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CDDF75: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CA9B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148== 
| ==4148== Conditional jump or move depends on uninitialised value(s)
| ==4148==    at 0x4CD27C5: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CDDF75: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CA9B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148== 
| ==4148== Conditional jump or move depends on uninitialised value(s)
| ==4148==    at 0x4CD6053: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CDDF75: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CA9B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148== 
| ==4148== Conditional jump or move depends on uninitialised value(s)
| ==4148==    at 0x4CD6134: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CDDF75: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148==    by 0x4CA9B16: ??? (in /lib/x86_64-linux-gnu/libc-2.27.so)
| ==4148== 
| 0
| ==4148== 
| ==4148== HEAP SUMMARY:
| ==4148==     in use at exit: 0 bytes in 0 blocks
| ==4148==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
| ==4148== 
| ==4148== All heap blocks were freed -- no leaks are possible
| ==4148== 
| ==4148== For counts of detected and suppressed errors, rerun with: -v
| ==4148== Use --track-origins=yes to see where uninitialised values come from
| ==4148== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)

We already have many binaries built with -z separate-code in buster, so
the best would be to add support for them in valgrind. I am therefore
reaffecting the bug there. If it can't be done soon, the best would be to
build binutils with --disable-separate-code.

I think the issue should just be ignored from the CI point of view, it
just happens that glibc is one of the many affected packages, the other
haven't been caught before.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

Attachment: signature.asc
Description: PGP signature


Reply to: