Почему Valgrind падает в Core Dump при запуске?

218
19 декабря 2016, 19:43

Valgrind версии 3.8.1 падает в кору при пробном запуске:

> 7367-Slot12# ./valgrind ls -l
> ==7430== Memcheck, a memory error detector
> ==7430== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==7430== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==7430== Command: ls -l
> ==7430== Killed (core dumped)

Он был кросскопмилирован под систему:

7367-Slot12# uname -a
Linux 7367-Slot12 2.6.27.39-grsec #2 SMP PREEMPT Tue Dec 4 09:19:05 CET 2012 x86_64 x86_64 x86_64 GNU/Linux

с следующими параметрами:

home/dtm463/valgrind> ./configure CC=/vob/windriver-m2/sysroots/toolchain/gcc CXX=/vob/windriver-m2/sysroots/toolchain/g++ AR=/vob/windriver-m2/sysroots/toolchain/ar CXX_FLAGS="-g -O0" --prefix=/amd/zru11sun30/export/u3/dtm463/valgrind --host amd64-linux-gnu LD=/vob/windriver-m2/sysroots/toolchain/ld

Core Dump имеет следующее имя:

core.memcheck-amd64-_2454_9_1372263826

Однако, back trace этого Core dump'a на мой взгляд ничего полезного не несет:

7367-Slot12# gdb valgrind /core/core.memcheck-amd64-_2454_9_1372263826
GNU gdb (Wind River Linux Sourcery G++ 4.3-237) 6.8.50.20080821-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i586-wrs-linux-gnu".
For bug reporting instructions, please see:
<support@windriver.com>...
warning: core file may not match specified executable file.
Failed to read a valid object file image from memory.
Core was generated by `./valgrind ls -l'.
Program terminated with signal 9, Killed.
[New process 2454]
#0  0x00000004037a8000 in ?? ()

Вот verbose вывод того, что он пишет перед смертью:

> 7367-Slot12# ./valgrind -v ls -l
> ==10019== Memcheck, a memory error detector
> ==10019== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
> ==10019== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
> ==10019== Command: ls -l
> ==10019==
> --10019-- Valgrind options:
> --10019--    -v
> --10019-- Contents of /proc/version:
> --10019--   Linux version 2.6.27.39-grsec (build@nemo.force.de) (gcc version 4.3.2 (Wind River Linux
> Sourcery G++ 4.3-237) ) #2 SMP PREEMPT
> Tue Dec 4 09:19:05 CET 2012
> --10019-- Arch and hwcaps: AMD64, amd64-sse3-cx16
> --10019-- Page sizes: currently 4096, max supported 4096
> --10019-- Valgrind library directory: /amd/zru11sun30/export/u3/dtm463/valgrind/lib/valgrind
> --10019-- Reading syms from /bin/ls
> --10019--    object doesn't have a symbol table
> --10019-- Reading syms from /amd/zru11sun30/export/u3/dtm463/valgrind/lib/valgrind/memcheck-amd64-linux
> --10019--    object doesn't have a dynamic symbol table
> --10019-- Reading syms from /lib64/ld-2.8.so
> --10019--    object doesn't have a symbol table
> --10019-- Scheduler: using generic scheduler lock implementation.
> --10019-- Reading suppressions file: /amd/zru11sun30/export/u3/dtm463/valgrind/lib/valgrind/default.supp
> ==10019== embedded gdbserver: reading from
> /tmp/vgdb-pipe-from-vgdb-to-10019-by-root-on-???
> ==10019== embedded gdbserver: writing to  
> /tmp/vgdb-pipe-to-vgdb-from-10019-by-root-on-???
> ==10019== embedded gdbserver: shared mem  
> /tmp/vgdb-pipe-shared-mem-vgdb-10019-by-root-on-???
> ==10019==
> ==10019== TO CONTROL THIS PROCESS USING vgdb (which you probably
> ==10019== don't want to do, unless you know exactly what you're doing,
> ==10019== or are doing some strange experiment):
> ==10019==   /amd/zru11sun30/export/u3/dtm463/valgrind/lib/valgrind/../../bin/vgdb
> --pid=10019 ...command...
> ==10019==
> ==10019== TO DEBUG THIS PROCESS USING GDB: start GDB like this
> ==10019==   /path/to/gdb ls
> ==10019== and then give GDB the following command
> ==10019==   target remote | /amd/zru11sun30/export/u3/dtm463/valgrind/lib/valgrind/../../bin/vgdb
> --pid=10019
> ==10019== --pid is optional if only one valgrind process is running
> ==10019== Killed (core dumped)

Может у кого-нибудь есть идеи почему такое может быть и как это вообще лечится?

READ ALSO
Вывод из функции

Вывод из функции

Есть функция main(), которая вызывает ф-ию addcat()В ф-ии addcat() должен осуществляться вывод printf("sud")

230
Ошибка доступа при логине

Ошибка доступа при логине

При первом вызове addacc() все проходит успешноПри втором выдаёт ошибку после ввода логина

222
Прогресс сериализации цепочки классов.

Прогресс сериализации цепочки классов.

Обновил задание на более прикладное: Необходимо выяснить, каков прогресс сериализации объектов классов(ну как полоска загрузки файла с сайта)

201