Bug 185292 - devel/valgrind does not work on -stable/10
Summary: devel/valgrind does not work on -stable/10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-30 12:30 UTC by Robert David
Modified: 2014-01-22 18:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert David 2013-12-30 12:30:00 UTC
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.

Fix: 

Sync vki_kinfo_file structure with kinfo_file in sys/user.h. Or update the includes to automaticly use system headers.
How-To-Repeat: on stable/10 run "valgrind -v any_program"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-30 12:30:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bdrewery

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-22 18:11:37 UTC
Author: bdrewery
Date: Wed Jan 22 18:11:29 2014
New Revision: 340728
URL: http://svnweb.freebsd.org/changeset/ports/340728
QAT: https://qat.redports.org/buildarchive/r340728/

Log:
  - Bump PORTREVISION to ensure rebuild after HEAD r260290 to fix
    on head, stable/10
  
  PR:		ports/185292
  Reported by:	Robert David <robert.david.public@gmail.com>

Modified:
  head/devel/valgrind-devel/Makefile
  head/devel/valgrind/Makefile

Modified: head/devel/valgrind-devel/Makefile
==============================================================================
--- head/devel/valgrind-devel/Makefile	Wed Jan 22 18:07:59 2014	(r340727)
+++ head/devel/valgrind-devel/Makefile	Wed Jan 22 18:11:29 2014	(r340728)
@@ -3,6 +3,7 @@
 
 PORTNAME=	valgrind
 PORTVERSION=	3.8.1
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://cdn.bitbucket.org/stass/valgrind-freebsd/downloads/ \

Modified: head/devel/valgrind/Makefile
==============================================================================
--- head/devel/valgrind/Makefile	Wed Jan 22 18:07:59 2014	(r340727)
+++ head/devel/valgrind/Makefile	Wed Jan 22 18:11:29 2014	(r340728)
@@ -3,6 +3,7 @@
 
 PORTNAME=	valgrind
 PORTVERSION=	3.8.1
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://cdn.bitbucket.org/stass/valgrind-freebsd/downloads/ \
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2014-01-22 18:11:52 UTC
State Changed
From-To: open->closed

The change was reverted in HEAD, stable/10 and releng/10.0 before 
release. Rebuild valgrind.