2013-12-09 3 views
0

У меня есть регистр Распределитель реализован с живучестью анализом, и я получаю ошибку сегм:Чтения вывод таНоса

Program received signal SIGSEGV, Segmentation fault. 
0x00007ffff7560d9d in _int_malloc() from /lib64/libc.so.6 

Так что я побежал на Valgrind, пытаясь увидеть, что ошибка iwth этой команды:

valgrind -v --leak-check=yes 

Я никогда раньше не использовал эту программу, и я действительно не знаю, почему происходит ошибка seg. Я где-то подозреваю утечку памяти. Может ли кто-нибудь помочь мне понять, что говорит валгринд?

--58831-- Reading syms from /lib64/ld-2.11.3.so (0x4000000) 
--58831-- Reading syms from /usr/lib64/valgrind/amd64-linux/memcheck (0x38000000) 
--58831-- object doesn't have a symbol table 
--58831-- object doesn't have a dynamic symbol table 
--58831-- Reading suppressions file: /usr/lib64/valgrind/default.supp 
==58831== Conditional jump or move depends on uninitialised value(s) 
==58831== at 0x401677D: strlen (in /lib64/ld-2.11.3.so) 
==58831== by 0x4005072: fillin_rpath (in /lib64/ld-2.11.3.so) 
==58831== by 0x40086D8: _dl_init_paths (in /lib64/ld-2.11.3.so) 
==58831== by 0x400311F: dl_main (in /lib64/ld-2.11.3.so) 
==58831== by 0x4014AD2: _dl_sysdep_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x40013CB: _dl_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x4000B07: (within /lib64/ld-2.11.3.so) 
==58831== by 0x2: ??? 
==58831== by 0x7FF00057E: ??? 
==58831== by 0x7FF000584: ??? 
==58831== by 0x7FF000587: ??? 
--58831-- Reading syms from /usr/lib64/valgrind/amd64-linux/vgpreload_core.so (0x4A21000) 
--58831-- object doesn't have a symbol table 
==58831== 
==58831== Conditional jump or move depends on uninitialised value(s) 
==58831== at 0x4016616: index (in /lib64/ld-2.11.3.so) 
==58831== by 0x4007682: expand_dynamic_string_token (in /lib64/ld-2.11.3.so) 
==58831== by 0x4007C75: _dl_map_object (in /lib64/ld-2.11.3.so) 
==58831== by 0x400184D: map_doit (in /lib64/ld-2.11.3.so) 
==58831== by 0x400DE45: _dl_catch_error (in /lib64/ld-2.11.3.so) 
==58831== by 0x4001766: do_preload (in /lib64/ld-2.11.3.so) 
==58831== by 0x4003D3F: dl_main (in /lib64/ld-2.11.3.so) 
==58831== by 0x4014AD2: _dl_sysdep_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x40013CB: _dl_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x4000B07: (within /lib64/ld-2.11.3.so) 
==58831== by 0x2: ??? 
==58831== by 0x7FF00057E: ??? 
==58831== 
==58831== Conditional jump or move depends on uninitialised value(s) 
==58831== at 0x401661B: index (in /lib64/ld-2.11.3.so) 
==58831== by 0x4007682: expand_dynamic_string_token (in /lib64/ld-2.11.3.so) 
==58831== by 0x4007C75: _dl_map_object (in /lib64/ld-2.11.3.so) 
==58831== by 0x400184D: map_doit (in /lib64/ld-2.11.3.so) 
==58831== by 0x400DE45: _dl_catch_error (in /lib64/ld-2.11.3.so) 
==58831== by 0x4001766: do_preload (in /lib64/ld-2.11.3.so) 
==58831== by 0x4003D3F: dl_main (in /lib64/ld-2.11.3.so) 
==58831== by 0x4014AD2: _dl_sysdep_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x40013CB: _dl_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x4000B07: (within /lib64/ld-2.11.3.so) 
==58831== by 0x2: ??? 
==58831== by 0x7FF00057E: ??? 
--58831-- Reading syms from /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so  (0x4C23000) 
--58831-- object doesn't have a symbol table 
--58831-- REDIR: 0x40165b0 (index) redirected to 0x4c27ba0 (index) 
--58831-- REDIR: 0x4016630 (strcmp) redirected to 0x4c28160 (strcmp) 
--58831-- REDIR: 0x4016740 (strlen) redirected to 0x4c27e60 (strlen) 
--58831-- Reading syms from /usr/lib64/libstdc++.so.6.0.17 (0x4E2C000) 
--58831-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x2a 

valgrind: m_debuginfo/readdwarf.c:2152 (copy_convert_CfiExpr_tree): Assertion 'srcix >= 0  && srcix < VG_(sizeXA)(srcxa)' failed. 
==58831== at 0x3801C15C: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x3801C46A: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x380560A1: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x3805635D: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x38056BAB: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x380586BA: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x38053BFD: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x380356C0: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x3806BFC3: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x3806FE93: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x38039886: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x38036CB2: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x38037CD7: (within /usr/lib64/valgrind/amd64-linux/memcheck) 
==58831== by 0x38049A70: (within /usr/lib64/valgrind/amd64-linux/memcheck) 

sched status: 
    running_tid=1 

Thread 1: status = VgTs_Runnable 
==58831== at 0x40161AA: mmap (in /lib64/ld-2.11.3.so) 
==58831== by 0x40065DA: _dl_map_object_from_fd (in /lib64/ld-2.11.3.so) 
==58831== by 0x4007D1C: _dl_map_object (in /lib64/ld-2.11.3.so) 
==58831== by 0x400D401: openaux (in /lib64/ld-2.11.3.so) 
==58831== by 0x400DE45: _dl_catch_error (in /lib64/ld-2.11.3.so) 
==58831== by 0x400C48F: _dl_map_object_deps (in /lib64/ld-2.11.3.so) 
==58831== by 0x40032DF: dl_main (in /lib64/ld-2.11.3.so) 
==58831== by 0x4014AD2: _dl_sysdep_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x40013CB: _dl_start (in /lib64/ld-2.11.3.so) 
==58831== by 0x4000B07: (within /lib64/ld-2.11.3.so) 
==58831== by 0x2: ??? 
==58831== by 0x7FF00057E: ??? 
==58831== by 0x7FF000584: ??? 
==58831== by 0x7FF000587: ??? 

ответ

0

Мне кажется, что вы не добавляли символы отладки при компиляции своей программы. Если вы используете GCC, добавьте «-ggdb» в свою команду компиляции. Например, если вы написали:

gcc -o program main.c 

Изменить это:

gcc -o program main.c -ggdb 

Тогда Valgrind будет в состоянии связать возможные ошибки в коде. Кроме того, я не думаю, что вам понадобится флаг «-v» в команде Valgrind.

Удачи!