|
From: <Fra...@we...> - 2016-12-08 13:08:59
|
Hi, I have an embedded linux system similar to the BeagleBone. It runs buildroot on it. # uname -a Linux xenon 4.4.21 #1 PREEMPT Thu Dec 8 12:19:53 CET 2016 armv7l GNU/Linux Within the last days, I enabled valgrind in buildroot (version 3.11.0) to examine memory issues in some programs. Most of the time, when I start valgrind like this: # valgrind --tool=memcheck <path to my program> it exits with a segmentation fault. I tried different programs, small and big, but this does not really seem to make a difference. Most of the time, the output isn't really verbose: # valgrind --tool=memcheck /path/to/program ==470== Memcheck, a memory error detector ==470== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==470== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==470== Command: /path/to/program ==470== Segmentation fault (core dumped) But sometimes I have crashes like this: # valgrind /path/to/otherprogram ==443== Memcheck, a memory error detector ==443== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==443== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==443== Command: /path/to/otherprogram ==443== --443-- warning: DiCfSI 0x38012f58 .. 0x38952f73 is huge; length = 9699356 (NONE) --443-- DWARF2 CFI reader: unhandled CFI instruction 0:36 --443-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting --443-- si_code=1; Faulting address: 0x4200D858; sp: 0x624b4da0 valgrind: the 'impossible' happened: Killed by fatal signal host stacktrace: ==443== at 0x38061360: vgPlain_allocEltPA (m_poolalloc.c:126) sched status: running_tid=1 Thread 1: status = VgTs_Runnable (lwpid 443) ==443== at 0x4019AA4: mmap (mmap.c:36) For me, it looks like an internal error. But perhaps I just missed some important setting to let valgrind run successfully? Any ideas? best regards, Frank |
|
From: John R. <jr...@bi...> - 2016-12-08 13:34:55
|
> Most of the time, when I start valgrind like this: > # valgrind --tool=memcheck <path to my program> > it exits with a segmentation fault. I tried different programs, small and big, but this does not really seem to make a difference. ... Most of the time? Then run valgrind under gdb, get the traceback at the time of the SIGSEGV, and file a bug report against valgrind. $ gdb valgrind (gdb) run --tool=memcheck /path/to/the/smallest/program/which/fails SIGSEGV (gdb) bt > But sometimes I have crashes like this: > --443-- warning: DiCfSI 0x38012f58 .. 0x38952f73 is huge; length = 9699356 (NONE) > --443-- DWARF2 CFI reader: unhandled CFI instruction 0:36 > --443-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting > --443-- si_code=1; Faulting address: 0x4200D858; sp: 0x624b4da0 This indicates a problem with reading the debug symbols. Find the smallest program that ever fails this way, run $ readelf --debug-dump /path/to/my/program Look for "CFI instruction 0:36", and file a bug report against valgrind with relevant information. (For example: paste the whole output onto a pastebin somewhere on the net, and include the URL in the bug report.) [You will get more sympathy (and help) if you run the current version of valgrind, which is 3.12.] |