Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Dec 2013 12:22:31 GMT
From:      Robert David <robert.david.public@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/185292: devel/valgrind does not work on -stable/10
Message-ID:  <201312301222.rBUCMVpG067555@oldred.freebsd.org>
Resent-Message-ID: <201312301230.rBUCU09S082646@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         185292
>Category:       ports
>Synopsis:       devel/valgrind does not work on -stable/10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 30 12:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Robert David
>Release:        10.0-PRERELEASE (rc3)
>Organization:
none
>Environment:
FreeBSD notebook.linsystem.net 10.0-PRERELEASE FreeBSD 10.0-PRERELEASE #4 53624fa(HEAD): Mon Dec 30 12:34:25 CET 2013     root@notebook.linsystem.net:/usr/obj/rpool/FREEBSD/src/sys/thinkpad_02  amd64

>Description:
Installed devel/valgrind and it compiles fine.

Run any program with valgrind and it shows no allocs at all.

valgrind -v ./leaking_program >/dev/null
==2780== Memcheck, a memory error detector
==2780== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.==2780== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2780== Command: ./leaking_program
==2780==
--2780-- Valgrind options:
--2780--    -v
--2780-- Contents of /proc/version:
--2780-- Arch and hwcaps: AMD64, amd64-sse3-cx16
--2780-- Page sizes: currently 4096, max supported 4096
--2780-- Valgrind library directory: /usr/local/lib/valgrind
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- Reading syms from /usr/local/lib/valgrind/memcheck-amd64-freebsd
--2780--    object doesn't have a symbol table
--2780--    object doesn't have a dynamic symbol table
--2780-- Scheduler: using generic scheduler lock implementation.
--2780-- Reading suppressions file: /usr/local/lib/valgrind/default.supp
==2780== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2780-by-robert-on-???
==2780== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-2780-by-robert-on-???
==2780== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-2780-by-robert-on-???
==2780==
==2780== TO CONTROL THIS PROCESS USING vgdb (which you probably
==2780== don't want to do, unless you know exactly what you're doing,
==2780== or are doing some strange experiment):
==2780==   /usr/local/lib/valgrind/../../bin/vgdb --pid=2780 ...command...
==2780==
==2780== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==2780==   /path/to/gdb ./batoh_bnb
==2780== and then give GDB the following command
==2780==   target remote | /usr/local/lib/valgrind/../../bin/vgdb --pid=2780
==2780== --pid is optional if only one valgrind process is running
==2780==
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
--2780-- WARNING: Serious error when reading debug info
--2780-- When reading debug info from [unknown]:
--2780-- failed to stat64/stat this file
==2780==
==2780== HEAP SUMMARY:
==2780==     in use at exit: 0 bytes in 0 blocks
==2780==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==2780==
==2780== All heap blocks were freed -- no leaks are possible
==2780==
==2780== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==2780== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


Also submitted bug to bitbucket valgrind-freebsd repository, but think this is better place to do so.
https://bitbucket.org/stass/valgrind-freebsd/issue/12/not-working-on-freebsd-10

First impression is that vki_kinfo_file structure is out of sync with current sys/user.h. But manually syncing, makes debug symbols load but lead to a crash. I will fill another PR for the crash since I dont think it is directly connected with this PR.
>How-To-Repeat:
on stable/10 run "valgrind -v any_program"
>Fix:
Sync vki_kinfo_file structure with kinfo_file in sys/user.h. Or update the includes to automaticly use system headers.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312301222.rBUCMVpG067555>