Comment 6 for bug 1721355

Revision history for this message
Laurent Bonnaud (laurent-bonnaud) wrote : Re: gcc -v gives strange output for OFFLOAD_TARGET_DEFAULT

valgrind finds some uses of uninitialised memory:

$ valgrind gcc -v
==496== Memcheck, a memory error detector
==496== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==496== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==496== Command: gcc -v
==496==
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
==496== Conditional jump or move depends on uninitialised value(s)
==496== at 0x4C32D48: __strlen_sse2 (vg_replace_strmem.c:460)
==496== by 0x4E918C4: vfprintf (vfprintf.c:1643)
==496== by 0x4E927D5: buffered_vfprintf (vfprintf.c:2330)
==496== by 0x4E8FAA5: vfprintf (vfprintf.c:1301)
==496== by 0x4F61295: __vfprintf_chk (vfprintf_chk.c:33)
==496== by 0x428CCD: vfprintf (stdio2.h:127)
==496== by 0x428CCD: fnotice(_IO_FILE*, char const*, ...) (diagnostic.c:1427)
==496== by 0x407F06: env_manager::xput(char const*) (gcc.c:119)
==496== by 0x40A604: xputenv (gcc.c:2700)
==496== by 0x40A604: driver::maybe_putenv_OFFLOAD_TARGETS() const (gcc.c:7764)
==496== by 0x403A5C: driver::main(int, char**) (gcc.c:7295)
==496== by 0x403D53: main (gcc-main.c:46)
==496==
OFFLOAD_TARGET_DEFAULT=1
==496== Conditional jump or move depends on uninitialised value(s)
==496== at 0x4C37CE0: putenv (vg_replace_strmem.c:1996)
==496== by 0x40A604: xputenv (gcc.c:2700)
==496== by 0x40A604: driver::maybe_putenv_OFFLOAD_TARGETS() const (gcc.c:7764)
==496== by 0x403A5C: driver::main(int, char**) (gcc.c:7295)
==496== by 0x403D53: main (gcc-main.c:46)
==496==
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.1)
==496==
==496== HEAP SUMMARY:
==496== in use at exit: 180,029 bytes in 57 blocks
==496== total heap usage: 201 allocs, 144 frees, 202,427 bytes allocated
==496==
==496== LEAK SUMMARY:
==496== definitely lost: 4,272 bytes in 7 blocks
==496== indirectly lost: 0 bytes in 0 blocks
==496== possibly lost: 0 bytes in 0 blocks
==496== still reachable: 175,757 bytes in 50 blocks
==496== suppressed: 0 bytes in 0 blocks
==496== Rerun with --leak-check=full to see details of leaked memory
==496==
==496== For counts of detected and suppressed errors, rerun with: -v
==496== Use --track-origins=yes to see where uninitialised values come from
==496== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)