Using Valgrind on FreeBSD

Omer Faruk SEN omerfsen at gmail.com
Sat Oct 8 07:24:53 UTC 2011


Hi,

May it be related with the patches for Valgrind that
http://people.freebsd.org/~romain/valgrind/ written? It may require to
rebuild valgrind with that patch but I am not sure. Maybe Romain can answer
that question. Romain I have tried to use your patches against latest
valgrind port:

# Date created:                         April 19 2004
# Whom:                                 Simon Barner <barner at gmx.de>
#
# $FreeBSD: ports/devel/valgrind/Makefile,v 1.50 2011/04/27 09:51:08 stas
Exp $
#

PORTNAME=       valgrind
PORTVERSION=    3.6.1
PORTREVISION=   2
PORTEPOCH=      1


but I got

cc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -DVGA_amd64=1
-DVGO_freebsd=1 -DVGP_amd64_freebsd=1 -I../coregrind
-DVG_LIBDIR="\"/usr/local/lib/valgrind"\" -DVG_PLATFORM="\"amd64-freebsd\""
-m64 -fomit-frame-pointer -O2 -g -Wall -Wmissing-prototypes -Wshadow
-Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
-Wno-format-zero-length -fno-strict-aliasing -Wno-long-long -O2 -pipe
-funroll-loops -fno-strict-aliasing -Wno-pointer-sign -fno-stack-protector
-MT libcoregrind_amd64_freebsd_a-syswrap-freebsd.o -MD -MP -MF
.deps/libcoregrind_amd64_freebsd_a-syswrap-freebsd.Tpo -c -o
libcoregrind_amd64_freebsd_a-syswrap-freebsd.o `test -f
'm_syswrap/syswrap-freebsd.c' || echo './'`m_syswrap/syswrap-freebsd.c
m_syswrap/syswrap-freebsd.c:3989: error: '__NR_mq_open' undeclared here (not
in a function)
m_syswrap/syswrap-freebsd.c:3989: error: array index in initializer not of
integer type
m_syswrap/syswrap-freebsd.c:3989: error: (near initialization for
'vgModuleLocal_syscall_table')
m_syswrap/syswrap-freebsd.c:3990: error: '__NR_mq_getsetattr' undeclared
here (not in a function)
m_syswrap/syswrap-freebsd.c:3990: error: array index in initializer not of
integer type
m_syswrap/syswrap-freebsd.c:3990: error: (near initialization for
'vgModuleLocal_syscall_table')
m_syswrap/syswrap-freebsd.c:3991: error: '__NR_mq_timedreceive' undeclared
here (not in a function)
m_syswrap/syswrap-freebsd.c:3991: error: array index in initializer not of
integer type
m_syswrap/syswrap-freebsd.c:3991: error: (near initialization for
'vgModuleLocal_syscall_table')
m_syswrap/syswrap-freebsd.c:3993: error: '__NR_mq_timedsend' undeclared here
(not in a function)
m_syswrap/syswrap-freebsd.c:3993: error: array index in initializer not of
integer type
m_syswrap/syswrap-freebsd.c:3993: error: (near initialization for
'vgModuleLocal_syscall_table')
m_syswrap/syswrap-freebsd.c:3994: error: '__NR_mq_notify' undeclared here
(not in a function)
m_syswrap/syswrap-freebsd.c:3994: error: array index in initializer not of
integer type
m_syswrap/syswrap-freebsd.c:3994: error: (near initialization for
'vgModuleLocal_syscall_table')
m_syswrap/syswrap-freebsd.c:3995: error: '__NR_mq_unlink' undeclared here
(not in a function)
m_syswrap/syswrap-freebsd.c:3995: error: array index in initializer not of
integer type
m_syswrap/syswrap-freebsd.c:3995: error: (near initialization for
'vgModuleLocal_syscall_table')
gmake[3]: *** [libcoregrind_amd64_freebsd_a-syswrap-freebsd.o] Error 1
gmake[3]: Leaving directory
`/usr/ports/devel/valgrind/work/valgrind-freebsd-3.6.1-2/coregrind'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/usr/ports/devel/valgrind/work/valgrind-freebsd-3.6.1-2/coregrind'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory
`/usr/ports/devel/valgrind/work/valgrind-freebsd-3.6.1-2'
gmake: *** [all] Error 2
*** Error code 1

Stop in /usr/ports/devel/valgrind.
*** Error code 1

Stop in /usr/ports/devel/valgrind.


2011/10/7 <mdf at freebsd.org>

> 2011/10/7 Mustafa Reşit Şahin <resitsahin at gmail.com>:
> > I am trying to run Valgrind on FreeBSD. I am getting the error about
> > ksem_open which i stated below. I have searched for  a solution to be
> able
> > to solve this problem and found the calgrind patch. I could not found the
> > instructions to apply this patch. How can i use valgrind on FreeBSD with
> > ksem_open enabled?
>
> It looks like that syscall is only available when the
> P1003_1B_SEMAPHORES option is in your kernel config.  You will need to
> edit a kernel configuration file and rebuild / reinstall the kernel.
>
> Thanks,
> matthew
>
>
> > I use valgrind version:  valgrind-3.6.0
> > FreeBSD Version :FreeBSD 8.1-RELEASE-p2 FreeBSD 8.1-RELEASE-p2 #6:  amd64
> >
> > The error i get : (The valgrind output)
> >
> >
> > --84521-- WARNING: unhandled syscall: 404
> > ==84521==    at 0x144E2BC: __sys_ksem_init (in /lib/libc.so.7)
> > ==84521==    by 0x14422FE: sem_init (in /lib/libc.so.7)
> > ==84521==    by 0x1639BBB: snf__sem_ring_open (in
> > /usr/local/opt/snf/lib/libsnf.so.0.3)
> > ==84521==    by 0x163A1AC: snf__open_endpoint_ring (in
> > /usr/local/opt/snf/lib/libsnf.so.0.3)
> > ==84521==    by 0x163A5A3: snf__board_open (in
> > /usr/local/opt/snf/lib/libsnf.so.0.3)
> > ==84521==    by 0x1637A7A: snf_open (in
> > /usr/local/opt/snf/lib/libsnf.so.0.3)
> > ==84521==    by 0xF04DBA: snf_activate (in
> > /usr/local/opt/snf/lib/libpcap.so.1.1.1)
> > ==84521==    by 0xF05C26: pcap_activate (in
> > /usr/local/opt/snf/lib/libpcap.so.1.1.1)
> > ==84521==    by 0xF0624A: pcap_open_live (in
> > /usr/local/opt/snf/lib/libpcap.so.1.1.1)
> > ==84521==    by 0x452B4D: ??? (in /usr/sbin/tcpdump)
> > ==84521==    by 0x402E4D: ??? (in /usr/sbin/tcpdump)
> > ==84521==    by 0x41FFF: ???
> > --84521-- You may be able to write your own handler.
> > --84521-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
> > --84521-- Nevertheless we consider this a bug.  Please report
> > --84521-- it at http://valgrind.org/support/bug_reports.html.
> > _______________________________________________
> > freebsd-hackers at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> > To unsubscribe, send any mail to "
> freebsd-hackers-unsubscribe at freebsd.org"
> >
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list