Date: Fri, 26 Feb 2016 19:41:38 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r409636 - in head/devel/valgrind-devel: . files Message-ID: <201602261941.u1QJfcHf088374@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Fri Feb 26 19:41:38 2016 New Revision: 409636 URL: https://svnweb.freebsd.org/changeset/ports/409636 Log: - Update to 3.10.1 - Add pipe(2) syscall - Add cpuset_getaffinity(2) syscall - Support arguments for cpuset_setaffinity(2) syscall - sendfile(2) syscall fixes - getsockopt(2) syscall fixes - Add missing fcntl(2) handlers [1] - Add missing jail syscalls [2] - Add missing kldload syscalls [3] - Add missing accept4(2) syscall [4] PR: 196451 [1] Obtained from: https://bitbucket.org/stass/valgrind-freebsd/issues/15/missing-fcntl-commands [1] PR: 152899 [2] Obtained from: https://bitbucket.org/stass/valgrind-freebsd/pull-requests/10/implement-some-of-the-jails-syscalls/diff [2] Obtained from: https://bitbucket.org/stass/valgrind-freebsd/pull-requests/11/fix-issue-25-add-kldload-kldunload-kldfind/diff [3] Obtained from: https://bitbucket.org/stass/valgrind-freebsd/pull-requests/8/fix-issue-21-accept4-is-unimplemented-on/diff [4] Added: head/devel/valgrind-devel/files/accept4_syscall.patch (contents, props changed) head/devel/valgrind-devel/files/jail_syscalls.patch (contents, props changed) head/devel/valgrind-devel/files/kldload_syscalls.patch (contents, props changed) head/devel/valgrind-devel/files/missing_fcntls.patch (contents, props changed) Modified: head/devel/valgrind-devel/Makefile head/devel/valgrind-devel/distinfo Modified: head/devel/valgrind-devel/Makefile ============================================================================== --- head/devel/valgrind-devel/Makefile Fri Feb 26 19:26:48 2016 (r409635) +++ head/devel/valgrind-devel/Makefile Fri Feb 26 19:41:38 2016 (r409636) @@ -2,9 +2,9 @@ # $FreeBSD$ PORTNAME= valgrind -PORTVERSION= 3.10.0.20150126 +PORTVERSION= 3.10.1.20160113 DISTVERSIONPREFIX= freebsd- -PORTREVISION= 2 +PORTREVISION= 0 PORTEPOCH= 1 CATEGORIES= devel MASTER_SITES= https://bitbucket.org/${BB_ACCOUNT}/${BB_PROJECT}/get/${BB_COMMIT}.tar.gz?dummy=/ \ @@ -14,7 +14,7 @@ PKGNAMESUFFIX= -devel MAINTAINER= bdrewery@FreeBSD.org COMMENT= Memory debugging and profiling tool -BB_COMMIT= 963c4a777573 +BB_COMMIT= ce1acb28953f BB_ACCOUNT= stass BB_PROJECT= valgrind-freebsd @@ -47,6 +47,12 @@ GNU_CONFIGURE= yes USE_LDCONFIG= yes SHEBANG_FILES= callgrind/callgrind_annotate.in callgrind/callgrind_control.in +EXTRA_PATCHES= \ + ${FILESDIR}/accept4_syscall.patch:-p1 \ + ${FILESDIR}/jail_syscalls.patch:-p1 \ + ${FILESDIR}/kldload_syscalls.patch:-p1 \ + ${FILESDIR}/missing_fcntls.patch:-p1 + PORTDOCS= html WRKSRC= ${WRKDIR}/${BB_ACCOUNT}-${BB_PROJECT}-${BB_COMMIT} Modified: head/devel/valgrind-devel/distinfo ============================================================================== --- head/devel/valgrind-devel/distinfo Fri Feb 26 19:26:48 2016 (r409635) +++ head/devel/valgrind-devel/distinfo Fri Feb 26 19:41:38 2016 (r409636) @@ -1,2 +1,2 @@ -SHA256 (valgrind-freebsd-3.10.0.20150126.tar.gz) = 22086b8d36056dbcf0f95b4737e03a206058e4fa97e097a34f4275ded6849103 -SIZE (valgrind-freebsd-3.10.0.20150126.tar.gz) = 12185205 +SHA256 (valgrind-freebsd-3.10.1.20160113.tar.gz) = b580fcacf06befce33a4ba4badaa346b5e57c25774f62af38488dec6ad01eb8c +SIZE (valgrind-freebsd-3.10.1.20160113.tar.gz) = 12084614 Added: head/devel/valgrind-devel/files/accept4_syscall.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/valgrind-devel/files/accept4_syscall.patch Fri Feb 26 19:41:38 2016 (r409636) @@ -0,0 +1,56 @@ +# HG changeset patch +# User Bitbucket <noreply@bitbucket.org> +# Date 0 0 +# Node ID af5523fe25247f537884116bd37e8ce171ba837e +# Parent ce1acb28953fd6928ccb8f9511e374eab66e8625 +# Parent 22cf2727f838e9f5efaeba377341c3807d74dbdb +Merge preview of source (22cf2727f838e9f5efaeba377341c3807d74dbdb) to destination (ce1acb28953fd6928ccb8f9511e374eab66e8625). + +diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r af5523fe25247f537884116bd37e8ce171ba837e coregrind/m_syswrap/syswrap-freebsd.c +--- a/coregrind/m_syswrap/syswrap-freebsd.c ++++ b/coregrind/m_syswrap/syswrap-freebsd.c +@@ -480,6 +480,23 @@ + SET_STATUS_from_SysRes(r); + } + ++PRE(sys_accept4) ++{ ++ *flags |= SfMayBlock; ++ PRINT("sys_accept4 ( %ld, %#lx, %ld, %ld)",ARG1,ARG2,ARG3,ARG4); ++ PRE_REG_READ4(long, "accept4", ++ int, s, struct sockaddr *, addr, int, *addrlen, int, flags); ++ ML_(generic_PRE_sys_accept)(tid, ARG1,ARG2,ARG3); ++} ++POST(sys_accept4) ++{ ++ SysRes r; ++ vg_assert(SUCCESS); ++ r = ML_(generic_POST_sys_accept)(tid, VG_(mk_SysRes_Success)(RES), ++ ARG1,ARG2,ARG3); ++ SET_STATUS_from_SysRes(r); ++} ++ + PRE(sys_sendto) + { + *flags |= SfMayBlock; +@@ -4307,7 +4324,8 @@ + + BSDXY(__NR___semctl, sys___semctl), // 510 + BSDXY(__NR_shmctl, sys_shmctl), // 512 +- ++ ++ BSDXY(__NR_accept4, sys_accept4), //541 + BSDXY(__NR_pipe2, sys_pipe2), // 542 + + BSDX_(__NR_fake_sigreturn, sys_fake_sigreturn), // 1000, fake sigreturn +diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r af5523fe25247f537884116bd37e8ce171ba837e include/vki/vki-scnums-freebsd.h +--- a/include/vki/vki-scnums-freebsd.h ++++ b/include/vki/vki-scnums-freebsd.h +@@ -407,6 +407,7 @@ + #define __NR_posix_openpt 504 + #define __NR___semctl 510 + #define __NR_shmctl 512 ++#define __NR_accept4 541 + #define __NR_pipe2 542 + + #define __NR_fake_sigreturn 1000 Added: head/devel/valgrind-devel/files/jail_syscalls.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/valgrind-devel/files/jail_syscalls.patch Fri Feb 26 19:41:38 2016 (r409636) @@ -0,0 +1,87 @@ +# HG changeset patch +# User Bitbucket <noreply@bitbucket.org> +# Date 0 0 +# Node ID 90c6097540f35e312d34340b916296130003c851 +# Parent ce1acb28953fd6928ccb8f9511e374eab66e8625 +# Parent 5662e704b72c7ebb116f8478a4ff3847acc72fc6 +Merge preview of source (5662e704b72c7ebb116f8478a4ff3847acc72fc6) to destination (ce1acb28953fd6928ccb8f9511e374eab66e8625). + +diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 90c6097540f35e312d34340b916296130003c851 coregrind/m_syswrap/syswrap-freebsd.c +--- a/coregrind/m_syswrap/syswrap-freebsd.c ++++ b/coregrind/m_syswrap/syswrap-freebsd.c +@@ -3670,6 +3670,42 @@ + POST_MEM_WRITE( ARG5, ARG4 ); + } + ++PRE(sys_jail_get) ++{ ++ ++ PRINT("sys_jail_get ( %#lx, %lu, %ld )", ARG1, ARG2, ARG3); ++ PRE_REG_READ3(int, "jail_get", struct vki_iovec *, iov, unsigned int, ++ niov, int, flags); ++ PRE_MEM_WRITE("jail_get", ARG1, ARG2 * sizeof(struct vki_iovec)); ++} ++ ++POST(sys_jail_get) ++{ ++ vg_assert(SUCCESS); ++ if (RES != -1) ++ POST_MEM_WRITE(ARG1, ARG2); ++} ++ ++PRE(sys_jail_set) ++{ ++ PRINT("sys_jail_set ( %#lx, %lu, %ld )", ARG1, ARG2, ARG3); ++ PRE_REG_READ3(int, "jail_set", struct vki_iovec *, iov, unsigned int, ++ niov, int, flags); ++ PRE_MEM_WRITE("jail_set", ARG1, ARG2 * sizeof(struct vki_iovec)); ++} ++ ++PRE(sys_jail_attach) ++{ ++ PRINT("sys_jail_attach ( %ld )", ARG1); ++ PRE_REG_READ1(int, "jail_attach", int, jid); ++} ++ ++PRE(sys_jail_remove) ++{ ++ PRINT("sys_jail_remove ( %ld )", ARG1); ++ PRE_REG_READ1(int, "jail_remove", int, jid); ++} ++ + #undef PRE + #undef POST + +@@ -4219,7 +4255,7 @@ + BSDXY(__NR__umtx_lock, sys__umtx_lock), // 434 + BSDXY(__NR__umtx_unlock, sys__umtx_unlock), // 435 + +- // jail_attach 436 ++ BSDX_(__NR_jail_attach, sys_jail_attach), // 436 + // extattr_list_fd 437 + // extattr_list_file 438 + // extattr_list_link 439 +@@ -4303,6 +4339,10 @@ + BSDX_(__NR_symlinkat, sys_symlinkat), // 502 + BSDX_(__NR_unlinkat, sys_unlinkat), // 503 + ++ BSDXY(__NR_jail_get, sys_jail_get), // 506 ++ BSDX_(__NR_jail_set, sys_jail_set), // 507 ++ BSDX_(__NR_jail_remove, sys_jail_remove), // 508 ++ + // posix_openpt 504 + + BSDXY(__NR___semctl, sys___semctl), // 510 +diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 90c6097540f35e312d34340b916296130003c851 include/vki/vki-scnums-freebsd.h +--- a/include/vki/vki-scnums-freebsd.h ++++ b/include/vki/vki-scnums-freebsd.h +@@ -405,6 +405,9 @@ + #define __NR_symlinkat 502 + #define __NR_unlinkat 503 + #define __NR_posix_openpt 504 ++#define __NR_jail_get 506 ++#define __NR_jail_set 507 ++#define __NR_jail_remove 508 + #define __NR___semctl 510 + #define __NR_shmctl 512 + #define __NR_pipe2 542 Added: head/devel/valgrind-devel/files/kldload_syscalls.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/valgrind-devel/files/kldload_syscalls.patch Fri Feb 26 19:41:38 2016 (r409636) @@ -0,0 +1,127 @@ +# HG changeset patch +# User Bitbucket <noreply@bitbucket.org> +# Date 0 0 +# Node ID 7ecd33d57049211e1084fc5e8bf588da49088d75 +# Parent ce1acb28953fd6928ccb8f9511e374eab66e8625 +# Parent 79bf8f58bec842a1aa94f4fff2e4884a6bb5378b +Merge preview of source (79bf8f58bec842a1aa94f4fff2e4884a6bb5378b) to destination (ce1acb28953fd6928ccb8f9511e374eab66e8625). + +diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 7ecd33d57049211e1084fc5e8bf588da49088d75 coregrind/m_syswrap/syswrap-freebsd.c +--- a/coregrind/m_syswrap/syswrap-freebsd.c ++++ b/coregrind/m_syswrap/syswrap-freebsd.c +@@ -1246,6 +1246,52 @@ + POST_MEM_WRITE( ARG2, sizeof(struct vki_statfs6) ); + } + ++/* --------------------------------------------------------------------- ++ kld* wrappers ++ ------------------------------------------------------------------ */ ++ ++PRE(sys_kldload) ++{ ++ PRINT("sys_kldload ( %#lx(%s) )", ARG1, (char *)ARG1); ++ PRE_REG_READ1(int, "kldload", const char *, "file"); ++ ++ PRE_MEM_RASCIIZ( "kldload(file)", ARG1 ); ++} ++ ++PRE(sys_kldunload) ++{ ++ PRINT("sys_kldunload ( %ld )", ARG1); ++ PRE_REG_READ1(int, "kldunload", int, "fileid"); ++} ++ ++PRE(sys_kldfind) ++{ ++ PRINT("sys_kldfind ( %#lx(%s) )", ARG1, (char *)ARG1); ++ PRE_REG_READ1(int, "kldfind", const char *, "file"); ++ ++ PRE_MEM_RASCIIZ( "kldfind(file)", ARG1 ); ++} ++ ++PRE(sys_kldnext) ++{ ++ PRINT("sys_kldnext ( %ld )", ARG1); ++ PRE_REG_READ1(int, "kldnext", int, "fileid"); ++} ++ ++PRE(sys_kldsym) ++{ ++ PRINT("sys_kldsym ( %ld, %ld, %#lx )", ARG1,ARG2,ARG3 ); ++ PRE_REG_READ3(int, "kldsym", int, "fileid", int, "command", void*, "data"); ++ PRE_MEM_READ( "kldsym(data)", ARG3, sizeof(struct vki_kld_sym_lookup) ); ++ struct vki_kld_sym_lookup *kslp = (struct vki_kld_sym_lookup *)ARG3; ++ PRE_MEM_RASCIIZ( "kldsym(data.symname)", (Addr)kslp->symname ); ++} ++POST(sys_kldsym) ++{ ++ struct vki_kld_sym_lookup *kslp = (struct vki_kld_sym_lookup *)ARG3; ++ POST_MEM_WRITE( (Addr)&kslp->symvalue, sizeof(kslp->symvalue) ); ++ POST_MEM_WRITE( (Addr)&kslp->symsize, sizeof(kslp->symsize) ); ++} + + #if 0 + /* --------------------------------------------------------------------- +@@ -3389,14 +3435,14 @@ + moans--; + VG_(message)(Vg_UserMsg, + "Warning: noted but unhandled ioctl 0x%lx" +- " with no size/direction hints", ++ " with no size/direction hints\n", + ARG2); + VG_(message)(Vg_UserMsg, + " This could cause spurious value errors" +- " to appear."); ++ " to appear.\n"); + VG_(message)(Vg_UserMsg, + " See README_MISSING_SYSCALL_OR_IOCTL for " +- "guidance on writing a proper wrapper." ); ++ "guidance on writing a proper wrapper.\n" ); + } + } else { + if ((dir & _VKI_IOC_WRITE) && size > 0) +@@ -4054,10 +4100,10 @@ + // BSDX_(__NR_modfnext, sys_modfnext), // 302 + BSDX_(__NR_modfind, sys_modfind), // 303 + +-// BSDX_(__NR_kldload, sys_kldload), // 304 +-// BSDX_(__NR_kldunload, sys_kldunload), // 305 +-// BSDX_(__NR_kldfind, sys_kldfind), // 306 +-// BSDX_(__NR_kldnext, sys_kldnext), // 307 ++ BSDX_(__NR_kldload, sys_kldload), // 304 ++ BSDX_(__NR_kldunload, sys_kldunload), // 305 ++ BSDX_(__NR_kldfind, sys_kldfind), // 306 ++ BSDX_(__NR_kldnext, sys_kldnext), // 307 + + // BSDXY(__NR_kldstat, sys_kldstat), // 308 + // BSDX_(__NR_kldfirstmod, sys_kldfirstmod), // 309 +@@ -4095,7 +4141,7 @@ + BSDX_(__NR_utrace, sys_utrace), // 335 + + // compat3 sendfile 336 +-// BSDXY(__NR_kldsym, sys_kldsym), // 337 ++ BSDXY(__NR_kldsym, sys_kldsym), // 337 + // BSDX_(__NR_jail, sys_jail), // 338 + // unimpl pioctl 339 + +diff -r ce1acb28953fd6928ccb8f9511e374eab66e8625 -r 7ecd33d57049211e1084fc5e8bf588da49088d75 include/vki/vki-freebsd.h +--- a/include/vki/vki-freebsd.h ++++ b/include/vki/vki-freebsd.h +@@ -2129,6 +2129,17 @@ + void *spare[3]; + }; + ++//---------------------------------------------------------------------- ++// From sys/linker.h ++//---------------------------------------------------------------------- ++ ++struct vki_kld_sym_lookup { ++ int version; /* set to sizeof(struct kld_sym_lookup) */ ++ char *symname; /* Symbol name we are looking up */ ++ unsigned long symvalue; ++ vki_size_t symsize; ++}; ++ + /*--------------------------------------------------------------------*/ + /*--- end ---*/ + /*--------------------------------------------------------------------*/ Added: head/devel/valgrind-devel/files/missing_fcntls.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/valgrind-devel/files/missing_fcntls.patch Fri Feb 26 19:41:38 2016 (r409636) @@ -0,0 +1,54 @@ +diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c +--- a/coregrind/m_syswrap/syswrap-freebsd.c ++++ b/coregrind/m_syswrap/syswrap-freebsd.c +@@ -3278,9 +3278,12 @@ PRE(sys_fcntl) + + // These ones use ARG3 as "arg". + case VKI_F_DUPFD: ++ case VKI_F_DUPFD_CLOEXEC: + case VKI_F_SETFD: + case VKI_F_SETFL: + case VKI_F_SETOWN: ++ case VKI_F_READAHEAD: ++ case VKI_F_RDAHEAD: + PRINT("sys_fcntl[ARG3=='arg'] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "fcntl", + unsigned int, fd, unsigned int, cmd, unsigned long, arg); +@@ -3300,6 +3303,7 @@ PRE(sys_fcntl) + + // This one uses ARG3 as "oldd" and ARG4 as "newd". + case VKI_F_DUP2FD: ++ case VKI_F_DUP2FD_CLOEXEC: + PRINT("sys_fcntl[ARG3=='oldd', ARG4=='newd'] ( %ld, %ld, %ld, %ld )", + ARG1,ARG2,ARG3,ARG4); + PRE_REG_READ4(long, "fcntl", +@@ -3339,6 +3343,15 @@ POST(sys_fcntl) + ML_(record_fd_open_named)(tid, RES); + } + } ++ else if (ARG2 == VKI_F_DUPFD_CLOEXEC) { ++ if (!ML_(fd_allowed)(RES, "fcntl(DUPFD_CLOEXEC)", tid, True)) { ++ VG_(close)(RES); ++ SET_STATUS_Failure( VKI_EMFILE ); ++ } else { ++ if (VG_(clo_track_fds)) ++ ML_(record_fd_open_named)(tid, RES); ++ } ++ } + } + + PRE(sys_ioctl) +diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h +--- a/include/vki/vki-freebsd.h ++++ b/include/vki/vki-freebsd.h +@@ -1554,6 +1554,10 @@ struct vki_dirent { + #define VKI_F_SETLK 12 /* set record locking information */ + #define VKI_F_SETLKW 13 /* F_SETLK; wait if blocked */ + #define VKI_F_SETLK_REMOTE 14 /* debugging support for remote locks */ ++#define VKI_F_READAHEAD 15 /* read ahead */ ++#define VKI_F_RDAHEAD 16 /* Darwin compatible read ahead */ ++#define VKI_F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ ++#define VKI_F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */ + + /* for F_[GET|SET]FL */ + #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602261941.u1QJfcHf088374>