Как бы я обнаружил подавленную ошибку в Valgrind? - PullRequest
6 голосов
/ 28 сентября 2011

У меня есть следующий вывод valgrind:

==28099== 
==28099== HEAP SUMMARY: 
==28099==     in use at exit: 0 bytes in 0 blocks
==28099==   total heap usage: 131 allocs, 131 frees, 3,472 bytes allocated
==28099== 
==28099== All heap blocks were freed -- no leaks are possible
==28099== 
==28099== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
--28099-- 
--28099-- used_suppression:      2 dl-hack3-cond-1
--28099-- used_suppression:      2 glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
==28099== 
==28099== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)

Есть 4 подавленных ошибки. Хотя здесь нет утечки, но возникает проблема при портировании на другую систему.

[EDIT]

Я перезапущен с опцией valgrind -v . Но я не нахожу там никаких ошибок.

</p> <pre> ==30287== Memcheck, a memory error detector ==30287== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==30287== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==30287== Command: ./EXECUTABLE1 test_input.txt ==30287== --30287-- Valgrind options: --30287-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp --30287-- -v --30287-- --gen-suppressions=all --30287-- --error-limit=no --30287-- Contents of /proc/version: --30287-- Linux version 2.6.38.3.2.amd64-smp (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 SMP Wed Apr 20 17:36:19 CEST 2011 --30287-- Arch and hwcaps: AMD64, amd64-sse3-cx16 --30287-- Page sizes: currently 4096, max supported 4096 --30287-- Valgrind library directory: /usr/lib/valgrind --30287-- Reading syms from /home/path/to/file(0x400000) --30287-- Reading syms from /lib/ld-2.11.2.so (0x4000000) --30287-- Considering /lib/ld-2.11.2.so .. --30287-- .. CRC mismatch (computed cd91cee9 wanted 11b4673c) --30287-- Considering /usr/lib/debug/lib/ld-2.11.2.so .. --30287-- .. CRC is valid --30287-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000) --30287-- object doesn't have a dynamic symbol table --30287-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp --30287-- Reading suppressions file: /usr/lib/valgrind/default.supp --30287-- REDIR: 0x4016230 (strlen) redirected to 0x380408a7 (vgPlain_amd64_linux_REDIR_FOR_strlen) --30287-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so (0x4a20000) --30287-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c21000) ==30287== WARNING: new redirection conflicts with existing -- ignoring it --30287-- new: 0x04016230 (strlen ) R-> 0x04c25850 strlen --30287-- REDIR: 0x40160a0 (index) redirected to 0x4c25460 (index) --30287-- REDIR: 0x4016120 (strcmp) redirected to 0x4c25e30 (strcmp) --30287-- Reading syms from /lib/libm-2.11.2.so (0x4e29000) --30287-- Considering /lib/libm-2.11.2.so .. --30287-- .. CRC mismatch (computed dd5c85df wanted ccd85fcf) --30287-- Considering /usr/lib/debug/lib/libm-2.11.2.so .. --30287-- .. CRC is valid --30287-- Reading syms from /lib/libc-2.11.2.so (0x50ab000) --30287-- Considering /lib/libc-2.11.2.so .. --30287-- .. CRC mismatch (computed 7d8e8f4f wanted 9b015f2c) --30287-- Considering /usr/lib/debug/lib/libc-2.11.2.so .. --30287-- .. CRC is valid --30287-- REDIR: 0x5128600 (__GI_strrchr) redirected to 0x4c25280 (__GI_strrchr) --30287-- REDIR: 0x51218c0 (malloc) redirected to 0x4c24466 (malloc) --30287-- REDIR: 0x5128d00 (memchr) redirected to 0x4c25ed0 (memchr) --30287-- REDIR: 0x512a750 (memcpy) redirected to 0x4c25f00 (memcpy) --30287-- REDIR: 0x5126b10 (strlen) redirected to 0x4a205ac (_vgnU_ifunc_wrapper) ==30287== WARNING: new redirection conflicts with existing -- ignoring it --30287-- new: 0x05126b40 (__GI_strlen ) R-> 0x04c257f0 strlen --30287-- REDIR: 0x5126b40 (__GI_strlen) redirected to 0x4c25810 (__GI_strlen) --30287-- REDIR: 0x512baf0 (__GI___rawmemchr) redirected to 0x4c26ba0 (__GI___rawmemchr) --30287-- REDIR: 0x51217e0 (free) redirected to 0x4c24076 (free) Following are the keys and their corresponding value present --30287-- REDIR: 0x512bb40 (strchrnul) redirected to 0x4c26b50 (strchrnul)

Ответы [ 3 ]

3 голосов
/ 28 сентября 2011

Вы можете просмотреть / изменить подавленные ошибки в /usr/lib/valgrind/default.supp.

2 голосов
/ 28 сентября 2011

На хостах x86 valgrind выводит такую ​​строку: For counts of detected and suppressed errors, rerun with: -v Запустите вашу прогу так: valgrind -v ./myprog.

2 голосов
/ 28 сентября 2011

Подавленные ошибки - это просто ошибки, характерные для системы, известные проблемы с вашими библиотеками. Таким образом, они не являются подходящими подозреваемыми для проблем переносимости в другой системы.

...