From owner-svn-src-user@freebsd.org Sun Aug 14 22:08:30 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78530BBA607 for ; Sun, 14 Aug 2016 22:08:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 354F31002; Sun, 14 Aug 2016 22:08:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EM8Tf3014578; Sun, 14 Aug 2016 22:08:29 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EM8QJJ014544; Sun, 14 Aug 2016 22:08:26 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608142208.u7EM8QJJ014544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 14 Aug 2016 22:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304103 - in user/alc/PQ_LAUNDRY: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contr... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2016 22:08:30 -0000 Author: alc Date: Sun Aug 14 22:08:25 2016 New Revision: 304103 URL: https://svnweb.freebsd.org/changeset/base/304103 Log: MFC r304102 Added: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c - copied unchanged from r304102, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu - copied unchanged from r304102, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure744.c - copied unchanged from r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure745.c - copied unchanged from r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure746.c - copied unchanged from r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/cat/test/test_version.c user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/cmdline.c user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/test/test_option_version.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_match.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_ppmd7_private.h user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_add_passphrase.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_posix.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_private.h user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_lha.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_warc.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_util.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_acl.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_posix.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_ustar.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/main.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test.h user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_archive_string_conversion.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_fuzz.c user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_rar.c user/alc/PQ_LAUNDRY/contrib/libarchive/tar/cmdline.c user/alc/PQ_LAUNDRY/contrib/libarchive/tar/test/test_version.c user/alc/PQ_LAUNDRY/etc/portsnap.conf user/alc/PQ_LAUNDRY/lib/libarchive/tests/Makefile user/alc/PQ_LAUNDRY/lib/libthr/arch/mips/include/pthread_md.h user/alc/PQ_LAUNDRY/sbin/ipfw/ipfw2.c user/alc/PQ_LAUNDRY/sbin/ipfw/nat64lsn.c user/alc/PQ_LAUNDRY/sbin/ipfw/nat64stl.c user/alc/PQ_LAUNDRY/sbin/ipfw/nptv6.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10_ehci.c user/alc/PQ_LAUNDRY/sys/ddb/db_ps.c user/alc/PQ_LAUNDRY/sys/ddb/db_run.c user/alc/PQ_LAUNDRY/sys/dev/ofw/ofwpci.c user/alc/PQ_LAUNDRY/sys/i386/i386/db_trace.c user/alc/PQ_LAUNDRY/sys/i386/include/db_machdep.h user/alc/PQ_LAUNDRY/sys/kern/kern_exec.c user/alc/PQ_LAUNDRY/sys/kern/subr_pcpu.c user/alc/PQ_LAUNDRY/sys/kern/uipc_shm.c user/alc/PQ_LAUNDRY/sys/powerpc/mpc85xx/mpc85xx.c user/alc/PQ_LAUNDRY/sys/powerpc/mpc85xx/platform_mpc85xx.c user/alc/PQ_LAUNDRY/sys/vm/vm_glue.c user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/calendar.holiday user/alc/PQ_LAUNDRY/usr.bin/nfsstat/Makefile Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) user/alc/PQ_LAUNDRY/contrib/libarchive/ (props changed) user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/ (props changed) user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/ (props changed) user/alc/PQ_LAUNDRY/contrib/libarchive/tar/ (props changed) Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/cat/test/test_version.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/cat/test/test_version.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/cat/test/test_version.c Sun Aug 14 22:08:25 2016 (r304103) @@ -83,7 +83,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/cmdline.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/cmdline.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/cmdline.c Sun Aug 14 22:08:25 2016 (r304103) @@ -63,6 +63,7 @@ static const struct option { } cpio_longopts[] = { { "b64encode", 0, OPTION_B64ENCODE }, { "create", 0, 'o' }, + { "dereference", 0, 'L' }, { "dot", 0, 'V' }, { "extract", 0, 'i' }, { "file", 1, 'F' }, Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/test/test_option_version.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/test/test_option_version.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/cpio/test/test_option_version.c Sun Aug 14 22:08:25 2016 (r304103) @@ -75,7 +75,7 @@ verify(const char *p, size_t s) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_match.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_match.c Sun Aug 14 22:08:25 2016 (r304103) @@ -655,7 +655,7 @@ add_pattern_from_file(struct archive_mat } } - /* If something error happend, report it immediately. */ + /* If an error occurred, report it immediately. */ if (r < ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar); Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_ppmd7_private.h ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_ppmd7_private.h Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_ppmd7_private.h Sun Aug 14 22:08:25 2016 (r304103) @@ -19,7 +19,7 @@ If you need the compatibility with origi #define PPMD7_MAX_ORDER 64 #define PPMD7_MIN_MEM_SIZE (1 << 11) -#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3) +#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3) struct CPpmd7_Context_; Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_add_passphrase.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_add_passphrase.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_add_passphrase.c Sun Aug 14 22:08:25 2016 (r304103) @@ -125,7 +125,7 @@ void __archive_read_reset_passphrase(struct archive_read *a) { - a->passphrases.candiate = -1; + a->passphrases.candidate = -1; } /* @@ -137,31 +137,31 @@ __archive_read_next_passphrase(struct ar struct archive_read_passphrase *p; const char *passphrase; - if (a->passphrases.candiate < 0) { + if (a->passphrases.candidate < 0) { /* Count out how many passphrases we have. */ int cnt = 0; for (p = a->passphrases.first; p != NULL; p = p->next) cnt++; - a->passphrases.candiate = cnt; + a->passphrases.candidate = cnt; p = a->passphrases.first; - } else if (a->passphrases.candiate > 1) { + } else if (a->passphrases.candidate > 1) { /* Rotate a passphrase list. */ - a->passphrases.candiate--; + a->passphrases.candidate--; p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); - /* Pick a new passphrase candiate up. */ + /* Pick a new passphrase candidate up. */ p = a->passphrases.first; - } else if (a->passphrases.candiate == 1) { - /* This case is that all cadiates failed to decryption. */ - a->passphrases.candiate = 0; + } else if (a->passphrases.candidate == 1) { + /* This case is that all candidates failed to decrypt. */ + a->passphrases.candidate = 0; if (a->passphrases.first->next != NULL) { /* Rotate a passphrase list. */ p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); } p = NULL; - } else /* There is no passphrase candaite. */ + } else /* There is no passphrase candidate. */ p = NULL; if (p != NULL) @@ -177,7 +177,7 @@ __archive_read_next_passphrase(struct ar if (p == NULL) return (NULL); insert_passphrase_to_head(a, p); - a->passphrases.candiate = 1; + a->passphrases.candidate = 1; } } else passphrase = NULL; Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Aug 14 22:08:25 2016 (r304103) @@ -641,13 +641,16 @@ translate_acl(struct archive_read_disk * * Libarchive stores "flag" (NFSv4 inheritance bits) * in the ae_perm bitmap. */ - acl_get_flagset_np(acl_entry, &acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) - ae_perm |= acl_inherit_map[i].archive_inherit; - - } + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit)) + ae_perm |= acl_inherit_map[i].archive_inherit; + } + } #endif acl_get_permset(acl_entry, &acl_permset); Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Aug 14 22:08:25 2016 (r304103) @@ -938,7 +938,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_path_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1041,7 +1041,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_time_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1067,7 +1067,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_owner_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_private.h Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_private.h Sun Aug 14 22:08:25 2016 (r304103) @@ -221,7 +221,7 @@ struct archive_read { struct { struct archive_read_passphrase *first; struct archive_read_passphrase **last; - int candiate; + int candidate; archive_passphrase_callback *callback; void *client_data; } passphrases; Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Sun Aug 14 22:08:25 2016 (r304103) @@ -595,7 +595,7 @@ lz4_filter_read_data_block(struct archiv #endif } - /* Check if an error happend in decompression process. */ + /* Check if an error occurred in the decompression process. */ if (uncompressed_size < 0) { archive_set_error(&(self->archive->archive), ARCHIVE_ERRNO_MISC, "lz4 decompression failed"); Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 14 22:08:25 2016 (r304103) @@ -1715,8 +1715,11 @@ lha_crc16(uint16_t crc, const void *pp, #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) -#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ - || defined(__clang__) +#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) +/* GCC 4.8 and later has __builtin_bswap16() */ +# define bswap16(x) __builtin_bswap16(x) +#elif defined(__clang__) +/* All clang versions have __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) #else # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8)) Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_warc.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_read_support_format_warc.c Sun Aug 14 22:08:25 2016 (r304103) @@ -318,7 +318,7 @@ start_over: } memcpy(w->pool.str, fnam.str, fnam.len); w->pool.str[fnam.len] = '\0'; - /* let noone else know about the pool, it's a secret, shhh */ + /* let no one else know about the pool, it's a secret, shhh */ fnam.str = w->pool.str; /* snarf mtime or deduce from rtime Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_util.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_util.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_util.c Sun Aug 14 22:08:25 2016 (r304103) @@ -580,7 +580,7 @@ void __archive_ensure_cloexec_flag(int fd) { #if defined(_WIN32) && !defined(__CYGWIN__) - (void)fd; /* UNSED */ + (void)fd; /* UNUSED */ #else int flags; Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Aug 14 22:08:25 2016 (r304103) @@ -145,7 +145,7 @@ set_acl(struct archive *a, int fd, const gid_t ae_gid; const char *ae_name; int entries; - int i; + int i, r; ret = ARCHIVE_OK; entries = archive_acl_reset(abstract_acl, ae_requested_type); @@ -223,12 +223,16 @@ set_acl(struct archive *a, int fd, const } #ifdef ACL_TYPE_NFS4 - acl_get_flagset_np(acl_entry, &acl_flagset); - acl_clear_flags_np(acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + acl_clear_flags_np(acl_flagset); + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (ae_permset & acl_inherit_map[i].archive_inherit) + acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + } } #endif } Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Aug 14 22:08:25 2016 (r304103) @@ -1796,7 +1796,7 @@ edit_deep_directories(struct archive_wri char *tail = a->name; /* If path is short, avoid the open() below. */ - if (strlen(tail) <= PATH_MAX) + if (strlen(tail) < PATH_MAX) return; /* Try to record our starting dir. */ @@ -1806,7 +1806,7 @@ edit_deep_directories(struct archive_wri return; /* As long as the path is too long... */ - while (strlen(tail) > PATH_MAX) { + while (strlen(tail) >= PATH_MAX) { /* Locate a dir prefix shorter than PATH_MAX. */ tail += PATH_MAX - 8; while (tail > a->name && *tail != '/') Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sun Aug 14 22:08:25 2016 (r304103) @@ -436,7 +436,7 @@ struct iso_option { * Type : string * Default: Auto detect * : We check a size of boot image; - * : If ths size is just 1.22M/1.44M/2.88M, + * : If the size is just 1.22M/1.44M/2.88M, * : we assume boot_type is 'fd'; * : otherwise boot_type is 'no-emulation'. * COMPAT : Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_ustar.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Sun Aug 14 22:08:25 2016 (r304103) @@ -307,7 +307,7 @@ archive_write_ustar_header(struct archiv * case getting WCS failed. On POSIX, this is a * normal operation. */ - if (p != NULL && p[strlen(p) - 1] != '/') { + if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') { struct archive_string as; archive_string_init(&as); Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/main.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/main.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/main.c Sun Aug 14 22:08:25 2016 (r304103) @@ -1440,6 +1440,31 @@ assertion_file_size(const char *file, in return (0); } +/* Verify mode of 'pathname'. */ +int +assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode) +{ + int mode; + int r; + + assertion_count(file, line); +#if defined(_WIN32) && !defined(__CYGWIN__) + failure_start(file, line, "assertFileMode not yet implemented for Windows"); +#else + { + struct stat st; + r = lstat(pathname, &st); + mode = (int)(st.st_mode & 0777); + } + if (r == 0 && mode == expected_mode) + return (1); + failure_start(file, line, "File %s has mode %o, expected %o", + pathname, mode, expected_mode); +#endif + failure_finish(NULL); + return (0); +} + /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */ int assertion_is_dir(const char *file, int line, const char *pathname, int mode) Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test.h ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test.h Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test.h Sun Aug 14 22:08:25 2016 (r304103) @@ -182,6 +182,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -246,6 +248,7 @@ int assertion_file_mtime_recent(const ch int assertion_file_nlinks(const char *, int, const char *, int); int assertion_file_not_exists(const char *, int, const char *); int assertion_file_size(const char *, int, const char *, long); +int assertion_file_mode(const char *, int, const char *, int); int assertion_is_dir(const char *, int, const char *, int); int assertion_is_hardlink(const char *, int, const char *, const char *); int assertion_is_not_hardlink(const char *, int, const char *, const char *); Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_archive_string_conversion.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Sun Aug 14 22:08:25 2016 (r304103) @@ -800,8 +800,8 @@ DEFINE_TEST(test_archive_string_conversi assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assert((fp = fopen(testdata, "w")) != NULL); while ((size = archive_read_data(a, buff, 512)) > 0) - fwrite(buff, 1, size, fp); - fclose(fp); + assertEqualInt(size, fwrite(buff, 1, size, fp)); + assertEqualInt(0, fclose(fp)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); test_archive_string_normalization_nfc(testdata); Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_fuzz.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_fuzz.c Sun Aug 14 22:08:25 2016 (r304103) @@ -110,13 +110,17 @@ test_fuzz(const struct files *filesets) for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - rawimage = (char *)realloc(rawimage, oldsize + size); + char *newraw = (char *)realloc(rawimage, oldsize + size); + if (!assert(newraw != NULL)) + { + free(rawimage); + continue; + } + rawimage = newraw; memcpy(rawimage + oldsize, tmp, size); oldsize += size; size = oldsize; free(tmp); - if (!assert(rawimage != NULL)) - continue; } } if (size == 0) Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_rar.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_rar.c Sun Aug 14 22:08:25 2016 (r304103) @@ -3603,7 +3603,7 @@ DEFINE_TEST(test_read_format_rar_multivo assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); /* - * Eigth header. + * Eighth header. */ assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("testdir/testsymlink6", archive_entry_pathname(ae)); Copied: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c (from r304102, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c Sun Aug 14 22:08:25 2016 (r304103, copy of r304102, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD"); + +#include + + +/* + * Github Issue 748 reported problems with end-of-entry handling + * with highly-compressible data. This resulted in the end of the + * data being truncated (extracted as zero bytes). + */ + +/* + * Extract the specific test archive that was used to diagnose + * Issue 748: + */ +DEFINE_TEST(test_read_format_zip_high_compression) +{ + const char *refname = "test_read_format_zip_high_compression.zip"; + char *p; + size_t archive_size; + struct archive *a; + struct archive_entry *entry; + + const void *pv; + size_t s; + int64_t o; + + extract_reference_file(refname); + p = slurpfile(&archive_size, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, archive_size, 16 * 1024)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(160, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + free(p); +} + +/* + * Synthesize a lot of varying inputs that are highly compressible. + */ +DEFINE_TEST(test_read_format_zip_high_compression2) +{ + const size_t body_size = 1024 * 1024; + const size_t buff_size = 2 * 1024 * 1024; + char *body, *body_read, *buff; + int n; + + assert((body = malloc(body_size)) != NULL); + assert((body_read = malloc(body_size)) != NULL); + assert((buff = malloc(buff_size)) != NULL); + + /* Highly-compressible data: all bytes 255, except for a + * single 1 byte. + * The body is always 256k + 6 bytes long (the internal deflation + * buffer is exactly 256k). + */ + + for(n = 1024; n < (int)body_size; n += 1024) { + struct archive *a; + struct archive_entry *entry; + size_t used = 0; + const void *pv; + size_t s; + int64_t o; + + memset(body, 255, body_size); + body[n] = 1; + + /* Write an archive with a single entry of n bytes. */ + assert((a = archive_write_new()) != NULL); + assertEqualInt(ARCHIVE_OK, archive_write_set_format_zip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_open_memory(a, buff, buff_size, &used)); + + entry = archive_entry_new2(a); + archive_entry_set_pathname(entry, "test"); + archive_entry_set_filetype(entry, AE_IFREG); + archive_entry_set_size(entry, 262150); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + assertEqualInt(262150, archive_write_data(a, body, 262150)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Read back the entry and verify the contents. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, buff, used, 17)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(6, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + } + + free(body); + free(body_read); + free(buff); +} Copied: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu (from r304102, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu Sun Aug 14 22:08:25 2016 (r304103, copy of r304102, head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu) @@ -0,0 +1,18 @@ +begin 644 test_read_format_zip_high_compression.zip +M4$L#!!0`"``(`*=Y]4@``````````*``!``(`"``8VAA +MD5>>))%7GB215W5X"P`!!/8!```$%````.W=06K#,!`%T&E)P8LL?*2XC@N% +M)#5QO>AM@9WDJ6!%\6$K/Q6T3LAX]N/GQ'Z9G&KA^*K1'S +M.`[GOIM*[TP_Q_>O0[G_:3X.Y\^^V/X2<>))%7=7@+``$$]@$```04````4$L%!@`````!``$`5@````L"```` +!```` +` +end Copied: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure744.c (from r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure744.c Sun Aug 14 22:08:25 2016 (r304103, copy of r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #744 describes a bug in the sandboxing code that + * causes very long pathnames to not get checked for symlinks. + */ + +DEFINE_TEST(test_write_disk_secure744) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + size_t buff_size = 8192; + char *buff = malloc(buff_size); + char *p = buff; + int n = 0; + int t; + + assert(buff != NULL); + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + while (p + 500 < buff + buff_size) { + memset(p, 'x', 100); + p += 100; + p[0] = '\0'; + + buff[0] = ((n / 1000) % 10) + '0'; + buff[1] = ((n / 100) % 10)+ '0'; + buff[2] = ((n / 10) % 10)+ '0'; + buff[3] = ((n / 1) % 10)+ '0'; + buff[4] = '_'; + ++n; + + /* Create a symlink pointing to the testworkdir */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, testworkdir); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + *p++ = '/'; + sprintf(p, "target%d", n); + + /* Try to create a file through the symlink, should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFDIR | 0777); + + t = archive_write_header(a, ae); + archive_entry_free(ae); + failure("Attempt to create target%d via %d-character symlink should have failed", n, (int)strlen(buff)); + if(!assertEqualInt(ARCHIVE_FAILED, t)) { + break; + } + } + archive_free(a); + free(buff); +#endif +} Copied: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure745.c (from r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure745.c Sun Aug 14 22:08:25 2016 (r304103, copy of r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #745 describes a bug in the sandboxing code that + * allows one to use a symlink to edit the permissions on a file or + * directory outside of the sandbox. + */ + +DEFINE_TEST(test_write_disk_secure745) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* The target dir: The one we're going to try to change permission on */ + assertMakeDir("target", 0700); + + /* The sandbox dir we're going to run inside of. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create a symlink pointing to the target directory */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, "../target"); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Try to alter the target dir through the symlink; this should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFDIR | 0777); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Permission of target dir should not have changed. */ + assertFileMode("../target", 0700); +#endif +} Copied: user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure746.c (from r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure746.c Sun Aug 14 22:08:25 2016 (r304103, copy of r304102, head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #746 describes a problem in which hardlink targets are + * not adequately checked and can be used to modify entries outside of + * the sandbox. + */ + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NODOTDOT disallows '..' in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746a) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NODOTDOT); + + /* Attempt to hardlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "../target/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NOSYMLINK disallows symlinks in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746b) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* Create a symlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "symlink"); + archive_entry_copy_symlink(ae, "../target"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Attempt to hardlink to the target directory via the symlink. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "symlink/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/tar/cmdline.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/tar/cmdline.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/tar/cmdline.c Sun Aug 14 22:08:25 2016 (r304103) @@ -68,6 +68,7 @@ static const struct bsdtar_option { { "auto-compress", 0, 'a' }, { "b64encode", 0, OPTION_B64ENCODE }, { "block-size", 1, 'b' }, + { "blocking-factor", 1, 'b' }, { "bunzip2", 0, 'j' }, { "bzip", 0, 'j' }, { "bzip2", 0, 'j' }, Modified: user/alc/PQ_LAUNDRY/contrib/libarchive/tar/test/test_version.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libarchive/tar/test/test_version.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/contrib/libarchive/tar/test/test_version.c Sun Aug 14 22:08:25 2016 (r304103) @@ -88,7 +88,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: user/alc/PQ_LAUNDRY/etc/portsnap.conf ============================================================================== --- user/alc/PQ_LAUNDRY/etc/portsnap.conf Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/etc/portsnap.conf Sun Aug 14 22:08:25 2016 (r304103) @@ -32,4 +32,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # List of INDEX files to build and the DESCRIBE file to use for each #INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 DESCRIBE.10 -INDEX INDEX-11 DESCRIBE.11 +#INDEX INDEX-11 DESCRIBE.11 +INDEX INDEX-12 DESCRIBE.12 Modified: user/alc/PQ_LAUNDRY/lib/libarchive/tests/Makefile ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libarchive/tests/Makefile Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/lib/libarchive/tests/Makefile Sun Aug 14 22:08:25 2016 (r304103) @@ -175,6 +175,7 @@ TESTS_SRCS= \ test_read_format_zip_encryption_header.c \ test_read_format_zip_encryption_partially.c \ test_read_format_zip_filename.c \ + test_read_format_zip_high_compression.c \ test_read_format_zip_mac_metadata.c \ test_read_format_zip_malformed.c \ test_read_format_zip_msdos.c \ @@ -209,6 +210,9 @@ TESTS_SRCS= \ test_write_disk_no_hfs_compression.c \ test_write_disk_perms.c \ test_write_disk_secure.c \ + test_write_disk_secure744.c \ + test_write_disk_secure745.c \ + test_write_disk_secure746.c \ test_write_disk_sparse.c \ test_write_disk_symlink.c \ test_write_disk_times.c \ @@ -504,6 +508,7 @@ ${PACKAGE}FILES+= test_read_format_zip_f ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_jp.zip.uu ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru.zip.uu ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu +${PACKAGE}FILES+= test_read_format_zip_high_compression.zip.uu ${PACKAGE}FILES+= test_read_format_zip_length_at_end.zip.uu ${PACKAGE}FILES+= test_read_format_zip_mac_metadata.zip.uu ${PACKAGE}FILES+= test_read_format_zip_malformed1.zip.uu Modified: user/alc/PQ_LAUNDRY/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 14 22:08:25 2016 (r304103) @@ -84,7 +84,7 @@ _tcb_get(void) ".set\tmips64r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' @@ -106,7 +106,7 @@ _tcb_get(void) ".set\tmips32r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' Modified: user/alc/PQ_LAUNDRY/sbin/ipfw/ipfw2.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/ipfw/ipfw2.c Sun Aug 14 22:00:45 2016 (r304102) +++ user/alc/PQ_LAUNDRY/sbin/ipfw/ipfw2.c Sun Aug 14 22:08:25 2016 (r304103) @@ -3718,11 +3718,14 @@ compile_rule(char *av[], uint32_t *rbuf, } if (strcmp(*av, "any") == 0) action->arg1 = 0; - else if (match_token(rule_options, *av) != -1) { + else if ((i = match_token(rule_options, *av)) != -1) { action->arg1 = pack_object(tstate, default_state_name, IPFW_TLV_STATE_NAME); - warn("Ambiguous state name '%s', '%s' used instead.\n", - *av, default_state_name); + if (i != TOK_COMMENT) + warn("Ambiguous state name '%s', '%s'" + " used instead.\n", *av, + default_state_name); + break; } else if (state_check_name(*av) == 0) action->arg1 = pack_object(tstate, *av, IPFW_TLV_STATE_NAME); @@ -4117,8 +4120,17 @@ chkarg: cmd = next_cmd(cmd, &cblen); } - if (have_state) /* must be a check-state, we are done */ + if (have_state) { /* must be a check-state, we are done */ + if (*av != NULL && + match_token(rule_options, *av) == TOK_COMMENT) { + /* check-state has a comment */ + av++; + fill_comment(cmd, av, cblen); + cmd = next_cmd(cmd, &cblen); + av[0] = NULL; + } goto done; + } #define OR_START(target) \ if (av[0] && (*av[0] == '(' || *av[0] == '{')) { \ @@ -4563,8 +4575,8 @@ read_options: errx(EX_USAGE, "only one of keep-state " "and limit is allowed"); if (*av == NULL || - match_token(rule_options, *av) != -1) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Wed Aug 17 04:41:49 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B77BBCDD8 for ; Wed, 17 Aug 2016 04:41:49 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A43913E6; Wed, 17 Aug 2016 04:41:48 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H4fm0K043912; Wed, 17 Aug 2016 04:41:48 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H4fmcF043910; Wed, 17 Aug 2016 04:41:48 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201608170441.u7H4fmcF043910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 17 Aug 2016 04:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304250 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 04:41:49 -0000 Author: pho Date: Wed Aug 17 04:41:47 2016 New Revision: 304250 URL: https://svnweb.freebsd.org/changeset/base/304250 Log: Added two regression tests. Sponsored by: EMC / Isilon Storage Division Added: user/pho/stress2/misc/ftruncate2.sh (contents, props changed) user/pho/stress2/misc/tmpfs16.sh (contents, props changed) Added: user/pho/stress2/misc/ftruncate2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/ftruncate2.sh Wed Aug 17 04:41:47 2016 (r304250) @@ -0,0 +1,212 @@ +#!/bin/sh + +# +# Copyright (c) 2016 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# A fuzz test. Most likely a disk full / FFS issue. + +# "panic: ffs_blkfree_cg: freeing free block" seen: +# https://people.freebsd.org/~pho/stress/log/kostik923.txt +# Fixed by r304232. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +odir=`pwd` +cd /tmp +sed '1,/^EOF/d' < $odir/$0 > ftruncate2.c +rm -f /tmp/ftruncate2 +mycc -o ftruncate2 -Wall -Wextra -O2 -g ftruncate2.c -lpthread || exit 1 +rm -f ftruncate2.c + +echo "Expect: \"/mnt: write failed, filesystem is full\"" +mount | grep $mntpoint | grep -q "on $mntpoint " && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart || exit 1 +bsdlabel -w md${mdstart} auto +newfs md${mdstart}$part > /dev/null # Non SU panics +mount /dev/md${mdstart}$part $mntpoint + +dir=$mntpoint +chmod 777 $dir + +cd $dir +jot 500 | xargs touch +jot 500 | xargs chmod 666 +cd $odir + +(cd /tmp; /tmp/ftruncate2 $dir) +e=$? + +rm -rf $dir/* + +while mount | grep -q "on $mntpoint "; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +rm -f /tmp/ftruncate2 +exit $e +EOF +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define N (128 * 1024 / (int)sizeof(u_int32_t)) +#define RUNTIME 180 +#define THREADS 2 + +static int fd[900]; +static u_int32_t r[N]; +static char *args[2]; + +static unsigned long +makearg(void) +{ + unsigned long val; + + val = arc4random(); +#if defined(__LP64__) + val = (val << 32) | arc4random(); + val = val & 0x00007fffffffffffUL; +#endif + + return(val); +} + +static void * +test(void *arg __unused) +{ + FTS *fts; + FTSENT *p; + int ftsoptions, i, n; + + ftsoptions = FTS_PHYSICAL; + + for (;;) { + for (i = 0; i < N; i++) + r[i] = arc4random(); + if ((fts = fts_open(args, ftsoptions, NULL)) == NULL) + err(1, "fts_open"); + + i = n = 0; + while ((p = fts_read(fts)) != NULL) { + if (fd[i] > 0) + close(fd[i]); + if ((fd[i] = open(p->fts_path, O_RDWR)) == -1) + if ((fd[i] = open(p->fts_path, O_WRONLY)) == -1) + continue; + if (ftruncate(fd[i], 0) != 0) + err(1, "ftruncate"); + i++; + i = i % nitems(fd); + } + + if (fts_close(fts) == -1) + err(1, "fts_close()"); + sleep(1); + } + return(0); +} + +static void * +calls(void *arg __unused) +{ + off_t offset; + time_t start; + int fd2; + + start = time(NULL); + while ((time(NULL) - start) < RUNTIME) { + fd2 = makearg() % nitems(fd) + 3; + offset = makearg(); + if (lseek(fd2, offset - 1, SEEK_SET) != -1) { + if (write(fd2, "x", 1) != 1) + if (errno != EBADF && errno != ENOSPC && errno != E2BIG && + errno != ESTALE && errno != EFBIG) + warn("write"); + } else + if (errno != EBADF) + warn("lseek"); + if (fsync(fd2) == -1) + if (errno != EBADF) + warn("x"); + } + + return (0); +} + +int +main(int argc, char **argv) +{ + struct passwd *pw; + pthread_t rp, cp[THREADS]; + int e, i; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + exit(1); + } + args[0] = argv[1]; + args[1] = 0; + + if ((pw = getpwnam("nobody")) == NULL) + err(1, "failed to resolve nobody"); + if (setgroups(1, &pw->pw_gid) || + setegid(pw->pw_gid) || setgid(pw->pw_gid) || + seteuid(pw->pw_uid) || setuid(pw->pw_uid)) + err(1, "Can't drop privileges to \"nobody\""); + endpwent(); + + arc4random_stir(); + if ((e = pthread_create(&rp, NULL, test, NULL)) != 0) + errc(1, e, "pthread_create"); + usleep(1000); + for (i = 0; i < THREADS; i++) + if ((e = pthread_create(&cp[i], NULL, calls, NULL)) != 0) + errc(1, e, "pthread_create"); + for (i = 0; i < THREADS; i++) + pthread_join(cp[i], NULL); + + return (0); +} Added: user/pho/stress2/misc/tmpfs16.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/tmpfs16.sh Wed Aug 17 04:41:47 2016 (r304250) @@ -0,0 +1,206 @@ +#!/bin/sh + +# +# Copyright (c) 2016 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# A fuzz test using random file descriptors with random seeks. +# "panic: Assertion (cookie & TMPFS_DIRCOOKIE_MASK) == cookie failed": +# https://people.freebsd.org/~pho/stress/log/kostik922.txt +# Fixed by r303916. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +mount | grep -q "on $mntpoint " && umount -f $mntpoint +mount -o size=1g -t tmpfs tmpfs $mntpoint +RUNDIR=$mntpoint/stressX +dir=$RUNDIR + +odir=`pwd` +cd /tmp +sed '1,/^EOF/d' < $odir/$0 > tmpfs16.c +rm -f /tmp/tmpfs16 +mycc -o tmpfs16 -Wall -Wextra -O2 -g tmpfs16.c -lpthread || exit 1 +rm -f tmpfs16.c + +rm -rf $dir +mkdir -p $dir +chmod 777 $dir + +cd $dir +jot 500 | xargs touch +jot 500 | xargs chmod 666 +cd $odir + +(cd /tmp; /tmp/tmpfs16 $dir) +e=$? + +rm -rf $dir +umount $mntpoint + +rm -f /tmp/tmpfs16 +exit $e +EOF +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define N (128 * 1024 / (int)sizeof(u_int32_t)) +#define RUNTIME 180 +#define THREADS 2 + +static int fd[900]; +static u_int32_t r[N]; +static char *args[2]; + +static unsigned long +makearg(void) +{ + unsigned long val; + + val = arc4random(); +#if defined(__LP64__) + val = (val << 31) | arc4random(); + val = val & 0x00007fffffffffffUL; +#endif + + return(val); +} + +static void * +test(void *arg __unused) +{ + FTS *fts; + FTSENT *p; + int ftsoptions, i, n; + + ftsoptions = FTS_PHYSICAL; + + for (;;) { + for (i = 0; i < N; i++) + r[i] = arc4random(); + if ((fts = fts_open(args, ftsoptions, NULL)) == NULL) + err(1, "fts_open"); + + i = n = 0; + while ((p = fts_read(fts)) != NULL) { + if (fd[i] > 0) + close(fd[i]); + if ((fd[i] = open(p->fts_path, O_RDWR)) == -1) + if ((fd[i] = open(p->fts_path, O_WRONLY)) == -1) + continue; + if (ftruncate(fd[i], 0) != 0) + err(1, "ftruncate"); + i++; + i = i % nitems(fd); + } + + if (fts_close(fts) == -1) + err(1, "fts_close()"); + sleep(1); + } + return(0); +} + +static void * +calls(void *arg __unused) +{ + off_t offset; + time_t start; + int fd2; + + start = time(NULL); + while ((time(NULL) - start) < RUNTIME) { + fd2 = makearg() % nitems(fd) + 3; + offset = makearg(); + if (lseek(fd2, offset - 1, SEEK_SET) != -1) { + if (write(fd2, "x", 1) != 1) + if (errno != EBADF && errno != ENOSPC) + warn("write"); + } else + if (errno != EBADF) + warn("lseek"); + if (fsync(fd2) == -1) + if (errno != EBADF) + warn("x"); + + } + + return (0); +} + +int +main(int argc, char **argv) +{ + struct passwd *pw; + pthread_t rp, cp[THREADS]; + int e, i; + + if (argc != 2) { + fprintf(stderr, "Usage: %s \n", argv[0]); + exit(1); + } + args[0] = argv[1]; + args[1] = 0; + + if ((pw = getpwnam("nobody")) == NULL) + err(1, "failed to resolve nobody"); + if (setgroups(1, &pw->pw_gid) || + setegid(pw->pw_gid) || setgid(pw->pw_gid) || + seteuid(pw->pw_uid) || setuid(pw->pw_uid)) + err(1, "Can't drop privileges to \"nobody\""); + endpwent(); + + arc4random_stir(); + if ((e = pthread_create(&rp, NULL, test, NULL)) != 0) + errc(1, e, "pthread_create"); + usleep(1000); + for (i = 0; i < THREADS; i++) + if ((e = pthread_create(&cp[i], NULL, calls, NULL)) != 0) + errc(1, e, "pthread_create"); + for (i = 0; i < THREADS; i++) + pthread_join(cp[i], NULL); + + return (0); +} From owner-svn-src-user@freebsd.org Wed Aug 17 15:50:57 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79094BBCD9A for ; Wed, 17 Aug 2016 15:50:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48AB614F3; Wed, 17 Aug 2016 15:50:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HFoumA098256; Wed, 17 Aug 2016 15:50:56 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HFouQV098255; Wed, 17 Aug 2016 15:50:56 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608171550.u7HFouQV098255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 17 Aug 2016 15:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304294 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 15:50:57 -0000 Author: alc Date: Wed Aug 17 15:50:56 2016 New Revision: 304294 URL: https://svnweb.freebsd.org/changeset/base/304294 Log: Update "gen" after a shortfall laundering so that the page daemon wakeup that coincided with the shortfall laundering can't again trigger a future background laundering. Reviewed by: markj Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Aug 17 15:14:21 2016 (r304293) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Aug 17 15:50:56 2016 (r304294) @@ -1096,6 +1096,7 @@ vm_pageout_laundry_worker(void *arg) KASSERT(cycle >= 0, ("negative cycle %d", cycle)); KASSERT(target >= 0, ("negative target %d", target)); launder = 0; + wakeups = VM_METER_PCPU_CNT(v_pdwakeups); /* * First determine whether we need to launder pages to meet a @@ -1126,6 +1127,7 @@ vm_pageout_laundry_worker(void *arg) */ if (vm_laundry_target() <= 0 || cycle == 0) { shortfall = prev_shortfall = target = 0; + gen = wakeups; } else { launder = target / cycle--; goto dolaundry; @@ -1144,7 +1146,6 @@ vm_pageout_laundry_worker(void *arg) */ ninact = vm_cnt.v_inactive_count; nlaundry = vm_cnt.v_laundry_count; - wakeups = VM_METER_PCPU_CNT(v_pdwakeups); if (target == 0 && wakeups != gen && nlaundry * bkgrd_launder_ratio >= ninact) { gen = wakeups; From owner-svn-src-user@freebsd.org Thu Aug 18 05:35:44 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE41DBBE3C2 for ; Thu, 18 Aug 2016 05:35:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1711169F; Thu, 18 Aug 2016 05:35:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I5ZiSG007611; Thu, 18 Aug 2016 05:35:44 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5ZiNZ007610; Thu, 18 Aug 2016 05:35:44 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608180535.u7I5ZiNZ007610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 18 Aug 2016 05:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304328 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2016 05:35:45 -0000 Author: alc Date: Thu Aug 18 05:35:43 2016 New Revision: 304328 URL: https://svnweb.freebsd.org/changeset/base/304328 Log: When deciding whether to perform background laundering, include the number of free pages in the count of clean pages. Discussed with: markj Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Thu Aug 18 05:33:58 2016 (r304327) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Thu Aug 18 05:35:43 2016 (r304328) @@ -1144,7 +1144,7 @@ vm_pageout_laundry_worker(void *arg) * 2. we haven't yet reached the target of the current * background laundering run. */ - ninact = vm_cnt.v_inactive_count; + ninact = vm_cnt.v_inactive_count + vm_cnt.v_free_count; nlaundry = vm_cnt.v_laundry_count; if (target == 0 && wakeups != gen && nlaundry * bkgrd_launder_ratio >= ninact) { From owner-svn-src-user@freebsd.org Fri Aug 19 04:21:18 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43ACABBD3E6 for ; Fri, 19 Aug 2016 04:21:18 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EED7713BA; Fri, 19 Aug 2016 04:21:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J4LHxT022807; Fri, 19 Aug 2016 04:21:17 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J4LHdc022806; Fri, 19 Aug 2016 04:21:17 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608190421.u7J4LHdc022806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 19 Aug 2016 04:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304442 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 04:21:18 -0000 Author: alc Date: Fri Aug 19 04:21:16 2016 New Revision: 304442 URL: https://svnweb.freebsd.org/changeset/base/304442 Log: Replace the constant "bkgrd_launder_ratio" by a slowly growing function of the number of wakeups since the last laundering. Discussed with: markj Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 19 03:32:04 2016 (r304441) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 19 04:21:16 2016 (r304442) @@ -231,11 +231,6 @@ SYSCTL_INT(_vm, OID_AUTO, act_scan_laund CTLFLAG_RW, &act_scan_laundry_weight, 0, "weight given to clean vs. dirty pages in active queue scans"); -static u_int bkgrd_launder_ratio = 50; -SYSCTL_UINT(_vm, OID_AUTO, bkgrd_launder_ratio, - CTLFLAG_RW, &bkgrd_launder_ratio, 0, - "ratio of clean to dirty inactive pages needed to trigger laundering"); - static u_int bkgrd_launder_max = 2048; SYSCTL_UINT(_vm, OID_AUTO, bkgrd_launder_max, CTLFLAG_RW, &bkgrd_launder_max, 0, @@ -248,6 +243,7 @@ int vm_page_max_wired; /* XXX max # of SYSCTL_INT(_vm, OID_AUTO, max_wired, CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); +static u_int isqrt(u_int num); static boolean_t vm_pageout_fallback_object_lock(vm_page_t, vm_page_t *); static int vm_pageout_launder(struct vm_domain *vmd, int launder, bool shortfall); @@ -1067,6 +1063,30 @@ relock_queue: } /* + * Compute the integer square root. + */ +static u_int +isqrt(u_int num) +{ + u_int bit, root, tmp; + + bit = 1u << ((NBBY * sizeof(u_int)) - 2); + while (bit > num) + bit >>= 2; + root = 0; + while (bit != 0) { + tmp = root + bit; + root >>= 1; + if (num >= tmp) { + num -= tmp; + root += bit; + } + bit >>= 2; + } + return (root); +} + +/* * Perform the work of the laundry thread: periodically wake up and determine * whether any pages need to be laundered. If so, determine the number of pages * that need to be laundered, and launder them. @@ -1143,11 +1163,15 @@ vm_pageout_laundry_worker(void *arg) * recently been woken up, or * 2. we haven't yet reached the target of the current * background laundering run. + * + * The background laundering threshold is not a constant. + * Instead, it is a slowly growing function of the number of + * page daemon wakeups since the last laundering. */ ninact = vm_cnt.v_inactive_count + vm_cnt.v_free_count; nlaundry = vm_cnt.v_laundry_count; if (target == 0 && wakeups != gen && - nlaundry * bkgrd_launder_ratio >= ninact) { + nlaundry * isqrt(wakeups - gen) >= ninact) { gen = wakeups; /* From owner-svn-src-user@freebsd.org Fri Aug 19 05:30:03 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E4EBBE60D for ; Fri, 19 Aug 2016 05:30:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC8C150A; Fri, 19 Aug 2016 05:30:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J5U24N048341; Fri, 19 Aug 2016 05:30:02 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5U28G048340; Fri, 19 Aug 2016 05:30:02 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608190530.u7J5U28G048340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 19 Aug 2016 05:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304445 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 05:30:03 -0000 Author: alc Date: Fri Aug 19 05:30:02 2016 New Revision: 304445 URL: https://svnweb.freebsd.org/changeset/base/304445 Log: Rename a variable. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 19 05:20:12 2016 (r304444) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 19 05:30:02 2016 (r304445) @@ -1095,7 +1095,7 @@ static void vm_pageout_laundry_worker(void *arg) { struct vm_domain *domain; - uint64_t ninact, nlaundry; + uint64_t nclean, nlaundry; u_int wakeups, gen; int cycle, domidx, launder, prev_shortfall, shortfall, target; @@ -1168,10 +1168,10 @@ vm_pageout_laundry_worker(void *arg) * Instead, it is a slowly growing function of the number of * page daemon wakeups since the last laundering. */ - ninact = vm_cnt.v_inactive_count + vm_cnt.v_free_count; + nclean = vm_cnt.v_inactive_count + vm_cnt.v_free_count; nlaundry = vm_cnt.v_laundry_count; if (target == 0 && wakeups != gen && - nlaundry * isqrt(wakeups - gen) >= ninact) { + nlaundry * isqrt(wakeups - gen) >= nclean) { gen = wakeups; /* @@ -1193,9 +1193,9 @@ vm_pageout_laundry_worker(void *arg) target = vm_cnt.v_free_target - vm_pageout_wakeup_thresh; /* Avoid division by zero. */ - if (ninact == 0) - ninact = 1; - target = nlaundry * (u_int)target / ninact / 10; + if (nclean == 0) + nclean = 1; + target = nlaundry * (u_int)target / nclean / 10; if (target == 0) target = 1; From owner-svn-src-user@freebsd.org Fri Aug 19 13:12:59 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 002E2BBECD6 for ; Fri, 19 Aug 2016 13:12:59 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79B811FD; Fri, 19 Aug 2016 13:12:58 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JDCwrV022764; Fri, 19 Aug 2016 13:12:58 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JDCvkR022761; Fri, 19 Aug 2016 13:12:57 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201608191312.u7JDCvkR022761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 19 Aug 2016 13:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304465 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 13:12:59 -0000 Author: pho Date: Fri Aug 19 13:12:57 2016 New Revision: 304465 URL: https://svnweb.freebsd.org/changeset/base/304465 Log: Fix compiler warning. Sponsored by: EMC / Isilon Storage Division Modified: user/pho/stress2/misc/mmap10.sh user/pho/stress2/misc/mmap11.sh user/pho/stress2/misc/mmap19.sh Modified: user/pho/stress2/misc/mmap10.sh ============================================================================== --- user/pho/stress2/misc/mmap10.sh Fri Aug 19 12:48:32 2016 (r304464) +++ user/pho/stress2/misc/mmap10.sh Fri Aug 19 13:12:57 2016 (r304465) @@ -182,7 +182,7 @@ void * tmprotect(void *arg __unused) { size_t len; - const void *addr; + void *addr; int i, n, prot; pthread_set_name_np(pthread_self(), __func__); Modified: user/pho/stress2/misc/mmap11.sh ============================================================================== --- user/pho/stress2/misc/mmap11.sh Fri Aug 19 12:48:32 2016 (r304464) +++ user/pho/stress2/misc/mmap11.sh Fri Aug 19 13:12:57 2016 (r304465) @@ -185,7 +185,7 @@ void * tmprotect(void *arg __unused) { size_t len; - const void *addr; + void *addr; int i, n, prot; pthread_set_name_np(pthread_self(), __func__); Modified: user/pho/stress2/misc/mmap19.sh ============================================================================== --- user/pho/stress2/misc/mmap19.sh Fri Aug 19 12:48:32 2016 (r304464) +++ user/pho/stress2/misc/mmap19.sh Fri Aug 19 13:12:57 2016 (r304465) @@ -49,7 +49,9 @@ sleep $((rnd % 10)) for i in `jot 2`; do /tmp/mmap19 done -killall -q swap +while pgrep -q swap; do + pkill -9 swap +done rm -f /tmp/mmap19 /tmp/mmap19.core exit 0 @@ -153,7 +155,7 @@ tmmap(void *arg __unused) void * tmprotect(void *arg __unused) { - const void *addr; + void *addr; size_t len; int i, n, prot; From owner-svn-src-user@freebsd.org Fri Aug 19 16:39:00 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD6B2BBF9E7 for ; Fri, 19 Aug 2016 16:39:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A06D1BCE; Fri, 19 Aug 2016 16:39:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JGcxLh099132; Fri, 19 Aug 2016 16:38:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JGcwGU099117; Fri, 19 Aug 2016 16:38:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608191638.u7JGcwGU099117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Aug 2016 16:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304467 - in user/alc/PQ_LAUNDRY: . cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars ... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 16:39:01 -0000 Author: markj Date: Fri Aug 19 16:38:57 2016 New Revision: 304467 URL: https://svnweb.freebsd.org/changeset/base/304467 Log: MFH r304466 Added: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d - copied unchanged from r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d - copied unchanged from r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sugar/ - copied from r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sugar/ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c - copied unchanged from r304466, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c user/alc/PQ_LAUNDRY/cddl/usr.sbin/dtrace/tests/common/sugar/ - copied from r304466, head/cddl/usr.sbin/dtrace/tests/common/sugar/ user/alc/PQ_LAUNDRY/lib/libc/string/timingsafe_bcmp.3 - copied unchanged from r304466, head/lib/libc/string/timingsafe_bcmp.3 user/alc/PQ_LAUNDRY/lib/libc/string/timingsafe_bcmp.c - copied unchanged from r304466, head/lib/libc/string/timingsafe_bcmp.c user/alc/PQ_LAUNDRY/lib/libc/string/timingsafe_memcmp.c - copied unchanged from r304466, head/lib/libc/string/timingsafe_memcmp.c user/alc/PQ_LAUNDRY/lib/libc/sys/fdatasync.c - copied unchanged from r304466, head/lib/libc/sys/fdatasync.c user/alc/PQ_LAUNDRY/lib/libc/x86/ - copied from r304466, head/lib/libc/x86/ user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-aarch64.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-aarch64.h.in user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-arm.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-arm.h.in user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-mips.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-mips.h.in user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-powerpc.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-powerpc.h.in user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-riscv.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-riscv.h.in user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-sparc64.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-sparc64.h.in user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-x86.h.in - copied unchanged from r304466, head/secure/lib/libcrypto/opensslconf-x86.h.in user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10/a10_padconf.c - copied unchanged from r304466, head/sys/arm/allwinner/a10/a10_padconf.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10/files.a10 - copied unchanged from r304466, head/sys/arm/allwinner/a10/files.a10 user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_machdep.c - copied unchanged from r304466, head/sys/arm/allwinner/aw_machdep.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_machdep.h - copied unchanged from r304466, head/sys/arm/allwinner/aw_machdep.h user/alc/PQ_LAUNDRY/sys/arm/allwinner/files.allwinner_up - copied unchanged from r304466, head/sys/arm/allwinner/files.allwinner_up user/alc/PQ_LAUNDRY/sys/arm/allwinner/std.allwinner_up - copied unchanged from r304466, head/sys/arm/allwinner/std.allwinner_up user/alc/PQ_LAUNDRY/sys/arm/conf/ALLWINNER_UP - copied unchanged from r304466, head/sys/arm/conf/ALLWINNER_UP user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/skein_zfs.c - copied unchanged from r304466, head/sys/cddl/boot/zfs/skein_zfs.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram.c - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_common.c - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_common.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_common.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_common.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parser.c - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_parser.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parser.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_parser.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parserreg.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_parserreg.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parservar.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvram_parservar.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvramvar.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_nvramvar.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_parser.c - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_sprom_parser.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_parser.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_sprom_parser.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_parservar.h - copied unchanged from r304466, head/sys/dev/bhnd/nvram/bhnd_sprom_parservar.h user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_minidump.h - copied unchanged from r304466, head/sys/dev/qlxgbe/ql_minidump.h Deleted: user/alc/PQ_LAUNDRY/lib/libc/amd64/sys/__vdso_gettc.c user/alc/PQ_LAUNDRY/lib/libc/i386/sys/__vdso_gettc.c user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-aarch64.h user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-arm.h user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-mips.h user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-powerpc.h user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-riscv.h user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-sparc64.h user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-x86.h user/alc/PQ_LAUNDRY/share/man/man4/mcd.4 user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10_padconf.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/allwinner_machdep.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/allwinner_machdep.h user/alc/PQ_LAUNDRY/sys/arm/allwinner/files.a10 user/alc/PQ_LAUNDRY/sys/arm/allwinner/std.a10 user/alc/PQ_LAUNDRY/sys/arm/conf/A10 user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_subr.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_spromreg.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/nvram_subr.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/nvramvar.h user/alc/PQ_LAUNDRY/sys/dev/mcd/ user/alc/PQ_LAUNDRY/sys/modules/mcd/ Modified: user/alc/PQ_LAUNDRY/Makefile.inc1 user/alc/PQ_LAUNDRY/ObsoleteFiles.inc user/alc/PQ_LAUNDRY/UPDATING user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h user/alc/PQ_LAUNDRY/cddl/lib/libdtrace/Makefile user/alc/PQ_LAUNDRY/cddl/usr.sbin/dtrace/tests/common/Makefile user/alc/PQ_LAUNDRY/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile user/alc/PQ_LAUNDRY/cddl/usr.sbin/dtrace/tests/tools/exclude.sh user/alc/PQ_LAUNDRY/contrib/elftoolchain/elfcopy/ascii.c user/alc/PQ_LAUNDRY/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 user/alc/PQ_LAUNDRY/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c user/alc/PQ_LAUNDRY/contrib/llvm/lib/Target/X86/X86.td user/alc/PQ_LAUNDRY/contrib/llvm/tools/clang/lib/Basic/Targets.cpp user/alc/PQ_LAUNDRY/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c user/alc/PQ_LAUNDRY/etc/mtree/BSD.tests.dist user/alc/PQ_LAUNDRY/etc/periodic/daily/480.leapfile-ntpd user/alc/PQ_LAUNDRY/include/string.h user/alc/PQ_LAUNDRY/include/unistd.h user/alc/PQ_LAUNDRY/lib/clang/freebsd_cc_version.h user/alc/PQ_LAUNDRY/lib/libc/Makefile user/alc/PQ_LAUNDRY/lib/libc/aarch64/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/aarch64/sys/__vdso_gettc.c user/alc/PQ_LAUNDRY/lib/libc/amd64/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/arm/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/arm/sys/__vdso_gettc.c user/alc/PQ_LAUNDRY/lib/libc/gen/sem_timedwait.3 user/alc/PQ_LAUNDRY/lib/libc/i386/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/include/libc_private.h user/alc/PQ_LAUNDRY/lib/libc/mips/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/net/inet_net.3 user/alc/PQ_LAUNDRY/lib/libc/net/nss_compat.c user/alc/PQ_LAUNDRY/lib/libc/powerpc/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/powerpc64/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/riscv/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/sparc64/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/string/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/string/Symbol.map user/alc/PQ_LAUNDRY/lib/libc/string/bcmp.3 user/alc/PQ_LAUNDRY/lib/libc/string/memcmp.3 user/alc/PQ_LAUNDRY/lib/libc/sys/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/sys/Symbol.map user/alc/PQ_LAUNDRY/lib/libc/sys/__vdso_gettimeofday.c user/alc/PQ_LAUNDRY/lib/libc/sys/bind.2 user/alc/PQ_LAUNDRY/lib/libc/sys/connect.2 user/alc/PQ_LAUNDRY/lib/libc/sys/fsync.2 user/alc/PQ_LAUNDRY/lib/libc/sys/interposing_table.c user/alc/PQ_LAUNDRY/lib/libc/sys/listen.2 user/alc/PQ_LAUNDRY/lib/libc/sys/recv.2 user/alc/PQ_LAUNDRY/lib/libc/sys/send.2 user/alc/PQ_LAUNDRY/lib/libc/sys/socket.2 user/alc/PQ_LAUNDRY/lib/libc/sys/trivial-vdso_tc.c user/alc/PQ_LAUNDRY/lib/libthr/thread/thr_syscalls.c user/alc/PQ_LAUNDRY/sbin/fsck_ffs/fsck.h user/alc/PQ_LAUNDRY/sbin/fsck_ffs/globs.c user/alc/PQ_LAUNDRY/sbin/fsck_ffs/main.c user/alc/PQ_LAUNDRY/sbin/fsck_ffs/setup.c user/alc/PQ_LAUNDRY/secure/lib/libcrypto/Makefile user/alc/PQ_LAUNDRY/secure/lib/libcrypto/Makefile.asm user/alc/PQ_LAUNDRY/secure/lib/libcrypto/Makefile.inc user/alc/PQ_LAUNDRY/share/man/man3/pthread_testcancel.3 user/alc/PQ_LAUNDRY/share/man/man3/queue.3 user/alc/PQ_LAUNDRY/share/man/man4/Makefile user/alc/PQ_LAUNDRY/share/man/man4/rights.4 user/alc/PQ_LAUNDRY/share/man/man4/tcp.4 user/alc/PQ_LAUNDRY/share/man/man9/tcp_functions.9 user/alc/PQ_LAUNDRY/share/timedef/ko_KR.UTF-8.src user/alc/PQ_LAUNDRY/share/timedef/ko_KR.eucKR.src (contents, props changed) user/alc/PQ_LAUNDRY/share/timedef/zh_CN.GB2312.src (contents, props changed) user/alc/PQ_LAUNDRY/share/timedef/zh_CN.GBK.src (contents, props changed) user/alc/PQ_LAUNDRY/share/timedef/zh_CN.UTF-8.src user/alc/PQ_LAUNDRY/share/timedef/zh_CN.eucCN.src (contents, props changed) user/alc/PQ_LAUNDRY/share/timedef/zh_HK.UTF-8.src (contents, props changed) user/alc/PQ_LAUNDRY/share/timedef/zh_TW.Big5.src (contents, props changed) user/alc/PQ_LAUNDRY/share/timedef/zh_TW.UTF-8.src (contents, props changed) user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10_ehci.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10_gpio.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10_mmc.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_if_dwc.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_mp.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_rtc.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/clk/aw_pll.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/files.allwinner user/alc/PQ_LAUNDRY/sys/arm/allwinner/timer.c user/alc/PQ_LAUNDRY/sys/arm/arm/generic_timer.c user/alc/PQ_LAUNDRY/sys/arm/arm/machdep.c user/alc/PQ_LAUNDRY/sys/arm/arm/nexus.c user/alc/PQ_LAUNDRY/sys/arm/include/md_var.h user/alc/PQ_LAUNDRY/sys/arm/include/vdso.h user/alc/PQ_LAUNDRY/sys/arm/nvidia/tegra_lic.c user/alc/PQ_LAUNDRY/sys/arm/nvidia/tegra_pcie.c user/alc/PQ_LAUNDRY/sys/arm/ti/omap4/omap4_wugen.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/identcpu.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/machdep.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/nexus.c user/alc/PQ_LAUNDRY/sys/arm64/include/armreg.h user/alc/PQ_LAUNDRY/sys/arm64/include/md_var.h user/alc/PQ_LAUNDRY/sys/arm64/include/vdso.h user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/Makefile user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/boot1.c user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/ufs_module.c user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/zfs_module.c user/alc/PQ_LAUNDRY/sys/boot/efi/libefi/efi_console.c user/alc/PQ_LAUNDRY/sys/boot/efi/loader/Makefile user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/arm/bananapi.dts user/alc/PQ_LAUNDRY/sys/boot/i386/boot2/Makefile user/alc/PQ_LAUNDRY/sys/boot/i386/gptboot/Makefile user/alc/PQ_LAUNDRY/sys/boot/i386/gptboot/gptldr.S user/alc/PQ_LAUNDRY/sys/boot/i386/gptzfsboot/Makefile user/alc/PQ_LAUNDRY/sys/boot/i386/zfsboot/Makefile user/alc/PQ_LAUNDRY/sys/boot/i386/zfsboot/zfsboot.c user/alc/PQ_LAUNDRY/sys/boot/i386/zfsboot/zfsldr.S user/alc/PQ_LAUNDRY/sys/boot/userboot/ficl/Makefile user/alc/PQ_LAUNDRY/sys/boot/userboot/userboot/Makefile user/alc/PQ_LAUNDRY/sys/boot/userboot/zfs/Makefile user/alc/PQ_LAUNDRY/sys/boot/zfs/Makefile user/alc/PQ_LAUNDRY/sys/boot/zfs/zfsimpl.c user/alc/PQ_LAUNDRY/sys/cam/cam.c user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/fletcher.c user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/sha256.c user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/zfsimpl.h user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/zfssubr.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h user/alc/PQ_LAUNDRY/sys/compat/cloudabi/cloudabi_fd.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_proto.h user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_syscall.h user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_syscalls.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_sysent.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_systrace_args.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/syscalls.master user/alc/PQ_LAUNDRY/sys/compat/linux/linux_file.c user/alc/PQ_LAUNDRY/sys/conf/NOTES user/alc/PQ_LAUNDRY/sys/conf/files user/alc/PQ_LAUNDRY/sys/conf/options user/alc/PQ_LAUNDRY/sys/dev/acpica/acpi_hpet.c user/alc/PQ_LAUNDRY/sys/dev/acpica/acpi_hpet.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhnd.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhnd.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhnd_bus_if.m user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhnd_subr.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhnd_types.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhndb/bhndb_private.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhndb/bhndb_subr.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/bhndvar.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/cores/chipc/chipc.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_if.m user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom.c user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_spromvar.h user/alc/PQ_LAUNDRY/sys/dev/bhnd/tools/nvram_map_gen.awk user/alc/PQ_LAUNDRY/sys/dev/bwn/bwn_mac.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/common/common.h user/alc/PQ_LAUNDRY/sys/dev/cxgbe/common/t4_hw.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_sge.c user/alc/PQ_LAUNDRY/sys/dev/e1000/e1000_api.c user/alc/PQ_LAUNDRY/sys/dev/e1000/e1000_hw.h user/alc/PQ_LAUNDRY/sys/dev/e1000/e1000_ich8lan.c user/alc/PQ_LAUNDRY/sys/dev/e1000/e1000_ich8lan.h user/alc/PQ_LAUNDRY/sys/dev/e1000/e1000_phy.c user/alc/PQ_LAUNDRY/sys/dev/e1000/if_em.c user/alc/PQ_LAUNDRY/sys/dev/fdt/simplebus.c user/alc/PQ_LAUNDRY/sys/dev/gpio/gpiobus.c user/alc/PQ_LAUNDRY/sys/dev/gpio/gpiobusvar.h user/alc/PQ_LAUNDRY/sys/dev/gpio/ofw_gpiobus.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/include/vmbus.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_net_vsc.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_net_vsc.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_rndis.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_rndis_filter.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_rndis_filter.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/if_hnreg.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/if_hnvar.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/storvsc/hv_vstorage.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/utilities/hv_heartbeat.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/utilities/hv_kvp.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/utilities/hv_shutdown.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/utilities/hv_timesync.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/utilities/hv_util.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/utilities/hv_util.h user/alc/PQ_LAUNDRY/sys/dev/iicbus/ofw_iicbus.c user/alc/PQ_LAUNDRY/sys/dev/ofw/ofw_bus_subr.c user/alc/PQ_LAUNDRY/sys/dev/ofw/ofw_bus_subr.h user/alc/PQ_LAUNDRY/sys/dev/ofw/ofwbus.c user/alc/PQ_LAUNDRY/sys/dev/pci/pci_host_generic.c user/alc/PQ_LAUNDRY/sys/dev/pci/pci_pci.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_boot.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_dbg.h user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_def.h user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_fw.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_glbl.h user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_hw.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_hw.h user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_ioctl.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_ioctl.h user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_isr.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_minidump.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_os.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_reset.c user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_ver.h user/alc/PQ_LAUNDRY/sys/dev/syscons/syscons.c user/alc/PQ_LAUNDRY/sys/dev/syscons/syscons.h user/alc/PQ_LAUNDRY/sys/dev/usb/net/if_axge.c user/alc/PQ_LAUNDRY/sys/dev/usb/net/if_axgereg.h user/alc/PQ_LAUNDRY/sys/dev/vnic/mrml_bridge.c user/alc/PQ_LAUNDRY/sys/dev/vnic/thunder_mdio_fdt.c user/alc/PQ_LAUNDRY/sys/dev/vt/vt_core.c user/alc/PQ_LAUNDRY/sys/fs/msdosfs/msdosfs_vnops.c user/alc/PQ_LAUNDRY/sys/i386/include/md_var.h user/alc/PQ_LAUNDRY/sys/kern/bus_if.m user/alc/PQ_LAUNDRY/sys/kern/capabilities.conf user/alc/PQ_LAUNDRY/sys/kern/init_sysent.c user/alc/PQ_LAUNDRY/sys/kern/kern_sig.c user/alc/PQ_LAUNDRY/sys/kern/kern_tc.c user/alc/PQ_LAUNDRY/sys/kern/kern_timeout.c user/alc/PQ_LAUNDRY/sys/kern/kern_umtx.c user/alc/PQ_LAUNDRY/sys/kern/pic_if.m user/alc/PQ_LAUNDRY/sys/kern/subr_bus.c user/alc/PQ_LAUNDRY/sys/kern/subr_intr.c user/alc/PQ_LAUNDRY/sys/kern/sys_generic.c user/alc/PQ_LAUNDRY/sys/kern/syscalls.c user/alc/PQ_LAUNDRY/sys/kern/syscalls.master user/alc/PQ_LAUNDRY/sys/kern/systrace_args.c user/alc/PQ_LAUNDRY/sys/kern/vfs_aio.c user/alc/PQ_LAUNDRY/sys/kern/vfs_default.c user/alc/PQ_LAUNDRY/sys/kern/vfs_syscalls.c user/alc/PQ_LAUNDRY/sys/kern/vnode_if.src user/alc/PQ_LAUNDRY/sys/mips/broadcom/bcm_machdep.c user/alc/PQ_LAUNDRY/sys/mips/conf/BCM user/alc/PQ_LAUNDRY/sys/mips/conf/BCM.hints user/alc/PQ_LAUNDRY/sys/mips/conf/SENTRY5 user/alc/PQ_LAUNDRY/sys/mips/conf/SENTRY5.hints user/alc/PQ_LAUNDRY/sys/mips/mips/cpu.c user/alc/PQ_LAUNDRY/sys/mips/mips/nexus.c user/alc/PQ_LAUNDRY/sys/modules/Makefile user/alc/PQ_LAUNDRY/sys/modules/bhnd/Makefile user/alc/PQ_LAUNDRY/sys/modules/dtb/allwinner/Makefile user/alc/PQ_LAUNDRY/sys/net/if_epair.c user/alc/PQ_LAUNDRY/sys/net/netisr.c user/alc/PQ_LAUNDRY/sys/net80211/ieee80211_ioctl.c user/alc/PQ_LAUNDRY/sys/netinet/in.c user/alc/PQ_LAUNDRY/sys/netinet/in.h user/alc/PQ_LAUNDRY/sys/netinet/ip_output.c user/alc/PQ_LAUNDRY/sys/netinet/sctputil.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_subr.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_syncache.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_timer.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_timer.h user/alc/PQ_LAUNDRY/sys/netinet/tcp_usrreq.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_var.h user/alc/PQ_LAUNDRY/sys/netinet/udp_usrreq.c user/alc/PQ_LAUNDRY/sys/netpfil/ipfw/ip_fw_sockopt.c user/alc/PQ_LAUNDRY/sys/netpfil/ipfw/nat64/nat64_translate.c user/alc/PQ_LAUNDRY/sys/netpfil/pf/pf.c user/alc/PQ_LAUNDRY/sys/ofed/drivers/infiniband/core/ucma.c user/alc/PQ_LAUNDRY/sys/sys/buf.h user/alc/PQ_LAUNDRY/sys/sys/bus.h user/alc/PQ_LAUNDRY/sys/sys/intr.h user/alc/PQ_LAUNDRY/sys/sys/param.h user/alc/PQ_LAUNDRY/sys/sys/queue.h user/alc/PQ_LAUNDRY/sys/sys/syscall.h user/alc/PQ_LAUNDRY/sys/sys/syscall.mk user/alc/PQ_LAUNDRY/sys/sys/syscallsubr.h user/alc/PQ_LAUNDRY/sys/sys/sysproto.h user/alc/PQ_LAUNDRY/sys/sys/timetc.h user/alc/PQ_LAUNDRY/sys/sys/vdso.h user/alc/PQ_LAUNDRY/sys/sys/vnode.h user/alc/PQ_LAUNDRY/sys/ufs/ffs/ffs_balloc.c user/alc/PQ_LAUNDRY/sys/ufs/ffs/ffs_extern.h user/alc/PQ_LAUNDRY/sys/ufs/ffs/ffs_softdep.c user/alc/PQ_LAUNDRY/sys/ufs/ffs/ffs_vnops.c user/alc/PQ_LAUNDRY/sys/ufs/ffs/softdep.h user/alc/PQ_LAUNDRY/sys/x86/include/vdso.h user/alc/PQ_LAUNDRY/sys/x86/x86/tsc.c user/alc/PQ_LAUNDRY/tests/sys/kern/acct/acct_test.c user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan user/alc/PQ_LAUNDRY/usr.bin/netstat/inet6.c user/alc/PQ_LAUNDRY/usr.bin/nfsstat/nfsstat.c user/alc/PQ_LAUNDRY/usr.bin/rpcgen/rpc_main.c user/alc/PQ_LAUNDRY/usr.bin/systat/main.c user/alc/PQ_LAUNDRY/usr.bin/tty/tty.c user/alc/PQ_LAUNDRY/usr.sbin/bsdinstall/partedit/gpart_ops.c Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) user/alc/PQ_LAUNDRY/cddl/ (props changed) user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/ (props changed) user/alc/PQ_LAUNDRY/contrib/elftoolchain/ (props changed) user/alc/PQ_LAUNDRY/contrib/llvm/ (props changed) user/alc/PQ_LAUNDRY/contrib/llvm/tools/clang/ (props changed) user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/alc/PQ_LAUNDRY/Makefile.inc1 ============================================================================== --- user/alc/PQ_LAUNDRY/Makefile.inc1 Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/Makefile.inc1 Fri Aug 19 16:38:57 2016 (r304467) @@ -1581,10 +1581,6 @@ _groff= gnu/usr.bin/groff \ _vtfontcvt= usr.bin/vtfontcvt .endif -.if ${BOOTSTRAPPING} < 900002 -_sed= usr.bin/sed -.endif - .if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 @@ -1623,10 +1619,6 @@ _crunchide= usr.sbin/crunch/crunchide _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 -_awk= usr.bin/awk -.endif - # r296926 -P keymap search path, MFC to stable/10 in r298297 .if ${BOOTSTRAPPING} < 1003501 || \ (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) @@ -1694,7 +1686,6 @@ bootstrap-tools: .PHONY ${_gperf} \ ${_groff} \ ${_dtc} \ - ${_awk} \ ${_cat} \ ${_dd} \ ${_kbdcontrol} \ @@ -1702,7 +1693,6 @@ bootstrap-tools: .PHONY ${_libopenbsd} \ ${_makewhatis} \ usr.bin/rpcgen \ - ${_sed} \ ${_yacc} \ ${_m4} \ ${_lex} \ Modified: user/alc/PQ_LAUNDRY/ObsoleteFiles.inc ============================================================================== --- user/alc/PQ_LAUNDRY/ObsoleteFiles.inc Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/ObsoleteFiles.inc Fri Aug 19 16:38:57 2016 (r304467) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160815: Remove mcd(4) +OLD_FILES+=usr/share/man/man4/mcd.4.gz # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE Modified: user/alc/PQ_LAUNDRY/UPDATING ============================================================================== --- user/alc/PQ_LAUNDRY/UPDATING Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/UPDATING Fri Aug 19 16:38:57 2016 (r304467) @@ -31,6 +31,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160818: + The UDP receive code has been updated to only treat incoming UDP + packets that were addressed to an L2 broadcast address as L3 + broadcast packets. It is not expected that this will affect any + standards-conforming UDP application. The new behaviour can be + disabled by setting the sysctl net.inet.udp.require_l2_bcast to + 0. + +20160818: + Remove the openbsd_poll system call. + __FreeBSD_version has been bumped because of this. + 20160622: The libc stub for the pipe(2) system call has been replaced with a wrapper that calls the pipe2(2) system call and the pipe(2) Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Fri Aug 19 16:38:57 2016 (r304467) @@ -93,6 +93,9 @@ static int g_flowindent; static int g_intr; static int g_impatient; static int g_newline; +#ifdef __FreeBSD__ +static int g_siginfo; +#endif static int g_total; static int g_cflags; static int g_oflags; @@ -1260,6 +1263,16 @@ intr(int signo) g_impatient = 1; } +#ifdef __FreeBSD__ +static void +siginfo(int signo __unused) +{ + + g_siginfo++; + g_newline = 1; +} +#endif + static void installsighands(void) { @@ -1275,12 +1288,16 @@ installsighands(void) if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGTERM, &act, NULL); -#ifndef illumos +#ifdef __FreeBSD__ if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGPIPE, &act, NULL); if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGUSR1, &act, NULL); + + act.sa_handler = siginfo; + if (sigaction(SIGINFO, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGINFO, &act, NULL); #endif } @@ -1944,6 +1961,13 @@ main(int argc, char *argv[]) if (!g_intr && !done) dtrace_sleep(g_dtp); +#ifdef __FreeBSD__ + if (g_siginfo) { + (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL); + g_siginfo = 0; + } +#endif + if (g_newline) { /* * Output a newline just to make the output look Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Fri Aug 19 16:38:57 2016 (r304467) @@ -25,6 +25,10 @@ # Use is subject to license terms. # +# +# Copyright (c) 2014, 2016 by Delphix. All rights reserved. +# + require 5.8.4; $PNAME = $0; @@ -131,7 +135,8 @@ sub dstyle } if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ && - !/^translator/ && !/^provider/) { + !/^translator/ && !/^provider/ && !/\tif / && + !/ else /) { if (/[\w\s]+{/) { err "left brace not on its own line"; } @@ -141,7 +146,7 @@ sub dstyle } } - if (!/;$/) { + if (!/;$/ && !/\t*}$/ && !/ else /) { if (/[\w\s]+}/) { err "right brace not on its own line"; } Copied: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d (from r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d Fri Aug 19 16:38:57 2016 (r304467, copy of r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +char *k; + +BEGIN +{ + j = probeprov; + k = j; + k[0] = 'D'; + k[1] = 'T'; +} + +BEGIN +{ + trace(stringof(k)); + exit(k == "DTrace" ? 0 : 1); +} Copied: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d (from r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Fri Aug 19 16:38:57 2016 (r304467, copy of r304466, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +BEGIN +{ + this->j = probeprov; + this->j[0] = 'D'; + this->j[1] = 'T'; +} + +BEGIN +{ + trace(this->j); + exit(this->j == "DTrace" ? 0 : 1); +} Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Fri Aug 19 16:38:57 2016 (r304467) @@ -21,8 +21,9 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2015 Gary Mills */ /* @@ -119,7 +120,6 @@ static const dtrace_diftype_t dt_int_rty static void *dt_compile(dtrace_hdl_t *, int, dtrace_probespec_t, void *, uint_t, int, char *const[], FILE *, const char *); - /*ARGSUSED*/ static int dt_idreset(dt_idhash_t *dhp, dt_ident_t *idp, void *ignored) @@ -2435,7 +2435,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex dt_node_t *dnp; dt_decl_t *ddp; dt_pcb_t pcb; - void *rv; + void *volatile rv; int err; if ((fp == NULL && s == NULL) || (cflags & ~DTRACE_C_MASK) != 0) { @@ -2518,6 +2518,28 @@ dt_compile(dtrace_hdl_t *dtp, int contex } /* + * Perform sugar transformations (for "if" / "else") and replace the + * existing clause chain with the new one. + */ + if (context == DT_CTX_DPROG) { + dt_node_t *dnp, *next_dnp; + dt_node_t *new_list = NULL; + + for (dnp = yypcb->pcb_root->dn_list; + dnp != NULL; dnp = next_dnp) { + /* remove this node from the list */ + next_dnp = dnp->dn_list; + dnp->dn_list = NULL; + + if (dnp->dn_kind == DT_NODE_CLAUSE) + dnp = dt_compile_sugar(dtp, dnp); + /* append node to the new list */ + new_list = dt_node_link(new_list, dnp); + } + yypcb->pcb_root->dn_list = new_list; + } + + /* * If we have successfully created a parse tree for a D program, loop * over the clauses and actions and instantiate the corresponding * libdtrace program. If we are parsing a D expression, then we @@ -2537,6 +2559,8 @@ dt_compile(dtrace_hdl_t *dtp, int contex for (; dnp != NULL; dnp = dnp->dn_list) { switch (dnp->dn_kind) { case DT_NODE_CLAUSE: + if (DT_TREEDUMP_PASS(dtp, 4)) + dt_printd(dnp, stderr, 0); dt_compile_clause(dtp, dnp); break; case DT_NODE_XLATOR: Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Fri Aug 19 16:38:57 2016 (r304467) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -155,6 +156,8 @@ %type probe_specifier_list %type probe_specifier %type statement_list +%type statement_list_impl +%type statement_or_block %type statement %type declaration %type init_declarator_list @@ -319,9 +322,11 @@ probe_definition: "or actions following probe description\n"); } $$ = dt_node_clause($1, NULL, NULL); + yybegin(YYS_CLAUSE); } | probe_specifiers '{' statement_list '}' { $$ = dt_node_clause($1, NULL, $3); + yybegin(YYS_CLAUSE); } | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED { dnerror($3, D_SYNTAX, "expected actions { } following " @@ -330,6 +335,7 @@ probe_definition: | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED '{' statement_list '}' { $$ = dt_node_clause($1, $3, $6); + yybegin(YYS_CLAUSE); } ; @@ -349,12 +355,30 @@ probe_specifier: | DT_TOK_INT { $$ = dt_node_pdesc_by_id($1); } ; -statement_list: statement { $$ = $1; } - | statement_list ';' statement { $$ = LINK($1, $3); } +statement_list_impl: /* empty */ { $$ = NULL; } + | statement_list_impl statement { $$ = LINK($1, $2); } + ; + +statement_list: + statement_list_impl { $$ = $1; } + | statement_list_impl expression { + $$ = LINK($1, dt_node_statement($2)); + } ; -statement: /* empty */ { $$ = NULL; } - | expression { $$ = dt_node_statement($1); } +statement_or_block: + statement + | '{' statement_list '}' { $$ = $2; } + +statement: ';' { $$ = NULL; } + | expression ';' { $$ = dt_node_statement($1); } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR statement_or_block { + $$ = dt_node_if($3, $5, NULL); + } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR + statement_or_block DT_KEY_ELSE statement_or_block { + $$ = dt_node_if($3, $5, $7); + } ; argument_expression_list: Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Fri Aug 19 16:38:57 2016 (r304467) @@ -26,7 +26,7 @@ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ #ifndef _DT_IMPL_H @@ -362,6 +362,7 @@ struct dtrace_hdl { int dt_indent; /* recommended flow indent */ dtrace_epid_t dt_last_epid; /* most recently consumed EPID */ uint64_t dt_last_timestamp; /* most recently consumed timestamp */ + boolean_t dt_has_sugar; /* syntactic sugar used? */ }; /* Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 19 16:38:57 2016 (r304467) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #include @@ -130,8 +130,9 @@ #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) #define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) -#define DT_VERS_LATEST DT_VERS_1_12_1 -#define DT_VERS_STRING "Sun D 1.12.1" +#define DT_VERS_1_13 DT_VERSION_NUMBER(1, 13, 0) +#define DT_VERS_LATEST DT_VERS_1_13 +#define DT_VERS_STRING "Sun D 1.13" const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ @@ -157,6 +158,7 @@ const dt_version_t _dtrace_versions[] = DT_VERS_1_11, /* D API 1.11 */ DT_VERS_1_12, /* D API 1.12 */ DT_VERS_1_12_1, /* D API 1.12.1 */ + DT_VERS_1_13, /* D API 1.13 */ 0 }; Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Fri Aug 19 16:38:57 2016 (r304467) @@ -23,7 +23,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -2143,6 +2143,17 @@ dt_node_statement(dt_node_t *expr) } dt_node_t * +dt_node_if(dt_node_t *pred, dt_node_t *acts, dt_node_t *else_acts) +{ + dt_node_t *dnp = dt_node_alloc(DT_NODE_IF); + dnp->dn_conditional = pred; + dnp->dn_body = acts; + dnp->dn_alternate_body = else_acts; + + return (dnp); +} + +dt_node_t * dt_node_pdesc_by_name(char *spec) { dtrace_hdl_t *dtp = yypcb->pcb_hdl; @@ -2211,7 +2222,6 @@ dt_node_clause(dt_node_t *pdescs, dt_nod dnp->dn_pred = pred; dnp->dn_acts = acts; - yybegin(YYS_CLAUSE); return (dnp); } @@ -3203,8 +3213,9 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla dt_xcook_ident(lp, dhp, idkind, B_TRUE); else dt_xcook_ident(lp, dhp, idp->di_kind, B_FALSE); - } else + } else { lp = dnp->dn_left = dt_node_cook(lp, 0); + } /* * Switch op to '+' for *(E1 + E2) array mode in these cases: @@ -3218,10 +3229,12 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla if (lp->dn_ident->di_kind == DT_IDENT_ARRAY) { if (lp->dn_args != NULL) op = DT_TOK_ADD; - } else if (!dt_ident_unref(lp->dn_ident)) + } else if (!dt_ident_unref(lp->dn_ident)) { op = DT_TOK_ADD; - } else if (lp->dn_kind != DT_NODE_AGG) + } + } else if (lp->dn_kind != DT_NODE_AGG) { op = DT_TOK_ADD; + } } switch (op) { @@ -3645,45 +3658,34 @@ asgn_common: case DT_TOK_PTR: /* - * If the left-hand side of operator -> is the name "self", - * then we permit a TLS variable to be created or referenced. + * If the left-hand side of operator -> is one of the scoping + * keywords, permit a local or thread variable to be created or + * referenced. */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "self") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, dtp->dt_tls, - DT_IDENT_SCALAR, B_TRUE); - } - - if (idflags != 0) - rp = dt_node_cook(rp, idflags); - - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); - } + if (lp->dn_kind == DT_NODE_IDENT) { + dt_idhash_t *dhp = NULL; - /* - * If the left-hand side of operator -> is the name "this", - * then we permit a local variable to be created or referenced. - */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "this") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, yypcb->pcb_locals, - DT_IDENT_SCALAR, B_TRUE); + if (strcmp(lp->dn_string, "self") == 0) { + dhp = dtp->dt_tls; + } else if (strcmp(lp->dn_string, "this") == 0) { + dhp = yypcb->pcb_locals; } + if (dhp != NULL) { + if (rp->dn_kind != DT_NODE_VAR) { + dt_xcook_ident(rp, dhp, + DT_IDENT_SCALAR, B_TRUE); + } - if (idflags != 0) - rp = dt_node_cook(rp, idflags); + if (idflags != 0) + rp = dt_node_cook(rp, idflags); - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); + /* avoid freeing rp */ + dnp->dn_right = dnp->dn_left; + dt_node_free(dnp); + return (rp); + } } - /*FALLTHRU*/ - case DT_TOK_DOT: lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF); @@ -4502,7 +4504,8 @@ static dt_node_t *(*dt_cook_funcs[])(dt_ dt_cook_xlator, /* DT_NODE_XLATOR */ dt_cook_none, /* DT_NODE_PROBE */ dt_cook_provider, /* DT_NODE_PROVIDER */ - dt_cook_none /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_IF */ }; /* @@ -4517,6 +4520,8 @@ dt_node_cook(dt_node_t *dnp, uint_t idfl yylineno = dnp->dn_line; + assert(dnp->dn_kind < + sizeof (dt_cook_funcs) / sizeof (dt_cook_funcs[0])); dnp = dt_cook_funcs[dnp->dn_kind](dnp, idflags); dnp->dn_flags |= DT_NF_COOKED; @@ -4619,6 +4624,181 @@ dt_node_diftype(dtrace_hdl_t *dtp, const tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type); } +/* + * Output the parse tree as D. The "-xtree=8" argument will call this + * function to print out the program after any syntactic sugar + * transformations have been applied (e.g. to implement "if"). The + * resulting output can be used to understand the transformations + * applied by these features, or to run such a script on a system that + * does not support these features + * + * Note that the output does not express precisely the same program as + * the input. In particular: + * - Only the clauses are output. #pragma options, variable + * declarations, etc. are excluded. + * - Command argument substitution has already been done, so the output + * will not contain e.g. $$1, but rather the substituted string. + */ +void +dt_printd(dt_node_t *dnp, FILE *fp, int depth) +{ + dt_node_t *arg; + + switch (dnp->dn_kind) { + case DT_NODE_INT: + (void) fprintf(fp, "0x%llx", (u_longlong_t)dnp->dn_value); + if (!(dnp->dn_flags & DT_NF_SIGNED)) + (void) fprintf(fp, "u"); + break; + + case DT_NODE_STRING: { + char *escd = strchr2esc(dnp->dn_string, strlen(dnp->dn_string)); + (void) fprintf(fp, "\"%s\"", escd); + free(escd); + break; + } + + case DT_NODE_IDENT: + (void) fprintf(fp, "%s", dnp->dn_string); + break; + + case DT_NODE_VAR: + (void) fprintf(fp, "%s%s", + (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) ? "this->" : + (dnp->dn_ident->di_flags & DT_IDFLG_TLS) ? "self->" : "", + dnp->dn_ident->di_name); + + if (dnp->dn_args != NULL) { + (void) fprintf(fp, "["); + + for (arg = dnp->dn_args; arg != NULL; + arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + + (void) fprintf(fp, "]"); + } + break; + + case DT_NODE_SYM: { + const dtrace_syminfo_t *dts = dnp->dn_ident->di_data; + (void) fprintf(fp, "%s`%s", dts->dts_object, dts->dts_name); + break; + } + case DT_NODE_FUNC: + (void) fprintf(fp, "%s(", dnp->dn_ident->di_name); + + for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP1: + (void) fprintf(fp, "%s(", opstr(dnp->dn_op)); + dt_printd(dnp->dn_child, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP2: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_left, fp, 0); + if (dnp->dn_op == DT_TOK_LPAR) { + (void) fprintf(fp, ")"); + dt_printd(dnp->dn_right, fp, 0); + break; + } + if (dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT || + dnp->dn_op == DT_TOK_LBRAC) + (void) fprintf(fp, "%s", opstr(dnp->dn_op)); + else + (void) fprintf(fp, " %s ", opstr(dnp->dn_op)); + dt_printd(dnp->dn_right, fp, 0); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + (void) fprintf(fp, ", "); + dt_printd(ln->dn_list, fp, depth); + ln = ln->dn_list; + } + (void) fprintf(fp, "]"); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP3: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_expr, fp, 0); + (void) fprintf(fp, " ? "); + dt_printd(dnp->dn_left, fp, 0); + (void) fprintf(fp, " : "); + dt_printd(dnp->dn_right, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_DEXPR: + case DT_NODE_DFUNC: + (void) fprintf(fp, "%*s", depth * 8, ""); + dt_printd(dnp->dn_expr, fp, depth + 1); + (void) fprintf(fp, ";\n"); + break; + + case DT_NODE_PDESC: + (void) fprintf(fp, "%s:%s:%s:%s", + dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod, + dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name); + break; + + case DT_NODE_CLAUSE: + for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ","); + (void) fprintf(fp, "\n"); + } + + if (dnp->dn_pred != NULL) { + (void) fprintf(fp, "/"); + dt_printd(dnp->dn_pred, fp, 0); + (void) fprintf(fp, "/\n"); + } + (void) fprintf(fp, "{\n"); + + for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "}\n"); + (void) fprintf(fp, "\n"); + break; + + case DT_NODE_IF: + (void) fprintf(fp, "%*sif (", depth * 8, ""); + dt_printd(dnp->dn_conditional, fp, 0); + (void) fprintf(fp, ") {\n"); + + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + if (dnp->dn_alternate_body == NULL) { + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } else { + (void) fprintf(fp, "%*s} else {\n", depth * 8, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } + + break; + + default: + (void) fprintf(fp, "/* bad node %p, kind %d */\n", + (void *)dnp, dnp->dn_kind); + } +} + void dt_node_printr(dt_node_t *dnp, FILE *fp, int depth) { @@ -4729,6 +4909,13 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, (void) fprintf(fp, "OP2 %s (%s)\n", opstr(dnp->dn_op), buf); dt_node_printr(dnp->dn_left, fp, depth + 1); dt_node_printr(dnp->dn_right, fp, depth + 1); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + dt_node_printr(ln->dn_list, fp, depth + 1); + ln = ln->dn_list; + } + } break; case DT_NODE_OP3: @@ -4790,6 +4977,7 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) dt_node_printr(arg, fp, depth + 1); + (void) fprintf(fp, "\n"); break; case DT_NODE_INLINE: @@ -4840,6 +5028,24 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, dt_node_printr(arg, fp, depth + 1); break; + case DT_NODE_IF: + (void) fprintf(fp, "IF attr=%s CONDITION:\n", a); + + dt_node_printr(dnp->dn_conditional, fp, depth + 1); + + (void) fprintf(fp, "%*sIF BODY: \n", depth * 2, ""); + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + + if (dnp->dn_alternate_body != NULL) { + (void) fprintf(fp, "%*sIF ELSE: \n", depth * 2, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + } + + break; + default: (void) fprintf(fp, "\n", (void *)dnp, dnp->dn_kind); Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Fri Aug 19 13:39:36 2016 (r304466) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Fri Aug 19 16:38:57 2016 (r304467) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -105,6 +105,12 @@ typedef struct dt_node { struct dt_node *_probes; /* list of probe nodes */ int _redecl; /* provider redeclared */ } _provider; + + struct { + struct dt_node *_conditional; + struct dt_node *_body; + struct dt_node *_alternate_body; + } _conditional; } dn_u; struct dt_node *dn_list; /* parse tree list link */ @@ -140,6 +146,11 @@ typedef struct dt_node { #define dn_provred dn_u._provider._redecl /* DT_NODE_PROVIDER */ #define dn_probes dn_u._provider._probes /* DT_NODE_PROVIDER */ +/* DT_NODE_IF: */ +#define dn_conditional dn_u._conditional._conditional +#define dn_body dn_u._conditional._body +#define dn_alternate_body dn_u._conditional._alternate_body + #define DT_NODE_FREE 0 /* unused node (waiting to be freed) */ #define DT_NODE_INT 1 /* integer value */ #define DT_NODE_STRING 2 /* string value */ @@ -162,6 +173,7 @@ typedef struct dt_node { #define DT_NODE_PROBE 19 /* probe definition */ #define DT_NODE_PROVIDER 20 /* provider definition */ #define DT_NODE_PROG 21 /* program translation unit */ +#define DT_NODE_IF 22 /* if statement */ #define DT_NF_SIGNED 0x01 /* data is a signed quantity (else unsigned) */ #define DT_NF_COOKED 0x02 /* data is a known type (else still cooking) */ @@ -213,6 +225,7 @@ extern dt_node_t *dt_node_xlator(dt_decl extern dt_node_t *dt_node_probe(char *, int, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_provider(char *, dt_node_t *); extern dt_node_t *dt_node_program(dt_node_t *); +extern dt_node_t *dt_node_if(dt_node_t *, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_link(dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_cook(dt_node_t *, uint_t); @@ -237,6 +250,7 @@ extern void dt_node_promote(dt_node_t *, extern void dt_node_diftype(dtrace_hdl_t *, const dt_node_t *, dtrace_diftype_t *); extern void dt_node_printr(dt_node_t *, FILE *, int); +extern void dt_printd(dt_node_t *, FILE *, int); extern const char *dt_node_name(const dt_node_t *, char *, size_t); extern int dt_node_root(dt_node_t *); Copied: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c (from r304466, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c Fri Aug 19 16:38:57 2016 (r304467, copy of r304466, head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c) @@ -0,0 +1,516 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + */ + +/* + * Syntactic sugar features are implemented by transforming the D parse tree + * such that it only uses the subset of D that is supported by the rest of the + * compiler / the kernel. A clause containing these language features is + * referred to as a "super-clause", and its transformation typically entails + * creating several "sub-clauses" to implement it. For diagnosability, the + * sub-clauses will be printed if the "-xtree=8" flag is specified. + * + * Currently, the only syntactic sugar feature is "if/else" statements. Each + * basic block (e.g. the body of the "if" and "else" statements, and the + * statements before and after) is turned into its own sub-clause, with a + * predicate that causes it to be executed only if the code flows to this point. + * Nested if/else statements are supported. + * + * This infrastructure is designed to accommodate other syntactic sugar features + * in the future. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct dt_sugar_parse { + dtrace_hdl_t *dtsp_dtp; /* dtrace handle */ + dt_node_t *dtsp_pdescs; /* probe descriptions */ + int dtsp_num_conditions; /* number of condition variables */ + int dtsp_num_ifs; /* number of "if" statements */ + dt_node_t *dtsp_clause_list; /* list of clauses */ +} dt_sugar_parse_t; + +static void dt_sugar_visit_stmts(dt_sugar_parse_t *, dt_node_t *, int); + +/* + * Return a node for "self->%error". + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + * + * This error variable is used to keep track of if there has been an error + * in any of the sub-clauses, and is used to prevent execution of subsequent + * sub-clauses following an error. + */ +static dt_node_t * +dt_sugar_new_error_var(void) +{ + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("self")), + dt_node_ident(strdup("%error")))); +} + +/* + * Append this clause to the clause list. + */ +static void +dt_sugar_append_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(dp->dtsp_clause_list, clause); +} + +/* + * Prepend this clause to the clause list. + */ +static void +dt_sugar_prepend_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(clause, dp->dtsp_clause_list); +} + +/* + * Return a node for "this->%condition_", or NULL if condid==0. + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + */ +static dt_node_t * +dt_sugar_new_condition_var(int condid) +{ + char *str; + + if (condid == 0) + return (NULL); + assert(condid > 0); + + (void) asprintf(&str, "%%condition_%d", ABS(condid)); + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("this")), + dt_node_ident(str))); +} + +/* + * Return new clause to evaluate predicate and set newcond. condid is + * the condition that we are already under, or 0 if none. + * The new clause will be of the form: + * + * dp_pdescs + * /!self->%error/ + * { + * this->%condition_ = + * (this->%condition_ && pred); + * } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Fri Aug 19 16:45:25 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 016C2BBFB10 for ; Fri, 19 Aug 2016 16:45:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0FF1F66; Fri, 19 Aug 2016 16:45:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JGjNlw003225; Fri, 19 Aug 2016 16:45:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JGjMuY003209; Fri, 19 Aug 2016 16:45:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608191645.u7JGjMuY003209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Aug 2016 16:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304468 - in user/alc/PG_CACHED: . cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars c... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 16:45:25 -0000 Author: markj Date: Fri Aug 19 16:45:21 2016 New Revision: 304468 URL: https://svnweb.freebsd.org/changeset/base/304468 Log: Merge from PQ_LAUNDRY at r304467. Added: user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d - copied unchanged from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d - copied unchanged from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sugar/ - copied from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sugar/ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c user/alc/PG_CACHED/cddl/usr.sbin/dtrace/tests/common/sugar/ - copied from r304467, user/alc/PQ_LAUNDRY/cddl/usr.sbin/dtrace/tests/common/sugar/ user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu - copied unchanged from r304467, user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_write_disk_secure744.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure744.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_write_disk_secure745.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure745.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_write_disk_secure746.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/contrib/libarchive/libarchive/test/test_write_disk_secure746.c user/alc/PG_CACHED/lib/libc/string/timingsafe_bcmp.3 - copied unchanged from r304467, user/alc/PQ_LAUNDRY/lib/libc/string/timingsafe_bcmp.3 user/alc/PG_CACHED/lib/libc/string/timingsafe_bcmp.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/lib/libc/string/timingsafe_bcmp.c user/alc/PG_CACHED/lib/libc/string/timingsafe_memcmp.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/lib/libc/string/timingsafe_memcmp.c user/alc/PG_CACHED/lib/libc/sys/fdatasync.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/lib/libc/sys/fdatasync.c user/alc/PG_CACHED/lib/libc/x86/ - copied from r304467, user/alc/PQ_LAUNDRY/lib/libc/x86/ user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-aarch64.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-aarch64.h.in user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-arm.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-arm.h.in user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-mips.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-mips.h.in user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-powerpc.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-powerpc.h.in user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-riscv.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-riscv.h.in user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-sparc64.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-sparc64.h.in user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-x86.h.in - copied unchanged from r304467, user/alc/PQ_LAUNDRY/secure/lib/libcrypto/opensslconf-x86.h.in user/alc/PG_CACHED/sys/arm/allwinner/a10/a10_padconf.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10/a10_padconf.c user/alc/PG_CACHED/sys/arm/allwinner/a10/files.a10 - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/allwinner/a10/files.a10 user/alc/PG_CACHED/sys/arm/allwinner/aw_machdep.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_machdep.c user/alc/PG_CACHED/sys/arm/allwinner/aw_machdep.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/allwinner/aw_machdep.h user/alc/PG_CACHED/sys/arm/allwinner/files.allwinner_up - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/allwinner/files.allwinner_up user/alc/PG_CACHED/sys/arm/allwinner/std.allwinner_up - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/allwinner/std.allwinner_up user/alc/PG_CACHED/sys/arm/conf/ALLWINNER_UP - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/arm/conf/ALLWINNER_UP user/alc/PG_CACHED/sys/cddl/boot/zfs/skein_zfs.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/skein_zfs.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_common.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_common.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_common.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_common.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_parser.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parser.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_parser.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parser.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_parserreg.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parserreg.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_parservar.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvram_parservar.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvramvar.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_nvramvar.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_sprom_parser.c - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_parser.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_sprom_parser.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_parser.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_sprom_parservar.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/bhnd/nvram/bhnd_sprom_parservar.h user/alc/PG_CACHED/sys/dev/qlxgbe/ql_minidump.h - copied unchanged from r304467, user/alc/PQ_LAUNDRY/sys/dev/qlxgbe/ql_minidump.h Deleted: user/alc/PG_CACHED/lib/libc/amd64/sys/__vdso_gettc.c user/alc/PG_CACHED/lib/libc/i386/sys/__vdso_gettc.c user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-aarch64.h user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-arm.h user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-mips.h user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-powerpc.h user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-riscv.h user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-sparc64.h user/alc/PG_CACHED/secure/lib/libcrypto/opensslconf-x86.h user/alc/PG_CACHED/share/man/man4/mcd.4 user/alc/PG_CACHED/sys/arm/allwinner/a10_padconf.c user/alc/PG_CACHED/sys/arm/allwinner/allwinner_machdep.c user/alc/PG_CACHED/sys/arm/allwinner/allwinner_machdep.h user/alc/PG_CACHED/sys/arm/allwinner/files.a10 user/alc/PG_CACHED/sys/arm/allwinner/std.a10 user/alc/PG_CACHED/sys/arm/conf/A10 user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_sprom_subr.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_spromreg.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/nvram_subr.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/nvramvar.h user/alc/PG_CACHED/sys/dev/mcd/ user/alc/PG_CACHED/sys/modules/mcd/ Modified: user/alc/PG_CACHED/Makefile.inc1 user/alc/PG_CACHED/ObsoleteFiles.inc user/alc/PG_CACHED/UPDATING user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h user/alc/PG_CACHED/cddl/lib/libdtrace/Makefile user/alc/PG_CACHED/cddl/usr.sbin/dtrace/tests/common/Makefile user/alc/PG_CACHED/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile user/alc/PG_CACHED/cddl/usr.sbin/dtrace/tests/tools/exclude.sh user/alc/PG_CACHED/contrib/elftoolchain/elfcopy/ascii.c user/alc/PG_CACHED/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 user/alc/PG_CACHED/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c user/alc/PG_CACHED/contrib/libarchive/cat/test/test_version.c user/alc/PG_CACHED/contrib/libarchive/cpio/cmdline.c user/alc/PG_CACHED/contrib/libarchive/cpio/test/test_option_version.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_match.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_ppmd7_private.h user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_add_passphrase.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_disk_posix.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_private.h user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_support_format_lha.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_read_support_format_warc.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_util.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_write_disk_acl.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_write_disk_posix.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c user/alc/PG_CACHED/contrib/libarchive/libarchive/archive_write_set_format_ustar.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/main.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test.h user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_archive_string_conversion.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_fuzz.c user/alc/PG_CACHED/contrib/libarchive/libarchive/test/test_read_format_rar.c user/alc/PG_CACHED/contrib/libarchive/tar/cmdline.c user/alc/PG_CACHED/contrib/libarchive/tar/test/test_version.c user/alc/PG_CACHED/contrib/llvm/lib/Target/X86/X86.td user/alc/PG_CACHED/contrib/llvm/tools/clang/lib/Basic/Targets.cpp user/alc/PG_CACHED/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c user/alc/PG_CACHED/etc/mtree/BSD.tests.dist user/alc/PG_CACHED/etc/periodic/daily/480.leapfile-ntpd user/alc/PG_CACHED/etc/portsnap.conf user/alc/PG_CACHED/include/string.h user/alc/PG_CACHED/include/unistd.h user/alc/PG_CACHED/lib/clang/freebsd_cc_version.h user/alc/PG_CACHED/lib/libarchive/tests/Makefile user/alc/PG_CACHED/lib/libc/Makefile user/alc/PG_CACHED/lib/libc/aarch64/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/aarch64/sys/__vdso_gettc.c user/alc/PG_CACHED/lib/libc/amd64/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/arm/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/arm/sys/__vdso_gettc.c user/alc/PG_CACHED/lib/libc/gen/sem_timedwait.3 user/alc/PG_CACHED/lib/libc/i386/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/include/libc_private.h user/alc/PG_CACHED/lib/libc/mips/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/net/inet_net.3 user/alc/PG_CACHED/lib/libc/net/nss_compat.c user/alc/PG_CACHED/lib/libc/powerpc/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/powerpc64/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/riscv/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/sparc64/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/string/Makefile.inc user/alc/PG_CACHED/lib/libc/string/Symbol.map user/alc/PG_CACHED/lib/libc/string/bcmp.3 user/alc/PG_CACHED/lib/libc/string/memcmp.3 user/alc/PG_CACHED/lib/libc/sys/Makefile.inc user/alc/PG_CACHED/lib/libc/sys/Symbol.map user/alc/PG_CACHED/lib/libc/sys/__vdso_gettimeofday.c user/alc/PG_CACHED/lib/libc/sys/bind.2 user/alc/PG_CACHED/lib/libc/sys/connect.2 user/alc/PG_CACHED/lib/libc/sys/fsync.2 user/alc/PG_CACHED/lib/libc/sys/interposing_table.c user/alc/PG_CACHED/lib/libc/sys/listen.2 user/alc/PG_CACHED/lib/libc/sys/recv.2 user/alc/PG_CACHED/lib/libc/sys/send.2 user/alc/PG_CACHED/lib/libc/sys/socket.2 user/alc/PG_CACHED/lib/libc/sys/trivial-vdso_tc.c user/alc/PG_CACHED/lib/libthr/arch/mips/include/pthread_md.h user/alc/PG_CACHED/lib/libthr/thread/thr_syscalls.c user/alc/PG_CACHED/sbin/fsck_ffs/fsck.h user/alc/PG_CACHED/sbin/fsck_ffs/globs.c user/alc/PG_CACHED/sbin/fsck_ffs/main.c user/alc/PG_CACHED/sbin/fsck_ffs/setup.c user/alc/PG_CACHED/sbin/ipfw/ipfw2.c user/alc/PG_CACHED/sbin/ipfw/nat64lsn.c user/alc/PG_CACHED/sbin/ipfw/nat64stl.c user/alc/PG_CACHED/sbin/ipfw/nptv6.c user/alc/PG_CACHED/secure/lib/libcrypto/Makefile user/alc/PG_CACHED/secure/lib/libcrypto/Makefile.asm user/alc/PG_CACHED/secure/lib/libcrypto/Makefile.inc user/alc/PG_CACHED/share/man/man3/pthread_testcancel.3 user/alc/PG_CACHED/share/man/man3/queue.3 user/alc/PG_CACHED/share/man/man4/Makefile user/alc/PG_CACHED/share/man/man4/rights.4 user/alc/PG_CACHED/share/man/man4/tcp.4 user/alc/PG_CACHED/share/man/man9/tcp_functions.9 user/alc/PG_CACHED/share/timedef/ko_KR.UTF-8.src user/alc/PG_CACHED/share/timedef/ko_KR.eucKR.src (contents, props changed) user/alc/PG_CACHED/share/timedef/zh_CN.GB2312.src (contents, props changed) user/alc/PG_CACHED/share/timedef/zh_CN.GBK.src (contents, props changed) user/alc/PG_CACHED/share/timedef/zh_CN.UTF-8.src user/alc/PG_CACHED/share/timedef/zh_CN.eucCN.src (contents, props changed) user/alc/PG_CACHED/share/timedef/zh_HK.UTF-8.src (contents, props changed) user/alc/PG_CACHED/share/timedef/zh_TW.Big5.src (contents, props changed) user/alc/PG_CACHED/share/timedef/zh_TW.UTF-8.src (contents, props changed) user/alc/PG_CACHED/sys/arm/allwinner/a10_ehci.c user/alc/PG_CACHED/sys/arm/allwinner/a10_gpio.c user/alc/PG_CACHED/sys/arm/allwinner/a10_mmc.c user/alc/PG_CACHED/sys/arm/allwinner/aw_if_dwc.c user/alc/PG_CACHED/sys/arm/allwinner/aw_mp.c user/alc/PG_CACHED/sys/arm/allwinner/aw_rtc.c user/alc/PG_CACHED/sys/arm/allwinner/clk/aw_pll.c user/alc/PG_CACHED/sys/arm/allwinner/files.allwinner user/alc/PG_CACHED/sys/arm/allwinner/timer.c user/alc/PG_CACHED/sys/arm/arm/generic_timer.c user/alc/PG_CACHED/sys/arm/arm/machdep.c user/alc/PG_CACHED/sys/arm/arm/nexus.c user/alc/PG_CACHED/sys/arm/include/md_var.h user/alc/PG_CACHED/sys/arm/include/vdso.h user/alc/PG_CACHED/sys/arm/nvidia/tegra_lic.c user/alc/PG_CACHED/sys/arm/nvidia/tegra_pcie.c user/alc/PG_CACHED/sys/arm/ti/omap4/omap4_wugen.c user/alc/PG_CACHED/sys/arm64/arm64/identcpu.c user/alc/PG_CACHED/sys/arm64/arm64/machdep.c user/alc/PG_CACHED/sys/arm64/arm64/nexus.c user/alc/PG_CACHED/sys/arm64/include/armreg.h user/alc/PG_CACHED/sys/arm64/include/md_var.h user/alc/PG_CACHED/sys/arm64/include/vdso.h user/alc/PG_CACHED/sys/boot/efi/boot1/Makefile user/alc/PG_CACHED/sys/boot/efi/boot1/boot1.c user/alc/PG_CACHED/sys/boot/efi/boot1/ufs_module.c user/alc/PG_CACHED/sys/boot/efi/boot1/zfs_module.c user/alc/PG_CACHED/sys/boot/efi/libefi/efi_console.c user/alc/PG_CACHED/sys/boot/efi/loader/Makefile user/alc/PG_CACHED/sys/boot/fdt/dts/arm/bananapi.dts user/alc/PG_CACHED/sys/boot/i386/boot2/Makefile user/alc/PG_CACHED/sys/boot/i386/gptboot/Makefile user/alc/PG_CACHED/sys/boot/i386/gptboot/gptldr.S user/alc/PG_CACHED/sys/boot/i386/gptzfsboot/Makefile user/alc/PG_CACHED/sys/boot/i386/zfsboot/Makefile user/alc/PG_CACHED/sys/boot/i386/zfsboot/zfsboot.c user/alc/PG_CACHED/sys/boot/i386/zfsboot/zfsldr.S user/alc/PG_CACHED/sys/boot/userboot/ficl/Makefile user/alc/PG_CACHED/sys/boot/userboot/userboot/Makefile user/alc/PG_CACHED/sys/boot/userboot/zfs/Makefile user/alc/PG_CACHED/sys/boot/zfs/Makefile user/alc/PG_CACHED/sys/boot/zfs/zfsimpl.c user/alc/PG_CACHED/sys/cam/cam.c user/alc/PG_CACHED/sys/cddl/boot/zfs/fletcher.c user/alc/PG_CACHED/sys/cddl/boot/zfs/sha256.c user/alc/PG_CACHED/sys/cddl/boot/zfs/zfsimpl.h user/alc/PG_CACHED/sys/cddl/boot/zfs/zfssubr.c user/alc/PG_CACHED/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c user/alc/PG_CACHED/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h user/alc/PG_CACHED/sys/compat/cloudabi/cloudabi_fd.c user/alc/PG_CACHED/sys/compat/freebsd32/freebsd32_proto.h user/alc/PG_CACHED/sys/compat/freebsd32/freebsd32_syscall.h user/alc/PG_CACHED/sys/compat/freebsd32/freebsd32_syscalls.c user/alc/PG_CACHED/sys/compat/freebsd32/freebsd32_sysent.c user/alc/PG_CACHED/sys/compat/freebsd32/freebsd32_systrace_args.c user/alc/PG_CACHED/sys/compat/freebsd32/syscalls.master user/alc/PG_CACHED/sys/compat/linux/linux_file.c user/alc/PG_CACHED/sys/conf/NOTES user/alc/PG_CACHED/sys/conf/files user/alc/PG_CACHED/sys/conf/options user/alc/PG_CACHED/sys/ddb/db_ps.c user/alc/PG_CACHED/sys/ddb/db_run.c user/alc/PG_CACHED/sys/dev/acpica/acpi_hpet.c user/alc/PG_CACHED/sys/dev/acpica/acpi_hpet.h user/alc/PG_CACHED/sys/dev/bhnd/bhnd.c user/alc/PG_CACHED/sys/dev/bhnd/bhnd.h user/alc/PG_CACHED/sys/dev/bhnd/bhnd_bus_if.m user/alc/PG_CACHED/sys/dev/bhnd/bhnd_subr.c user/alc/PG_CACHED/sys/dev/bhnd/bhnd_types.h user/alc/PG_CACHED/sys/dev/bhnd/bhndb/bhndb_private.h user/alc/PG_CACHED/sys/dev/bhnd/bhndb/bhndb_subr.c user/alc/PG_CACHED/sys/dev/bhnd/bhndvar.h user/alc/PG_CACHED/sys/dev/bhnd/cores/chipc/chipc.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram.h user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_nvram_if.m user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_sprom.c user/alc/PG_CACHED/sys/dev/bhnd/nvram/bhnd_spromvar.h user/alc/PG_CACHED/sys/dev/bhnd/tools/nvram_map_gen.awk user/alc/PG_CACHED/sys/dev/bwn/bwn_mac.c user/alc/PG_CACHED/sys/dev/cxgbe/common/common.h user/alc/PG_CACHED/sys/dev/cxgbe/common/t4_hw.c user/alc/PG_CACHED/sys/dev/cxgbe/t4_main.c user/alc/PG_CACHED/sys/dev/cxgbe/t4_sge.c user/alc/PG_CACHED/sys/dev/e1000/e1000_api.c user/alc/PG_CACHED/sys/dev/e1000/e1000_hw.h user/alc/PG_CACHED/sys/dev/e1000/e1000_ich8lan.c user/alc/PG_CACHED/sys/dev/e1000/e1000_ich8lan.h user/alc/PG_CACHED/sys/dev/e1000/e1000_phy.c user/alc/PG_CACHED/sys/dev/e1000/if_em.c user/alc/PG_CACHED/sys/dev/fdt/simplebus.c user/alc/PG_CACHED/sys/dev/gpio/gpiobus.c user/alc/PG_CACHED/sys/dev/gpio/gpiobusvar.h user/alc/PG_CACHED/sys/dev/gpio/ofw_gpiobus.c user/alc/PG_CACHED/sys/dev/hyperv/include/vmbus.h user/alc/PG_CACHED/sys/dev/hyperv/netvsc/hv_net_vsc.c user/alc/PG_CACHED/sys/dev/hyperv/netvsc/hv_net_vsc.h user/alc/PG_CACHED/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c user/alc/PG_CACHED/sys/dev/hyperv/netvsc/hv_rndis.h user/alc/PG_CACHED/sys/dev/hyperv/netvsc/hv_rndis_filter.c user/alc/PG_CACHED/sys/dev/hyperv/netvsc/hv_rndis_filter.h user/alc/PG_CACHED/sys/dev/hyperv/netvsc/if_hnreg.h user/alc/PG_CACHED/sys/dev/hyperv/netvsc/if_hnvar.h user/alc/PG_CACHED/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c user/alc/PG_CACHED/sys/dev/hyperv/storvsc/hv_vstorage.h user/alc/PG_CACHED/sys/dev/hyperv/utilities/hv_heartbeat.c user/alc/PG_CACHED/sys/dev/hyperv/utilities/hv_kvp.c user/alc/PG_CACHED/sys/dev/hyperv/utilities/hv_shutdown.c user/alc/PG_CACHED/sys/dev/hyperv/utilities/hv_timesync.c user/alc/PG_CACHED/sys/dev/hyperv/utilities/hv_util.c user/alc/PG_CACHED/sys/dev/hyperv/utilities/hv_util.h user/alc/PG_CACHED/sys/dev/iicbus/ofw_iicbus.c user/alc/PG_CACHED/sys/dev/ofw/ofw_bus_subr.c user/alc/PG_CACHED/sys/dev/ofw/ofw_bus_subr.h user/alc/PG_CACHED/sys/dev/ofw/ofwbus.c user/alc/PG_CACHED/sys/dev/ofw/ofwpci.c user/alc/PG_CACHED/sys/dev/pci/pci_host_generic.c user/alc/PG_CACHED/sys/dev/pci/pci_pci.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_boot.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_dbg.h user/alc/PG_CACHED/sys/dev/qlxgbe/ql_def.h user/alc/PG_CACHED/sys/dev/qlxgbe/ql_fw.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_glbl.h user/alc/PG_CACHED/sys/dev/qlxgbe/ql_hw.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_hw.h user/alc/PG_CACHED/sys/dev/qlxgbe/ql_ioctl.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_ioctl.h user/alc/PG_CACHED/sys/dev/qlxgbe/ql_isr.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_minidump.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_os.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_reset.c user/alc/PG_CACHED/sys/dev/qlxgbe/ql_ver.h user/alc/PG_CACHED/sys/dev/syscons/syscons.c user/alc/PG_CACHED/sys/dev/syscons/syscons.h user/alc/PG_CACHED/sys/dev/usb/net/if_axge.c user/alc/PG_CACHED/sys/dev/usb/net/if_axgereg.h user/alc/PG_CACHED/sys/dev/vnic/mrml_bridge.c user/alc/PG_CACHED/sys/dev/vnic/thunder_mdio_fdt.c user/alc/PG_CACHED/sys/dev/vt/vt_core.c user/alc/PG_CACHED/sys/fs/msdosfs/msdosfs_vnops.c user/alc/PG_CACHED/sys/i386/i386/db_trace.c user/alc/PG_CACHED/sys/i386/include/db_machdep.h user/alc/PG_CACHED/sys/i386/include/md_var.h user/alc/PG_CACHED/sys/kern/bus_if.m user/alc/PG_CACHED/sys/kern/capabilities.conf user/alc/PG_CACHED/sys/kern/init_sysent.c user/alc/PG_CACHED/sys/kern/kern_exec.c user/alc/PG_CACHED/sys/kern/kern_sig.c user/alc/PG_CACHED/sys/kern/kern_tc.c user/alc/PG_CACHED/sys/kern/kern_timeout.c user/alc/PG_CACHED/sys/kern/kern_umtx.c user/alc/PG_CACHED/sys/kern/pic_if.m user/alc/PG_CACHED/sys/kern/subr_bus.c user/alc/PG_CACHED/sys/kern/subr_intr.c user/alc/PG_CACHED/sys/kern/subr_pcpu.c user/alc/PG_CACHED/sys/kern/sys_generic.c user/alc/PG_CACHED/sys/kern/syscalls.c user/alc/PG_CACHED/sys/kern/syscalls.master user/alc/PG_CACHED/sys/kern/systrace_args.c user/alc/PG_CACHED/sys/kern/uipc_shm.c user/alc/PG_CACHED/sys/kern/vfs_aio.c user/alc/PG_CACHED/sys/kern/vfs_default.c user/alc/PG_CACHED/sys/kern/vfs_syscalls.c user/alc/PG_CACHED/sys/kern/vnode_if.src user/alc/PG_CACHED/sys/mips/broadcom/bcm_machdep.c user/alc/PG_CACHED/sys/mips/conf/BCM user/alc/PG_CACHED/sys/mips/conf/BCM.hints user/alc/PG_CACHED/sys/mips/conf/SENTRY5 user/alc/PG_CACHED/sys/mips/conf/SENTRY5.hints user/alc/PG_CACHED/sys/mips/mips/cpu.c user/alc/PG_CACHED/sys/mips/mips/nexus.c user/alc/PG_CACHED/sys/modules/Makefile user/alc/PG_CACHED/sys/modules/bhnd/Makefile user/alc/PG_CACHED/sys/modules/dtb/allwinner/Makefile user/alc/PG_CACHED/sys/net/if_epair.c user/alc/PG_CACHED/sys/net/netisr.c user/alc/PG_CACHED/sys/net80211/ieee80211_ioctl.c user/alc/PG_CACHED/sys/netinet/in.c user/alc/PG_CACHED/sys/netinet/in.h user/alc/PG_CACHED/sys/netinet/ip_output.c user/alc/PG_CACHED/sys/netinet/sctputil.c user/alc/PG_CACHED/sys/netinet/tcp_lro.c user/alc/PG_CACHED/sys/netinet/tcp_subr.c user/alc/PG_CACHED/sys/netinet/tcp_syncache.c user/alc/PG_CACHED/sys/netinet/tcp_timer.c user/alc/PG_CACHED/sys/netinet/tcp_timer.h user/alc/PG_CACHED/sys/netinet/tcp_usrreq.c user/alc/PG_CACHED/sys/netinet/tcp_var.h user/alc/PG_CACHED/sys/netinet/udp_usrreq.c user/alc/PG_CACHED/sys/netpfil/ipfw/ip_fw_sockopt.c user/alc/PG_CACHED/sys/netpfil/ipfw/nat64/nat64_translate.c user/alc/PG_CACHED/sys/netpfil/pf/pf.c user/alc/PG_CACHED/sys/ofed/drivers/infiniband/core/ucma.c user/alc/PG_CACHED/sys/powerpc/mpc85xx/mpc85xx.c user/alc/PG_CACHED/sys/powerpc/mpc85xx/platform_mpc85xx.c user/alc/PG_CACHED/sys/sys/buf.h user/alc/PG_CACHED/sys/sys/bus.h user/alc/PG_CACHED/sys/sys/intr.h user/alc/PG_CACHED/sys/sys/param.h user/alc/PG_CACHED/sys/sys/queue.h user/alc/PG_CACHED/sys/sys/syscall.h user/alc/PG_CACHED/sys/sys/syscall.mk user/alc/PG_CACHED/sys/sys/syscallsubr.h user/alc/PG_CACHED/sys/sys/sysproto.h user/alc/PG_CACHED/sys/sys/timetc.h user/alc/PG_CACHED/sys/sys/vdso.h user/alc/PG_CACHED/sys/sys/vnode.h user/alc/PG_CACHED/sys/ufs/ffs/ffs_balloc.c user/alc/PG_CACHED/sys/ufs/ffs/ffs_extern.h user/alc/PG_CACHED/sys/ufs/ffs/ffs_softdep.c user/alc/PG_CACHED/sys/ufs/ffs/ffs_vnops.c user/alc/PG_CACHED/sys/ufs/ffs/softdep.h user/alc/PG_CACHED/sys/vm/vm_glue.c user/alc/PG_CACHED/sys/vm/vm_pageout.c user/alc/PG_CACHED/sys/x86/include/vdso.h user/alc/PG_CACHED/sys/x86/x86/tsc.c user/alc/PG_CACHED/tests/sys/kern/acct/acct_test.c user/alc/PG_CACHED/usr.bin/calendar/calendars/calendar.holiday user/alc/PG_CACHED/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan user/alc/PG_CACHED/usr.bin/netstat/inet6.c user/alc/PG_CACHED/usr.bin/nfsstat/Makefile user/alc/PG_CACHED/usr.bin/nfsstat/nfsstat.c user/alc/PG_CACHED/usr.bin/rpcgen/rpc_main.c user/alc/PG_CACHED/usr.bin/systat/main.c user/alc/PG_CACHED/usr.bin/tty/tty.c user/alc/PG_CACHED/usr.sbin/bsdinstall/partedit/gpart_ops.c Directory Properties: user/alc/PG_CACHED/ (props changed) user/alc/PG_CACHED/cddl/ (props changed) user/alc/PG_CACHED/cddl/contrib/opensolaris/ (props changed) user/alc/PG_CACHED/contrib/elftoolchain/ (props changed) user/alc/PG_CACHED/contrib/libarchive/ (props changed) user/alc/PG_CACHED/contrib/libarchive/cpio/ (props changed) user/alc/PG_CACHED/contrib/libarchive/libarchive/ (props changed) user/alc/PG_CACHED/contrib/libarchive/tar/ (props changed) user/alc/PG_CACHED/contrib/llvm/ (props changed) user/alc/PG_CACHED/contrib/llvm/tools/clang/ (props changed) user/alc/PG_CACHED/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/alc/PG_CACHED/Makefile.inc1 ============================================================================== --- user/alc/PG_CACHED/Makefile.inc1 Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/Makefile.inc1 Fri Aug 19 16:45:21 2016 (r304468) @@ -1581,10 +1581,6 @@ _groff= gnu/usr.bin/groff \ _vtfontcvt= usr.bin/vtfontcvt .endif -.if ${BOOTSTRAPPING} < 900002 -_sed= usr.bin/sed -.endif - .if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 @@ -1623,10 +1619,6 @@ _crunchide= usr.sbin/crunch/crunchide _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 -_awk= usr.bin/awk -.endif - # r296926 -P keymap search path, MFC to stable/10 in r298297 .if ${BOOTSTRAPPING} < 1003501 || \ (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) @@ -1694,7 +1686,6 @@ bootstrap-tools: .PHONY ${_gperf} \ ${_groff} \ ${_dtc} \ - ${_awk} \ ${_cat} \ ${_dd} \ ${_kbdcontrol} \ @@ -1702,7 +1693,6 @@ bootstrap-tools: .PHONY ${_libopenbsd} \ ${_makewhatis} \ usr.bin/rpcgen \ - ${_sed} \ ${_yacc} \ ${_m4} \ ${_lex} \ Modified: user/alc/PG_CACHED/ObsoleteFiles.inc ============================================================================== --- user/alc/PG_CACHED/ObsoleteFiles.inc Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/ObsoleteFiles.inc Fri Aug 19 16:45:21 2016 (r304468) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160815: Remove mcd(4) +OLD_FILES+=usr/share/man/man4/mcd.4.gz # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE Modified: user/alc/PG_CACHED/UPDATING ============================================================================== --- user/alc/PG_CACHED/UPDATING Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/UPDATING Fri Aug 19 16:45:21 2016 (r304468) @@ -31,6 +31,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160818: + The UDP receive code has been updated to only treat incoming UDP + packets that were addressed to an L2 broadcast address as L3 + broadcast packets. It is not expected that this will affect any + standards-conforming UDP application. The new behaviour can be + disabled by setting the sysctl net.inet.udp.require_l2_bcast to + 0. + +20160818: + Remove the openbsd_poll system call. + __FreeBSD_version has been bumped because of this. + 20160622: The libc stub for the pipe(2) system call has been replaced with a wrapper that calls the pipe2(2) system call and the pipe(2) Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Fri Aug 19 16:45:21 2016 (r304468) @@ -93,6 +93,9 @@ static int g_flowindent; static int g_intr; static int g_impatient; static int g_newline; +#ifdef __FreeBSD__ +static int g_siginfo; +#endif static int g_total; static int g_cflags; static int g_oflags; @@ -1260,6 +1263,16 @@ intr(int signo) g_impatient = 1; } +#ifdef __FreeBSD__ +static void +siginfo(int signo __unused) +{ + + g_siginfo++; + g_newline = 1; +} +#endif + static void installsighands(void) { @@ -1275,12 +1288,16 @@ installsighands(void) if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGTERM, &act, NULL); -#ifndef illumos +#ifdef __FreeBSD__ if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGPIPE, &act, NULL); if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGUSR1, &act, NULL); + + act.sa_handler = siginfo; + if (sigaction(SIGINFO, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGINFO, &act, NULL); #endif } @@ -1944,6 +1961,13 @@ main(int argc, char *argv[]) if (!g_intr && !done) dtrace_sleep(g_dtp); +#ifdef __FreeBSD__ + if (g_siginfo) { + (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL); + g_siginfo = 0; + } +#endif + if (g_newline) { /* * Output a newline just to make the output look Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Fri Aug 19 16:45:21 2016 (r304468) @@ -25,6 +25,10 @@ # Use is subject to license terms. # +# +# Copyright (c) 2014, 2016 by Delphix. All rights reserved. +# + require 5.8.4; $PNAME = $0; @@ -131,7 +135,8 @@ sub dstyle } if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ && - !/^translator/ && !/^provider/) { + !/^translator/ && !/^provider/ && !/\tif / && + !/ else /) { if (/[\w\s]+{/) { err "left brace not on its own line"; } @@ -141,7 +146,7 @@ sub dstyle } } - if (!/;$/) { + if (!/;$/ && !/\t*}$/ && !/ else /) { if (/[\w\s]+}/) { err "right brace not on its own line"; } Copied: user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d (from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d Fri Aug 19 16:45:21 2016 (r304468, copy of r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +char *k; + +BEGIN +{ + j = probeprov; + k = j; + k[0] = 'D'; + k[1] = 'T'; +} + +BEGIN +{ + trace(stringof(k)); + exit(k == "DTrace" ? 0 : 1); +} Copied: user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d (from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Fri Aug 19 16:45:21 2016 (r304468, copy of r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +BEGIN +{ + this->j = probeprov; + this->j[0] = 'D'; + this->j[1] = 'T'; +} + +BEGIN +{ + trace(this->j); + exit(this->j == "DTrace" ? 0 : 1); +} Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Fri Aug 19 16:45:21 2016 (r304468) @@ -21,8 +21,9 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2015 Gary Mills */ /* @@ -119,7 +120,6 @@ static const dtrace_diftype_t dt_int_rty static void *dt_compile(dtrace_hdl_t *, int, dtrace_probespec_t, void *, uint_t, int, char *const[], FILE *, const char *); - /*ARGSUSED*/ static int dt_idreset(dt_idhash_t *dhp, dt_ident_t *idp, void *ignored) @@ -2435,7 +2435,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex dt_node_t *dnp; dt_decl_t *ddp; dt_pcb_t pcb; - void *rv; + void *volatile rv; int err; if ((fp == NULL && s == NULL) || (cflags & ~DTRACE_C_MASK) != 0) { @@ -2518,6 +2518,28 @@ dt_compile(dtrace_hdl_t *dtp, int contex } /* + * Perform sugar transformations (for "if" / "else") and replace the + * existing clause chain with the new one. + */ + if (context == DT_CTX_DPROG) { + dt_node_t *dnp, *next_dnp; + dt_node_t *new_list = NULL; + + for (dnp = yypcb->pcb_root->dn_list; + dnp != NULL; dnp = next_dnp) { + /* remove this node from the list */ + next_dnp = dnp->dn_list; + dnp->dn_list = NULL; + + if (dnp->dn_kind == DT_NODE_CLAUSE) + dnp = dt_compile_sugar(dtp, dnp); + /* append node to the new list */ + new_list = dt_node_link(new_list, dnp); + } + yypcb->pcb_root->dn_list = new_list; + } + + /* * If we have successfully created a parse tree for a D program, loop * over the clauses and actions and instantiate the corresponding * libdtrace program. If we are parsing a D expression, then we @@ -2537,6 +2559,8 @@ dt_compile(dtrace_hdl_t *dtp, int contex for (; dnp != NULL; dnp = dnp->dn_list) { switch (dnp->dn_kind) { case DT_NODE_CLAUSE: + if (DT_TREEDUMP_PASS(dtp, 4)) + dt_printd(dnp, stderr, 0); dt_compile_clause(dtp, dnp); break; case DT_NODE_XLATOR: Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Fri Aug 19 16:45:21 2016 (r304468) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -155,6 +156,8 @@ %type probe_specifier_list %type probe_specifier %type statement_list +%type statement_list_impl +%type statement_or_block %type statement %type declaration %type init_declarator_list @@ -319,9 +322,11 @@ probe_definition: "or actions following probe description\n"); } $$ = dt_node_clause($1, NULL, NULL); + yybegin(YYS_CLAUSE); } | probe_specifiers '{' statement_list '}' { $$ = dt_node_clause($1, NULL, $3); + yybegin(YYS_CLAUSE); } | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED { dnerror($3, D_SYNTAX, "expected actions { } following " @@ -330,6 +335,7 @@ probe_definition: | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED '{' statement_list '}' { $$ = dt_node_clause($1, $3, $6); + yybegin(YYS_CLAUSE); } ; @@ -349,12 +355,30 @@ probe_specifier: | DT_TOK_INT { $$ = dt_node_pdesc_by_id($1); } ; -statement_list: statement { $$ = $1; } - | statement_list ';' statement { $$ = LINK($1, $3); } +statement_list_impl: /* empty */ { $$ = NULL; } + | statement_list_impl statement { $$ = LINK($1, $2); } + ; + +statement_list: + statement_list_impl { $$ = $1; } + | statement_list_impl expression { + $$ = LINK($1, dt_node_statement($2)); + } ; -statement: /* empty */ { $$ = NULL; } - | expression { $$ = dt_node_statement($1); } +statement_or_block: + statement + | '{' statement_list '}' { $$ = $2; } + +statement: ';' { $$ = NULL; } + | expression ';' { $$ = dt_node_statement($1); } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR statement_or_block { + $$ = dt_node_if($3, $5, NULL); + } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR + statement_or_block DT_KEY_ELSE statement_or_block { + $$ = dt_node_if($3, $5, $7); + } ; argument_expression_list: Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Fri Aug 19 16:45:21 2016 (r304468) @@ -26,7 +26,7 @@ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ #ifndef _DT_IMPL_H @@ -362,6 +362,7 @@ struct dtrace_hdl { int dt_indent; /* recommended flow indent */ dtrace_epid_t dt_last_epid; /* most recently consumed EPID */ uint64_t dt_last_timestamp; /* most recently consumed timestamp */ + boolean_t dt_has_sugar; /* syntactic sugar used? */ }; /* Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 19 16:45:21 2016 (r304468) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #include @@ -130,8 +130,9 @@ #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) #define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) -#define DT_VERS_LATEST DT_VERS_1_12_1 -#define DT_VERS_STRING "Sun D 1.12.1" +#define DT_VERS_1_13 DT_VERSION_NUMBER(1, 13, 0) +#define DT_VERS_LATEST DT_VERS_1_13 +#define DT_VERS_STRING "Sun D 1.13" const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ @@ -157,6 +158,7 @@ const dt_version_t _dtrace_versions[] = DT_VERS_1_11, /* D API 1.11 */ DT_VERS_1_12, /* D API 1.12 */ DT_VERS_1_12_1, /* D API 1.12.1 */ + DT_VERS_1_13, /* D API 1.13 */ 0 }; Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Fri Aug 19 16:45:21 2016 (r304468) @@ -23,7 +23,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -2143,6 +2143,17 @@ dt_node_statement(dt_node_t *expr) } dt_node_t * +dt_node_if(dt_node_t *pred, dt_node_t *acts, dt_node_t *else_acts) +{ + dt_node_t *dnp = dt_node_alloc(DT_NODE_IF); + dnp->dn_conditional = pred; + dnp->dn_body = acts; + dnp->dn_alternate_body = else_acts; + + return (dnp); +} + +dt_node_t * dt_node_pdesc_by_name(char *spec) { dtrace_hdl_t *dtp = yypcb->pcb_hdl; @@ -2211,7 +2222,6 @@ dt_node_clause(dt_node_t *pdescs, dt_nod dnp->dn_pred = pred; dnp->dn_acts = acts; - yybegin(YYS_CLAUSE); return (dnp); } @@ -3203,8 +3213,9 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla dt_xcook_ident(lp, dhp, idkind, B_TRUE); else dt_xcook_ident(lp, dhp, idp->di_kind, B_FALSE); - } else + } else { lp = dnp->dn_left = dt_node_cook(lp, 0); + } /* * Switch op to '+' for *(E1 + E2) array mode in these cases: @@ -3218,10 +3229,12 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla if (lp->dn_ident->di_kind == DT_IDENT_ARRAY) { if (lp->dn_args != NULL) op = DT_TOK_ADD; - } else if (!dt_ident_unref(lp->dn_ident)) + } else if (!dt_ident_unref(lp->dn_ident)) { op = DT_TOK_ADD; - } else if (lp->dn_kind != DT_NODE_AGG) + } + } else if (lp->dn_kind != DT_NODE_AGG) { op = DT_TOK_ADD; + } } switch (op) { @@ -3645,45 +3658,34 @@ asgn_common: case DT_TOK_PTR: /* - * If the left-hand side of operator -> is the name "self", - * then we permit a TLS variable to be created or referenced. + * If the left-hand side of operator -> is one of the scoping + * keywords, permit a local or thread variable to be created or + * referenced. */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "self") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, dtp->dt_tls, - DT_IDENT_SCALAR, B_TRUE); - } - - if (idflags != 0) - rp = dt_node_cook(rp, idflags); - - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); - } + if (lp->dn_kind == DT_NODE_IDENT) { + dt_idhash_t *dhp = NULL; - /* - * If the left-hand side of operator -> is the name "this", - * then we permit a local variable to be created or referenced. - */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "this") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, yypcb->pcb_locals, - DT_IDENT_SCALAR, B_TRUE); + if (strcmp(lp->dn_string, "self") == 0) { + dhp = dtp->dt_tls; + } else if (strcmp(lp->dn_string, "this") == 0) { + dhp = yypcb->pcb_locals; } + if (dhp != NULL) { + if (rp->dn_kind != DT_NODE_VAR) { + dt_xcook_ident(rp, dhp, + DT_IDENT_SCALAR, B_TRUE); + } - if (idflags != 0) - rp = dt_node_cook(rp, idflags); + if (idflags != 0) + rp = dt_node_cook(rp, idflags); - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); + /* avoid freeing rp */ + dnp->dn_right = dnp->dn_left; + dt_node_free(dnp); + return (rp); + } } - /*FALLTHRU*/ - case DT_TOK_DOT: lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF); @@ -4502,7 +4504,8 @@ static dt_node_t *(*dt_cook_funcs[])(dt_ dt_cook_xlator, /* DT_NODE_XLATOR */ dt_cook_none, /* DT_NODE_PROBE */ dt_cook_provider, /* DT_NODE_PROVIDER */ - dt_cook_none /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_IF */ }; /* @@ -4517,6 +4520,8 @@ dt_node_cook(dt_node_t *dnp, uint_t idfl yylineno = dnp->dn_line; + assert(dnp->dn_kind < + sizeof (dt_cook_funcs) / sizeof (dt_cook_funcs[0])); dnp = dt_cook_funcs[dnp->dn_kind](dnp, idflags); dnp->dn_flags |= DT_NF_COOKED; @@ -4619,6 +4624,181 @@ dt_node_diftype(dtrace_hdl_t *dtp, const tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type); } +/* + * Output the parse tree as D. The "-xtree=8" argument will call this + * function to print out the program after any syntactic sugar + * transformations have been applied (e.g. to implement "if"). The + * resulting output can be used to understand the transformations + * applied by these features, or to run such a script on a system that + * does not support these features + * + * Note that the output does not express precisely the same program as + * the input. In particular: + * - Only the clauses are output. #pragma options, variable + * declarations, etc. are excluded. + * - Command argument substitution has already been done, so the output + * will not contain e.g. $$1, but rather the substituted string. + */ +void +dt_printd(dt_node_t *dnp, FILE *fp, int depth) +{ + dt_node_t *arg; + + switch (dnp->dn_kind) { + case DT_NODE_INT: + (void) fprintf(fp, "0x%llx", (u_longlong_t)dnp->dn_value); + if (!(dnp->dn_flags & DT_NF_SIGNED)) + (void) fprintf(fp, "u"); + break; + + case DT_NODE_STRING: { + char *escd = strchr2esc(dnp->dn_string, strlen(dnp->dn_string)); + (void) fprintf(fp, "\"%s\"", escd); + free(escd); + break; + } + + case DT_NODE_IDENT: + (void) fprintf(fp, "%s", dnp->dn_string); + break; + + case DT_NODE_VAR: + (void) fprintf(fp, "%s%s", + (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) ? "this->" : + (dnp->dn_ident->di_flags & DT_IDFLG_TLS) ? "self->" : "", + dnp->dn_ident->di_name); + + if (dnp->dn_args != NULL) { + (void) fprintf(fp, "["); + + for (arg = dnp->dn_args; arg != NULL; + arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + + (void) fprintf(fp, "]"); + } + break; + + case DT_NODE_SYM: { + const dtrace_syminfo_t *dts = dnp->dn_ident->di_data; + (void) fprintf(fp, "%s`%s", dts->dts_object, dts->dts_name); + break; + } + case DT_NODE_FUNC: + (void) fprintf(fp, "%s(", dnp->dn_ident->di_name); + + for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP1: + (void) fprintf(fp, "%s(", opstr(dnp->dn_op)); + dt_printd(dnp->dn_child, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP2: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_left, fp, 0); + if (dnp->dn_op == DT_TOK_LPAR) { + (void) fprintf(fp, ")"); + dt_printd(dnp->dn_right, fp, 0); + break; + } + if (dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT || + dnp->dn_op == DT_TOK_LBRAC) + (void) fprintf(fp, "%s", opstr(dnp->dn_op)); + else + (void) fprintf(fp, " %s ", opstr(dnp->dn_op)); + dt_printd(dnp->dn_right, fp, 0); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + (void) fprintf(fp, ", "); + dt_printd(ln->dn_list, fp, depth); + ln = ln->dn_list; + } + (void) fprintf(fp, "]"); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP3: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_expr, fp, 0); + (void) fprintf(fp, " ? "); + dt_printd(dnp->dn_left, fp, 0); + (void) fprintf(fp, " : "); + dt_printd(dnp->dn_right, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_DEXPR: + case DT_NODE_DFUNC: + (void) fprintf(fp, "%*s", depth * 8, ""); + dt_printd(dnp->dn_expr, fp, depth + 1); + (void) fprintf(fp, ";\n"); + break; + + case DT_NODE_PDESC: + (void) fprintf(fp, "%s:%s:%s:%s", + dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod, + dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name); + break; + + case DT_NODE_CLAUSE: + for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ","); + (void) fprintf(fp, "\n"); + } + + if (dnp->dn_pred != NULL) { + (void) fprintf(fp, "/"); + dt_printd(dnp->dn_pred, fp, 0); + (void) fprintf(fp, "/\n"); + } + (void) fprintf(fp, "{\n"); + + for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "}\n"); + (void) fprintf(fp, "\n"); + break; + + case DT_NODE_IF: + (void) fprintf(fp, "%*sif (", depth * 8, ""); + dt_printd(dnp->dn_conditional, fp, 0); + (void) fprintf(fp, ") {\n"); + + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + if (dnp->dn_alternate_body == NULL) { + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } else { + (void) fprintf(fp, "%*s} else {\n", depth * 8, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } + + break; + + default: + (void) fprintf(fp, "/* bad node %p, kind %d */\n", + (void *)dnp, dnp->dn_kind); + } +} + void dt_node_printr(dt_node_t *dnp, FILE *fp, int depth) { @@ -4729,6 +4909,13 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, (void) fprintf(fp, "OP2 %s (%s)\n", opstr(dnp->dn_op), buf); dt_node_printr(dnp->dn_left, fp, depth + 1); dt_node_printr(dnp->dn_right, fp, depth + 1); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + dt_node_printr(ln->dn_list, fp, depth + 1); + ln = ln->dn_list; + } + } break; case DT_NODE_OP3: @@ -4790,6 +4977,7 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) dt_node_printr(arg, fp, depth + 1); + (void) fprintf(fp, "\n"); break; case DT_NODE_INLINE: @@ -4840,6 +5028,24 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, dt_node_printr(arg, fp, depth + 1); break; + case DT_NODE_IF: + (void) fprintf(fp, "IF attr=%s CONDITION:\n", a); + + dt_node_printr(dnp->dn_conditional, fp, depth + 1); + + (void) fprintf(fp, "%*sIF BODY: \n", depth * 2, ""); + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + + if (dnp->dn_alternate_body != NULL) { + (void) fprintf(fp, "%*sIF ELSE: \n", depth * 2, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + } + + break; + default: (void) fprintf(fp, "\n", (void *)dnp, dnp->dn_kind); Modified: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h ============================================================================== --- user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Fri Aug 19 16:38:57 2016 (r304467) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Fri Aug 19 16:45:21 2016 (r304468) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -105,6 +105,12 @@ typedef struct dt_node { struct dt_node *_probes; /* list of probe nodes */ int _redecl; /* provider redeclared */ } _provider; + + struct { + struct dt_node *_conditional; + struct dt_node *_body; + struct dt_node *_alternate_body; + } _conditional; } dn_u; struct dt_node *dn_list; /* parse tree list link */ @@ -140,6 +146,11 @@ typedef struct dt_node { #define dn_provred dn_u._provider._redecl /* DT_NODE_PROVIDER */ #define dn_probes dn_u._provider._probes /* DT_NODE_PROVIDER */ +/* DT_NODE_IF: */ +#define dn_conditional dn_u._conditional._conditional +#define dn_body dn_u._conditional._body +#define dn_alternate_body dn_u._conditional._alternate_body + #define DT_NODE_FREE 0 /* unused node (waiting to be freed) */ #define DT_NODE_INT 1 /* integer value */ #define DT_NODE_STRING 2 /* string value */ @@ -162,6 +173,7 @@ typedef struct dt_node { #define DT_NODE_PROBE 19 /* probe definition */ #define DT_NODE_PROVIDER 20 /* provider definition */ #define DT_NODE_PROG 21 /* program translation unit */ +#define DT_NODE_IF 22 /* if statement */ #define DT_NF_SIGNED 0x01 /* data is a signed quantity (else unsigned) */ #define DT_NF_COOKED 0x02 /* data is a known type (else still cooking) */ @@ -213,6 +225,7 @@ extern dt_node_t *dt_node_xlator(dt_decl extern dt_node_t *dt_node_probe(char *, int, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_provider(char *, dt_node_t *); extern dt_node_t *dt_node_program(dt_node_t *); +extern dt_node_t *dt_node_if(dt_node_t *, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_link(dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_cook(dt_node_t *, uint_t); @@ -237,6 +250,7 @@ extern void dt_node_promote(dt_node_t *, extern void dt_node_diftype(dtrace_hdl_t *, const dt_node_t *, dtrace_diftype_t *); extern void dt_node_printr(dt_node_t *, FILE *, int); +extern void dt_printd(dt_node_t *, FILE *, int); extern const char *dt_node_name(const dt_node_t *, char *, size_t); extern int dt_node_root(dt_node_t *); Copied: user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c (from r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/alc/PG_CACHED/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c Fri Aug 19 16:45:21 2016 (r304468, copy of r304467, user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c) @@ -0,0 +1,516 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + */ + +/* + * Syntactic sugar features are implemented by transforming the D parse tree + * such that it only uses the subset of D that is supported by the rest of the + * compiler / the kernel. A clause containing these language features is + * referred to as a "super-clause", and its transformation typically entails + * creating several "sub-clauses" to implement it. For diagnosability, the + * sub-clauses will be printed if the "-xtree=8" flag is specified. + * + * Currently, the only syntactic sugar feature is "if/else" statements. Each + * basic block (e.g. the body of the "if" and "else" statements, and the + * statements before and after) is turned into its own sub-clause, with a + * predicate that causes it to be executed only if the code flows to this point. + * Nested if/else statements are supported. + * + * This infrastructure is designed to accommodate other syntactic sugar features + * in the future. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct dt_sugar_parse { + dtrace_hdl_t *dtsp_dtp; /* dtrace handle */ + dt_node_t *dtsp_pdescs; /* probe descriptions */ + int dtsp_num_conditions; /* number of condition variables */ + int dtsp_num_ifs; /* number of "if" statements */ + dt_node_t *dtsp_clause_list; /* list of clauses */ +} dt_sugar_parse_t; + +static void dt_sugar_visit_stmts(dt_sugar_parse_t *, dt_node_t *, int); + +/* + * Return a node for "self->%error". + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + * + * This error variable is used to keep track of if there has been an error + * in any of the sub-clauses, and is used to prevent execution of subsequent + * sub-clauses following an error. + */ +static dt_node_t * +dt_sugar_new_error_var(void) +{ + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("self")), + dt_node_ident(strdup("%error")))); +} + +/* + * Append this clause to the clause list. + */ +static void +dt_sugar_append_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(dp->dtsp_clause_list, clause); +} + +/* + * Prepend this clause to the clause list. + */ +static void +dt_sugar_prepend_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(clause, dp->dtsp_clause_list); +} + +/* + * Return a node for "this->%condition_", or NULL if condid==0. + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + */ +static dt_node_t * +dt_sugar_new_condition_var(int condid) +{ + char *str; + + if (condid == 0) + return (NULL); + assert(condid > 0); + + (void) asprintf(&str, "%%condition_%d", ABS(condid)); + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("this")), + dt_node_ident(str))); +} + +/* + * Return new clause to evaluate predicate and set newcond. condid is + * the condition that we are already under, or 0 if none. + * The new clause will be of the form: + * + * dp_pdescs + * /!self->%error/ + * { + * this->%condition_ = + * (this->%condition_ && pred); + * } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Fri Aug 19 17:50:15 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F830BBFC00 for ; Fri, 19 Aug 2016 17:50:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40450138D; Fri, 19 Aug 2016 17:50:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHoEkP026418; Fri, 19 Aug 2016 17:50:14 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHoEo6026417; Fri, 19 Aug 2016 17:50:14 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608191750.u7JHoEo6026417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 19 Aug 2016 17:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304480 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 17:50:15 -0000 Author: alc Date: Fri Aug 19 17:50:14 2016 New Revision: 304480 URL: https://svnweb.freebsd.org/changeset/base/304480 Log: Rename "gen" to the more descriptive "last_launder". Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 19 17:49:49 2016 (r304479) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 19 17:50:14 2016 (r304480) @@ -1096,7 +1096,7 @@ vm_pageout_laundry_worker(void *arg) { struct vm_domain *domain; uint64_t nclean, nlaundry; - u_int wakeups, gen; + u_int last_launder, wakeups; int cycle, domidx, launder, prev_shortfall, shortfall, target; domidx = (uintptr_t)arg; @@ -1105,7 +1105,7 @@ vm_pageout_laundry_worker(void *arg) vm_pageout_init_marker(&domain->vmd_laundry_marker, PQ_LAUNDRY); cycle = 0; - gen = 0; + last_launder = 0; shortfall = prev_shortfall = 0; target = 0; @@ -1147,7 +1147,7 @@ vm_pageout_laundry_worker(void *arg) */ if (vm_laundry_target() <= 0 || cycle == 0) { shortfall = prev_shortfall = target = 0; - gen = wakeups; + last_launder = wakeups; } else { launder = target / cycle--; goto dolaundry; @@ -1170,9 +1170,9 @@ vm_pageout_laundry_worker(void *arg) */ nclean = vm_cnt.v_inactive_count + vm_cnt.v_free_count; nlaundry = vm_cnt.v_laundry_count; - if (target == 0 && wakeups != gen && - nlaundry * isqrt(wakeups - gen) >= nclean) { - gen = wakeups; + if (target == 0 && wakeups != last_launder && + nlaundry * isqrt(wakeups - last_launder) >= nclean) { + last_launder = wakeups; /* * The pagedaemon has woken up at least once since the From owner-svn-src-user@freebsd.org Sat Aug 20 19:12:53 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0833BC0547 for ; Sat, 20 Aug 2016 19:12:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADD42180B; Sat, 20 Aug 2016 19:12:53 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KJCqUq098048; Sat, 20 Aug 2016 19:12:52 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KJCquH098047; Sat, 20 Aug 2016 19:12:52 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608201912.u7KJCquH098047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 20 Aug 2016 19:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r304539 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2016 19:12:54 -0000 Author: alc Date: Sat Aug 20 19:12:52 2016 New Revision: 304539 URL: https://svnweb.freebsd.org/changeset/base/304539 Log: Simplify vm_pageout_laundry_worker() a bit. We don't need "shortfall" to be valid across iterations of the main loop. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Sat Aug 20 18:52:03 2016 (r304538) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Sat Aug 20 19:12:52 2016 (r304539) @@ -1106,7 +1106,7 @@ vm_pageout_laundry_worker(void *arg) cycle = 0; last_launder = 0; - shortfall = prev_shortfall = 0; + prev_shortfall = 0; target = 0; /* @@ -1146,7 +1146,7 @@ vm_pageout_laundry_worker(void *arg) * pages. Otherwise keep laundering. */ if (vm_laundry_target() <= 0 || cycle == 0) { - shortfall = prev_shortfall = target = 0; + prev_shortfall = target = 0; last_launder = wakeups; } else { launder = target / cycle--; @@ -1215,7 +1215,7 @@ vm_pageout_laundry_worker(void *arg) dolaundry: if (launder > 0) target -= min(vm_pageout_launder(domain, launder, - shortfall > 0), target); + prev_shortfall > 0), target); tsleep(&vm_cnt.v_laundry_count, PVM, "laundr", hz / VM_LAUNDER_INTERVAL);