3

我有 RaspberryPi 4B,最新的 Raspbian 已完全更新。我试图让事情像在 RaspberryPi 3B 上一样工作,但即使简单地hello_world.c执行 viavalgrind也不是没有错误。安装的 valgrind 版本是valgrind-3.7.0.

当我运行这个 hello world 程序时:

#include <stdio.h>
int main() {
    puts("Hello, World!");
    return 0;
}

使用编译gcc t.c -o t -g和执行使用valgrind ./t我得到吨这样的错误:

==5542== Memcheck, a memory error detector
==5542== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==5542== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==5542== Command: ./t
==5542== 
--5542-- WARNING: Serious error when reading debug info
--5542-- When reading debug info from /lib/arm-linux-gnueabihf/ld-2.28.so:
--5542-- Ignoring non-Dwarf2/3/4 block in .debug_info
--5542-- WARNING: Serious error when reading debug info
--5542-- When reading debug info from /lib/arm-linux-gnueabihf/ld-2.28.so:
--5542-- Last block truncated in .debug_info; ignoring
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x401A5D0: index (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x401A5D4: index (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x4008040: _dl_dst_count (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x4008288: expand_dynamic_string_token (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x401AA80: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x401AA84: strlen (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x4017F68: malloc (in /lib/arm-linux-gnueabihf/ld-2.28.so)

.....

==5542== Use of uninitialised value of size 4
==5542==    at 0x40103D4: _dl_init (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Use of uninitialised value of size 4
==5542==    at 0x400FA00: _dl_fixup (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x400FA8C: _dl_fixup (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Use of uninitialised value of size 4
==5542==    at 0x400FA8C: _dl_fixup (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Use of uninitialised value of size 4
==5542==    at 0x4015B4C: _dl_runtime_resolve (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
Hello, World!
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x40105D0: _dl_fini (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x4016178: _dl_sort_maps (in /lib/arm-linux-gnueabihf/ld-2.28.so)
==5542== 
==5542== Use of uninitialised value of size 4
==5542==    at 0x48F8824: free (in /lib/arm-linux-gnueabihf/libc-2.28.so)
==5542== 
==5542== Use of uninitialised value of size 4
==5542==    at 0x499F050: free_mem (in /lib/arm-linux-gnueabihf/libc-2.28.so)
==5542== 
==5542== Conditional jump or move depends on uninitialised value(s)
==5542==    at 0x499F0D0: free_mem (in /lib/arm-linux-gnueabihf/libc-2.28.so)
==5542== 
==5542== Use of uninitialised value of size 4
==5542==    at 0x499EF64: free_slotinfo (in /lib/arm-linux-gnueabihf/libc-2.28.so)
==5542== 
==5542== 
==5542== HEAP SUMMARY:
==5542==     in use at exit: 0 bytes in 0 blocks
==5542==   total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
==5542== 
==5542== All heap blocks were freed -- no leaks are possible
==5542== 
==5542== For counts of detected and suppressed errors, rerun with: -v
==5542== Use --track-origins=yes to see where uninitialised values come from
==5542== ERROR SUMMARY: 4732 errors from 193 contexts (suppressed: 87 from 1)

有谁知道该怎么做?

感谢提前!

4

0 回答 0